Skip to content

Commit

Permalink
Merge branch 'development' of github.com:ChainSafe/gossamer into noot…
Browse files Browse the repository at this point in the history
…/update-grandpa-messages
  • Loading branch information
noot committed Apr 22, 2021
2 parents 98cafe9 + 1a3dea2 commit 115faa5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion lib/babe/babe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions tests/polkadotjs_test/test_transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}

Expand Down

0 comments on commit 115faa5

Please sign in to comment.