Skip to content

Commit

Permalink
fix: test to support bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
olivmath committed Dec 23, 2023
1 parent 5211160 commit c8392c1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions test/test_merkle_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ def test_simple_merkle_tree_constructor():
tree = MerkleTree(leafs)

assert tree.raw_leafs == leafs
assert tree.short_leafs == [
"3ac2...",
"b555...",
"0b42...",
"f191...",
]
for i, j in zip(tree.short_leafs, [
bytes.fromhex("3ac2"),
bytes.fromhex("b555"),
bytes.fromhex("0b42"),
bytes.fromhex("f191"),
]):
assert i == j
assert tree.leafs == [
"3ac225168df54212a25c1c01fd35bebfea408fdac2e31ddd6f80a4bbf9a5f1cb",
"b5553de315e0edf504d9150af82dafa5c4667fa618ed0a6f19c69b41166c5510",
"0b42b6393c1f53060fe3ddbfcd7aadcca894465a5a438f69c87d790b2299b9b2",
"f1918e8562236eb17adc8502332f4c9c82bc14e19bfc0aa10ab674ff75b3d2f3",
bytes.fromhex("3ac225168df54212a25c1c01fd35bebfea408fdac2e31ddd6f80a4bbf9a5f1cb"),
bytes.fromhex("b5553de315e0edf504d9150af82dafa5c4667fa618ed0a6f19c69b41166c5510"),
bytes.fromhex("0b42b6393c1f53060fe3ddbfcd7aadcca894465a5a438f69c87d790b2299b9b2"),
bytes.fromhex("f1918e8562236eb17adc8502332f4c9c82bc14e19bfc0aa10ab674ff75b3d2f3"),
]

assert tree.root.hex() == "68203f90e9d07dc5859259d7536e87a6ba9d345f2552b5b9de2999ddce9ce1bf"


@mark.parametrize(
Expand Down

0 comments on commit c8392c1

Please sign in to comment.