Skip to content

Commit 67786b2

Browse files
committed
Add a new function getProofWithHashedKey()
1 parent 4f7c2f6 commit 67786b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contracts/tree.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ library PatriciaTree {
6161
// where we have branch nodes (bit in key denotes direction)
6262
// - bytes32[] hashes - hashes of sibling edges
6363
function getProof(Tree storage tree, bytes key) internal view returns (uint branchMask, bytes32[] _siblings) {
64-
D.Label memory k = D.Label(keccak256(key), 256);
64+
return getProofWithHashedKey(tree, keccak256(key));
65+
}
66+
67+
function getProofWithHashedKey(Tree storage tree, bytes32 hashedKey) internal view returns (uint branchMask, bytes32[] _siblings) {
68+
D.Label memory k = D.Label(hashedKey, 256);
6569
D.Edge memory e = tree.rootEdge;
6670
bytes32[256] memory siblings;
6771
uint length;

0 commit comments

Comments
 (0)