Skip to content

Commit

Permalink
test: add storage slot invariant test
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisTsai-Csie committed Jan 10, 2024
1 parent 3109592 commit c66f07e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lendmixer/test/library/slot.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ contract SlotTest is Test {
assertEq(value2, address(0x02));
assertEq(value3, address(0x03));
}

function testFuzzGetAddressSlot(address key, address value) public {
storageLayout.addValue(key, value);

bytes32 slot = keccak256(abi.encode(key, 0));

address slotValue = storageLayout.getValue(slot);

assertEq(slotValue, value);
}
}

contract StorageLayout {
Expand Down

0 comments on commit c66f07e

Please sign in to comment.