File tree 1 file changed +17
-0
lines changed 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1035,6 +1035,23 @@ contract StoreCoreTest is Test, StoreMock {
1035
1035
uint40 (data.thirdDataForUpdate.length ),
1036
1036
data.thirdDataForUpdate
1037
1037
);
1038
+
1039
+ // startByteIndex + deleteCount must not overflow
1040
+ vm.expectRevert (
1041
+ abi.encodeWithSelector (
1042
+ IStoreErrors.Store_IndexOutOfBounds.selector ,
1043
+ data.newThirdDataBytes.length - 8 ,
1044
+ data.newThirdDataBytes.length
1045
+ )
1046
+ );
1047
+ this .spliceDynamicData (
1048
+ data.tableId,
1049
+ data.keyTuple,
1050
+ 1 ,
1051
+ uint40 (data.newThirdDataBytes.length ), // set start to end of the field
1052
+ uint40 (8 ), // delete 8 bytes (after the start index, so after the size of the field)
1053
+ abi.encodePacked (uint64 (1 )) // append 8 bytes
1054
+ );
1038
1055
}
1039
1056
1040
1057
function testAccessEmptyData () public {
You can’t perform that action at this time.
0 commit comments