Skip to content

Commit 3b20599

Browse files
committed
add patch
1 parent 9e2d5a0 commit 3b20599

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: packages/store/src/StoreCore.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,8 @@ library StoreCoreInternal {
10031003
}
10041004

10051005
// The start index can't be larger than the previous length of the field
1006-
if (startWithinField > previousFieldLength) {
1007-
revert IStoreErrors.Store_IndexOutOfBounds(previousFieldLength, startWithinField);
1006+
if (startWithinField > previousFieldLength - deleteCount) {
1007+
revert IStoreErrors.Store_IndexOutOfBounds(previousFieldLength - deleteCount, startWithinField);
10081008
}
10091009

10101010
// Update the encoded length

Diff for: packages/store/test/StoreCore.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ contract StoreCoreTest is Test, StoreMock {
10231023
vm.expectRevert(
10241024
abi.encodeWithSelector(
10251025
IStoreErrors.Store_IndexOutOfBounds.selector,
1026-
data.newThirdDataBytes.length,
1026+
data.newThirdDataBytes.length - uint40(data.thirdDataForUpdate.length),
10271027
uint40(type(uint56).max)
10281028
)
10291029
);

0 commit comments

Comments
 (0)