Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Jan 24, 2025
1 parent 7ba3a99 commit 96fd8ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions chia/_tests/core/data_layer/test_merkle_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ def generate_kvid(seed: int) -> tuple[KVId, KVId]:
return kv_ids[0], kv_ids[1]


def generate_hash(seed: int) -> bytes:
def generate_hash(seed: int) -> bytes32:
seed_bytes = seed.to_bytes(8, byteorder="big", signed=True)
hash_obj = hashlib.sha256(seed_bytes)
return hash_obj.digest()
return bytes32(hash_obj.digest())


def test_insert_delete_loads_all_keys() -> None:
Expand Down Expand Up @@ -337,7 +337,7 @@ def test_proof_of_inclusion_merkle_blob() -> None:
num_deletes = 1 + repeats * 10

kv_ids: list[tuple[KVId, KVId]] = []
hashes: list[bytes] = []
hashes: list[bytes32] = []
for _ in range(num_inserts):
seed += 1
key, value = generate_kvid(seed)
Expand Down
2 changes: 1 addition & 1 deletion chia/data_layer/util/merkle_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def get_nodes_with_indexes(self, index: TreeIndex = TreeIndex(0)) -> list[tuple[

return this + left_nodes + right_nodes

def batch_insert(self, keys_values: list[tuple[KVId, KVId]], hashes: list[bytes]) -> None:
def batch_insert(self, keys_values: list[tuple[KVId, KVId]], hashes: list[bytes32]) -> None:
indexes: list[TreeIndex] = []

if len(self.key_to_index) <= 1:
Expand Down

0 comments on commit 96fd8ec

Please sign in to comment.