Skip to content

Commit 4cf7972

Browse files
committed
fix: lint
1 parent f04f7f2 commit 4cf7972

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

merkly/mtree.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -179,24 +179,24 @@ def verify_proof(proof: List[Node], raw_leaf: str, root: str, **kwargs) -> bool:
179179
"""
180180
Verify the validity of a Merkle proof for a given leaf against the expected root hash.
181181
182-
This method checks whether the provided proof can reconstruct the root hash
183-
from the given raw leaf data. It uses the specified hash function to compute
182+
This method checks whether the provided proof can reconstruct the root hash
183+
from the given raw leaf data. It uses the specified hash function to compute
184184
the hashes along the proof path.
185185
186186
Args:
187-
proof (List[Node]): A list of Nodes representing the Merkle proof. Each Node
187+
proof (List[Node]): A list of Nodes representing the Merkle proof. Each Node
188188
contains the hash of a sibling node and its position (left or right) in the tree.
189-
raw_leaf (str): The raw leaf data (in string format) for which the proof is
189+
raw_leaf (str): The raw leaf data (in string format) for which the proof is
190190
being verified. This data should correspond to a leaf in the Merkle tree.
191-
root (str): The expected root hash (in hexadecimal string format) that the
191+
root (str): The expected root hash (in hexadecimal string format) that the
192192
proof should reconstruct if valid.
193193
**kwargs: Optional keyword arguments. Can include:
194-
- hash_function (Callable[[bytes, bytes], bytes]): A custom hash function
195-
that takes two byte inputs and returns a hash. If not provided,
194+
- hash_function (Callable[[bytes, bytes], bytes]): A custom hash function
195+
that takes two byte inputs and returns a hash. If not provided,
196196
the default `keccak` function is used.
197197
198198
Returns:
199-
bool: Returns True if the proof is valid and reconstructs the expected root
199+
bool: Returns True if the proof is valid and reconstructs the expected root
200200
hash; otherwise, returns False.
201201
202202
Example:

test/merkle_proof/test_merkle_proof.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def test_verify_merkle_proof_without_leaves():
9090
assert not invalid_result, "Expected proof to be invalid for incorrect leaf"
9191

9292
# Test with a different root
93-
different_root = "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
93+
different_root = (
94+
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
95+
)
9496
different_result = MerkleTree.verify_proof(proof, leaf, different_root)
9597
assert not different_result, "Expected proof to be invalid for different root"

0 commit comments

Comments
 (0)