From 6db95ce15e1c51422ca0494883210105c3e742ba Mon Sep 17 00:00:00 2001 From: yonada Date: Wed, 3 Jan 2024 14:37:37 +0000 Subject: [PATCH] fix(store): onBeforeSpliceDynamicData receives the previous encoded lengths [M-01] (#2020) --- .changeset/rich-carpets-remember.md | 5 +++++ packages/store/src/StoreCore.sol | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/rich-carpets-remember.md diff --git a/.changeset/rich-carpets-remember.md b/.changeset/rich-carpets-remember.md new file mode 100644 index 0000000000..5ecc17e2ea --- /dev/null +++ b/.changeset/rich-carpets-remember.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/store": patch +--- + +Fixed `StoreCore` to pass `previousEncodedLengths` into `onBeforeSpliceDynamicData`. diff --git a/packages/store/src/StoreCore.sol b/packages/store/src/StoreCore.sol index 716d07b478..60e6e993c0 100644 --- a/packages/store/src/StoreCore.sol +++ b/packages/store/src/StoreCore.sol @@ -1021,7 +1021,7 @@ library StoreCoreInternal { dynamicFieldIndex: dynamicFieldIndex, startWithinField: startWithinField, deleteCount: deleteCount, - encodedLengths: updatedEncodedLengths, + encodedLengths: previousEncodedLengths, data: data }); }