Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
GCdePaula committed Aug 3, 2024
1 parent 2844988 commit a0c808a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/AccessLogs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,14 @@ library AccessLogs {
(bytes32 rootHash,) =
a.buffer.peekRoot(region, keccak256(abi.encodePacked(oldLeaf)));

require(
a.currentRootHash == rootHash, "Write region root doesn't match"
);
require(a.currentRootHash == rootHash, "Write word root doesn't match");

bytes32 newLeaf = setBytes8ToBytes32AtOffset(
solidityUint64ToMachineWord(newValue), oldLeaf, offset
);

bytes32 newRootHash = a.buffer.getRoot(region, newLeaf);
bytes32 newRootHash =
a.buffer.getRoot(region, keccak256(abi.encodePacked(newLeaf)));
a.currentRootHash = newRootHash;
}

Expand Down
4 changes: 2 additions & 2 deletions templates/AccessLogs.sol.template
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ library AccessLogs {
(bytes32 rootHash,) = a.buffer.peekRoot(region, keccak256(abi.encodePacked(oldLeaf)));

require(
a.currentRootHash == rootHash, "Write region root doesn't match"
a.currentRootHash == rootHash, "Write word root doesn't match"
);

bytes32 newLeaf = setBytes8ToBytes32AtOffset(
solidityUint64ToMachineWord(newValue), oldLeaf, offset
);

bytes32 newRootHash = a.buffer.getRoot(region, newLeaf);
bytes32 newRootHash = a.buffer.getRoot(region, keccak256(abi.encodePacked(newLeaf)));
a.currentRootHash = newRootHash;
}

Expand Down

0 comments on commit a0c808a

Please sign in to comment.