Skip to content

Commit

Permalink
a touch better
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Oct 25, 2024
1 parent aca9818 commit ef4c1dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
10 changes: 7 additions & 3 deletions wheel/generate_type_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def transform_type(m: str) -> str:


def print_class(
file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None
file: TextIO, name: str, members: list[str], extra: Optional[list[str]] = None, martialed_for_json_hint: str = "dict[str, Any]",
):
def add_indent(x: str):
return "\n " + x
Expand Down Expand Up @@ -67,9 +67,9 @@ def to_bytes(self) -> bytes: ...
def __bytes__(self) -> bytes: ...
def stream_to_bytes(self) -> bytes: ...
def get_hash(self) -> bytes32: ...
def to_json_dict(self) -> dict[str, Any]: ...
def to_json_dict(self) -> {martialed_for_json_hint}: ...
@classmethod
def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ...
def from_json_dict(cls, json_dict: {martialed_for_json_hint}) -> Self: ...
"""
)

Expand Down Expand Up @@ -407,6 +407,7 @@ def __init__(
"def __iadd__(self, other: G1Element) -> G1Element: ...",
"def derive_unhardened(self, idx: int) -> G1Element: ...",
],
martialed_for_json_hint="str",
)
print_class(
file,
Expand All @@ -422,6 +423,7 @@ def __init__(
"def __add__(self, other: G2Element) -> G2Element: ...",
"def __iadd__(self, other: G2Element) -> G2Element: ...",
],
martialed_for_json_hint="str",
)
print_class(
file,
Expand All @@ -433,6 +435,7 @@ def __init__(
"def __mul__(self, rhs: GTElement) -> GTElement: ...",
"def __imul__(self, rhs: GTElement) -> GTElement : ...",
],
martialed_for_json_hint="str",
)
print_class(
file,
Expand All @@ -449,6 +452,7 @@ def __init__(
"@staticmethod",
"def from_seed(seed: bytes) -> PrivateKey: ...",
],
martialed_for_json_hint="str",
)

print_class(
Expand Down
16 changes: 8 additions & 8 deletions wheel/python/chia_rs/chia_rs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ class G1Element:
def __bytes__(self) -> bytes: ...
def stream_to_bytes(self) -> bytes: ...
def get_hash(self) -> bytes32: ...
def to_json_dict(self) -> dict[str, Any]: ...
def to_json_dict(self) -> str: ...
@classmethod
def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ...
def from_json_dict(cls, json_dict: str) -> Self: ...

@final
class G2Element:
Expand Down Expand Up @@ -191,9 +191,9 @@ class G2Element:
def __bytes__(self) -> bytes: ...
def stream_to_bytes(self) -> bytes: ...
def get_hash(self) -> bytes32: ...
def to_json_dict(self) -> dict[str, Any]: ...
def to_json_dict(self) -> str: ...
@classmethod
def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ...
def from_json_dict(cls, json_dict: str) -> Self: ...

@final
class GTElement:
Expand All @@ -218,9 +218,9 @@ class GTElement:
def __bytes__(self) -> bytes: ...
def stream_to_bytes(self) -> bytes: ...
def get_hash(self) -> bytes32: ...
def to_json_dict(self) -> dict[str, Any]: ...
def to_json_dict(self) -> str: ...
@classmethod
def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ...
def from_json_dict(cls, json_dict: str) -> Self: ...

@final
class PrivateKey:
Expand Down Expand Up @@ -250,9 +250,9 @@ class PrivateKey:
def __bytes__(self) -> bytes: ...
def stream_to_bytes(self) -> bytes: ...
def get_hash(self) -> bytes32: ...
def to_json_dict(self) -> dict[str, Any]: ...
def to_json_dict(self) -> str: ...
@classmethod
def from_json_dict(cls, json_dict: dict[str, Any]) -> Self: ...
def from_json_dict(cls, json_dict: str) -> Self: ...

@final
class SpendConditions:
Expand Down

0 comments on commit ef4c1dd

Please sign in to comment.