Skip to content

Commit

Permalink
move the datalayer python type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Jan 7, 2025
1 parent c6bca39 commit a1f86e2
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 110 deletions.
55 changes: 0 additions & 55 deletions wheel/generate_type_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,61 +396,6 @@ def derive_child_sk_unhardened(sk: PrivateKey, index: int) -> PrivateKey: ...
def derive_child_pk_unhardened(pk: G1Element, index: int) -> G1Element: ...
@final
class InternalNode:
@property
def parent(self) -> Optional[uint32]: ...
@property
def hash(self) -> bytes: ...
@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
def value(self) -> int64: ...
@final
class MerkleBlob:
@property
def blob(self) -> bytearray: ...
@property
def free_indexes(self) -> set[uint32]: ...
@property
def key_to_index(self) -> Mapping[int64, uint32]: ...
@property
def check_integrity_on_drop(self) -> bool: ...
def __init__(
self,
blob: bytes,
) -> None: ...
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) -> Union[InternalNode, LeafNode]: ...
def calculate_lazy_hashes(self) -> None: ...
def get_lineage_with_indexes(self, index: uint32) -> list[tuple[uint32, Union[InternalNode, LeafNode]]]:...
def get_nodes_with_indexes(self) -> list[tuple[uint32, 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]): ...
def get_hash_at_index(self, index: uint32): ...
def __len__(self) -> int: ...
@final
class MerkleSet:
def get_root(self) -> bytes32: ...
Expand Down
55 changes: 0 additions & 55 deletions wheel/python/chia_rs/chia_rs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -125,61 +125,6 @@ class AugSchemeMPL:
def derive_child_pk_unhardened(pk: G1Element, index: int) -> G1Element: ...


@final
class InternalNode:
@property
def parent(self) -> Optional[uint32]: ...
@property
def hash(self) -> bytes: ...

@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
def value(self) -> int64: ...


@final
class MerkleBlob:
@property
def blob(self) -> bytearray: ...
@property
def free_indexes(self) -> set[uint32]: ...
@property
def key_to_index(self) -> Mapping[int64, uint32]: ...
@property
def check_integrity_on_drop(self) -> bool: ...

def __init__(
self,
blob: bytes,
) -> None: ...

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) -> Union[InternalNode, LeafNode]: ...
def calculate_lazy_hashes(self) -> None: ...
def get_lineage_with_indexes(self, index: uint32) -> list[tuple[uint32, Union[InternalNode, LeafNode]]]:...
def get_nodes_with_indexes(self) -> list[tuple[uint32, 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]): ...
def get_hash_at_index(self, index: uint32): ...

def __len__(self) -> int: ...

@final
class MerkleSet:
def get_root(self) -> bytes32: ...
Expand Down
61 changes: 61 additions & 0 deletions wheel/python/chia_rs/datalayer.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from typing import Mapping, Optional, Sequence, Union, Any, ClassVar, final
from .sized_bytes import bytes32, bytes100
from .sized_ints import uint8, uint16, uint32, uint64, uint128, int8, int16, int32, int64
from typing_extensions import Self
from chia.types.blockchain_format.program import Program as ChiaProgram

@final
class InternalNode:
@property
def parent(self) -> Optional[uint32]: ...
@property
def hash(self) -> bytes: ...

@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
def value(self) -> int64: ...


@final
class MerkleBlob:
@property
def blob(self) -> bytearray: ...
@property
def free_indexes(self) -> set[uint32]: ...
@property
def key_to_index(self) -> Mapping[int64, uint32]: ...
@property
def check_integrity_on_drop(self) -> bool: ...

def __init__(
self,
blob: bytes,
) -> None: ...

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) -> Union[InternalNode, LeafNode]: ...
def calculate_lazy_hashes(self) -> None: ...
def get_lineage_with_indexes(self, index: uint32) -> list[tuple[uint32, Union[InternalNode, LeafNode]]]:...
def get_nodes_with_indexes(self) -> list[tuple[uint32, 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]): ...
def get_hash_at_index(self, index: uint32): ...

def __len__(self) -> int: ...

0 comments on commit a1f86e2

Please sign in to comment.