We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f794cec commit 335e585Copy full SHA for 335e585
src/TreeCbor.sol
@@ -110,8 +110,11 @@ library TreeCbor {
110
111
for (uint i = 0; i < currentNode.entries.length; i++) {
112
rightWalk[i] = currentNode.entries[i].tree;
113
- // TODO: match on key lol
114
- if (CidCbor.Cid.unwrap(currentNode.entries[i].value) == CidCbor.Cid.unwrap(targetCid)) {
+ if (keccak256(abi.encode(currentNode.entries[i].key)) == keccak256(abi.encode(targetKey))) {
+ require(
115
+ CidCbor.Cid.unwrap(currentNode.entries[i].value) == CidCbor.Cid.unwrap(targetCid),
116
+ "cid mismatch"
117
+ );
118
require(!found, "duplicate entry");
119
found = true;
120
}
0 commit comments