@@ -179,24 +179,24 @@ def verify_proof(proof: List[Node], raw_leaf: str, root: str, **kwargs) -> bool:
179
179
"""
180
180
Verify the validity of a Merkle proof for a given leaf against the expected root hash.
181
181
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
184
184
the hashes along the proof path.
185
185
186
186
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
188
188
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
190
190
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
192
192
proof should reconstruct if valid.
193
193
**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,
196
196
the default `keccak` function is used.
197
197
198
198
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
200
200
hash; otherwise, returns False.
201
201
202
202
Example:
0 commit comments