diff --git a/pkg/core/blockchain_neotest_test.go b/pkg/core/blockchain_neotest_test.go index e09be9a04..80b30068b 100644 --- a/pkg/core/blockchain_neotest_test.go +++ b/pkg/core/blockchain_neotest_test.go @@ -277,7 +277,7 @@ func TestBlockchain_StartFromExistingDB(t *testing.T) { cache := storage.NewMemCachedStore(ps) // Extra wrapper to avoid good DB corruption. key := make([]byte, 5) key[0] = byte(storage.DataMPTAux) - binary.BigEndian.PutUint32(key, h) + binary.BigEndian.PutUint32(key[1:], h) cache.Delete(key) _, _, _, err := chain.NewMultiWithCustomConfigAndStoreNoCheck(t, customConfig, cache) diff --git a/pkg/core/stateroot/store.go b/pkg/core/stateroot/store.go index be6529ca4..c334115fb 100644 --- a/pkg/core/stateroot/store.go +++ b/pkg/core/stateroot/store.go @@ -51,7 +51,7 @@ func (s *Module) getStateRoot(key []byte) (*state.MPTRoot, error) { func makeStateRootKey(index uint32) []byte { key := make([]byte, 5) key[0] = byte(storage.DataMPTAux) - binary.BigEndian.PutUint32(key, index) + binary.BigEndian.PutUint32(key[1:], index) return key }