From 02bcb1add61428be9ab2a126cfd6ce477791f542 Mon Sep 17 00:00:00 2001 From: i-norden Date: Tue, 21 Mar 2023 11:57:15 -0500 Subject: [PATCH] []byte{} val for removed storage nodes to make pgx vs sqlx results more consistent --- statediff/builder.go | 2 ++ statediff/builder_test.go | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/statediff/builder.go b/statediff/builder.go index 2cbd2fcb5..3759c67cc 100644 --- a/statediff/builder.go +++ b/statediff/builder.go @@ -499,6 +499,7 @@ func (sdb *StateDiffBuilder) buildRemovedStorageNodesFromTrie(it trie.NodeIterat CID: shared.RemovedNodeStorageCID, Removed: true, LeafKey: leafKey, + Value: []byte{}, }); err != nil { return err } @@ -580,6 +581,7 @@ func (sdb *StateDiffBuilder) deletedOrUpdatedStorage(a, b trie.NodeIterator, dif CID: shared.RemovedNodeStorageCID, Removed: true, LeafKey: leafKey, + Value: []byte{}, }); err != nil { return err } diff --git a/statediff/builder_test.go b/statediff/builder_test.go index abfb716aa..f4bef0987 100644 --- a/statediff/builder_test.go +++ b/statediff/builder_test.go @@ -1216,11 +1216,13 @@ func TestBuilderWithRemovedAccountAndStorage(t *testing.T) { Removed: true, LeafKey: slot1StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, { Removed: true, LeafKey: slot3StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, }, }, @@ -1310,6 +1312,7 @@ func TestBuilderWithRemovedAccountAndStorage(t *testing.T) { Removed: true, LeafKey: slot2StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, }, }, @@ -1381,11 +1384,13 @@ func TestBuilderWithRemovedAccountAndStorage(t *testing.T) { Removed: true, LeafKey: slot0StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, { Removed: true, LeafKey: slot3StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, }, }, @@ -1678,11 +1683,13 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) { Removed: true, LeafKey: slot1StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, { Removed: true, LeafKey: slot3StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, }, }, @@ -1740,6 +1747,7 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) { Removed: true, LeafKey: slot2StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, }, }, @@ -1807,11 +1815,13 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) { Removed: true, LeafKey: slot0StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, { Removed: true, LeafKey: slot3StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, }, }, @@ -2086,11 +2096,13 @@ func TestBuilderWithMovedAccount(t *testing.T) { Removed: true, LeafKey: slot0StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, { Removed: true, LeafKey: slot1StorageKey.Bytes(), CID: shared.RemovedNodeStorageCID, + Value: []byte{}, }, }, },