Skip to content

Commit

Permalink
update: from main#Merge branch 'main' into olivmath-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
olivmath committed Oct 31, 2023
2 parents 9875ab8 + ab20c1e commit 284ace5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest -vv
pytest -m "not benchmark" -vv
11 changes: 8 additions & 3 deletions test/benchmark/test_merkle_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,34 @@
def create_merkle_tree_root_10_leaves():
leafs = [str(i) for i in range(10)]
tree = MerkleTree(leafs)
assert tree.root == "f8b45f3031274577651c6d43e7ec3f7361e82b2295e24a9b369693354d3a2db8"
result = "f8b45f3031274577651c6d43e7ec3f7361e82b2295e24a9b369693354d3a2db8"
assert tree.root == result


def create_merkle_tree_root_100_leaves():
leafs = [str(i) for i in range(100)]
tree = MerkleTree(leafs)
assert tree.root == "8e92f7efa075e532b920ef39adb04a0147ac84d99315584dbd2a1cb868019c35"
result = "8e92f7efa075e532b920ef39adb04a0147ac84d99315584dbd2a1cb868019c35"
assert tree.root == result


def create_merkle_tree_root_1000_leaves():
leafs = [str(i) for i in range(1000)]
tree = MerkleTree(leafs)
assert tree.root == "e66024476f6ef8f431f07dca6ea0d10dd904dda4b47488a49e75f8671ba733ee"
result = "e66024476f6ef8f431f07dca6ea0d10dd904dda4b47488a49e75f8671ba733ee"
assert tree.root == result


@pytest.mark.benchmark(group="MerkleTreeRoot", timer=time.time)
def test_create_merkle_tree_root_10_leaves(benchmark):
benchmark(create_merkle_tree_root_10_leaves)


@pytest.mark.benchmark(group="MerkleTreeRoot", timer=time.time)
def test_create_merkle_tree_root_100_leaves(benchmark):
benchmark(create_merkle_tree_root_100_leaves)


@pytest.mark.benchmark(group="MerkleTreeRoot", timer=time.time)
def test_create_merkle_tree_root_1000_leaves(benchmark):
benchmark(create_merkle_tree_root_1000_leaves)

0 comments on commit 284ace5

Please sign in to comment.