diff --git a/wheel/generate_type_stubs.py b/wheel/generate_type_stubs.py index 443830ed0..a090b1524 100644 --- a/wheel/generate_type_stubs.py +++ b/wheel/generate_type_stubs.py @@ -390,22 +390,27 @@ def derive_child_sk_unhardened(sk: PrivateKey, index: int) -> PrivateKey: ... @staticmethod def derive_child_pk_unhardened(pk: G1Element, index: int) -> G1Element: ... + @final -class Node: +class InternalNode: @property def parent(self) -> Optional[uint32]: ... @property def hash(self) -> bytes: ... - # TODO: this all needs reviewed and tidied - @property - def specific(self) -> Union: ... - @property def left(self) -> uint32: ... @property def right(self) -> uint32: ... + +@final +class LeafNode: + @property + def parent(self) -> Optional[uint32]: ... + @property + def hash(self) -> bytes: ... + @property def key(self) -> int64: ... @property @@ -428,10 +433,10 @@ def __init__( def insert(self, key: int64, value: int64, hash: bytes32, reference_kid: Optional[int64] = None, side: Optional[uint8] = None) -> None: ... def delete(self, key: int64) -> None: ... - def get_raw_node(self, index: uint32) -> Node: ... + def get_raw_node(self, index: uint32) -> Union[InternalNode, LeafNode]: ... def calculate_lazy_hashes(self) -> None: ... - def get_lineage_with_indexes(self, index: uint32) -> list[tuple[uint32, Node]]:... - def get_nodes_with_indexes(self) -> list[Node]: ... + def get_lineage_with_indexes(self, index: uint32) -> list[tuple[uint32, Union[InternalNode, LeafNode]]]:... + def get_nodes_with_indexes(self) -> list[Union[InternalNode, LeafNode]]: ... def empty(self) -> bool: ... def get_root_hash(self) -> bytes32: ... def batch_insert(self, keys_values: list[tuple[int64, int64]], hashes: list[bytes32]): ... diff --git a/wheel/python/chia_rs/chia_rs.pyi b/wheel/python/chia_rs/chia_rs.pyi index 317552558..7b05716d2 100644 --- a/wheel/python/chia_rs/chia_rs.pyi +++ b/wheel/python/chia_rs/chia_rs.pyi @@ -121,22 +121,27 @@ class AugSchemeMPL: @staticmethod def derive_child_pk_unhardened(pk: G1Element, index: int) -> G1Element: ... + @final -class Node: +class InternalNode: @property def parent(self) -> Optional[uint32]: ... @property def hash(self) -> bytes: ... - # TODO: this all needs reviewed and tidied - @property - def specific(self) -> Union: ... - @property def left(self) -> uint32: ... @property def right(self) -> uint32: ... + +@final +class LeafNode: + @property + def parent(self) -> Optional[uint32]: ... + @property + def hash(self) -> bytes: ... + @property def key(self) -> int64: ... @property @@ -159,10 +164,10 @@ class MerkleBlob: def insert(self, key: int64, value: int64, hash: bytes32, reference_kid: Optional[int64] = None, side: Optional[uint8] = None) -> None: ... def delete(self, key: int64) -> None: ... - def get_raw_node(self, index: uint32) -> Node: ... + def get_raw_node(self, index: uint32) -> Union[InternalNode, LeafNode]: ... def calculate_lazy_hashes(self) -> None: ... - def get_lineage_with_indexes(self, index: uint32) -> list[tuple[uint32, Node]]:... - def get_nodes_with_indexes(self) -> list[Node]: ... + def get_lineage_with_indexes(self, index: uint32) -> list[tuple[uint32, Union[InternalNode, LeafNode]]]:... + def get_nodes_with_indexes(self) -> list[Union[InternalNode, LeafNode]]: ... def empty(self) -> bool: ... def get_root_hash(self) -> bytes32: ... def batch_insert(self, keys_values: list[tuple[int64, int64]], hashes: list[bytes32]): ...