diff --git a/go.mod b/go.mod index 70bb9c6b12..e16612d2e1 100644 --- a/go.mod +++ b/go.mod @@ -58,7 +58,7 @@ require ( golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 // indirect golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect - golang.org/x/tools v0.0.0-20200221224223-e1da425f72fd + golang.org/x/tools v0.0.0-20200221224223-e1da425f72fd // indirect google.golang.org/appengine v1.6.5 // indirect google.golang.org/protobuf v1.25.0 ) diff --git a/lib/babe/babe.go b/lib/babe/babe.go index fb937b88cd..1c211a05e5 100644 --- a/lib/babe/babe.go +++ b/lib/babe/babe.go @@ -28,6 +28,7 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" log "github.com/ChainSafe/log15" ) @@ -471,8 +472,15 @@ func (b *Service) handleSlot(slotNum uint64) error { return nil } + old := ts.Snapshot() + // block built successfully, store resulting trie in storage state - err = b.storageState.StoreTrie(ts) + oldTs, err := rtstorage.NewTrieState(old) + if err != nil { + return err + } + + err = b.storageState.StoreTrie(oldTs) if err != nil { logger.Error("failed to store trie in storage state", "error", err) } diff --git a/tests/polkadotjs_test/test_transaction.js b/tests/polkadotjs_test/test_transaction.js index ef7e448cd5..1d2db7e699 100644 --- a/tests/polkadotjs_test/test_transaction.js +++ b/tests/polkadotjs_test/test_transaction.js @@ -19,8 +19,7 @@ async function main() { const ADDR_Bob = '0x90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22'; // bob 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty - const transfer = await api.tx.balances.transfer(bobKey.address, 12345) - .signAndSend(aliceKey); + const transfer = await api.tx.balances.transfer(bobKey.address, 12345).signAndSend(aliceKey); console.log(`hxHash ${transfer}`); }