diff --git a/dot/core/service.go b/dot/core/service.go index 747944587f..c6e452b340 100644 --- a/dot/core/service.go +++ b/dot/core/service.go @@ -462,6 +462,12 @@ func (s *Service) HandleSubmittedExtrinsic(ext types.Extrinsic) error { return nil } + ts, err := s.storageState.TrieState(nil) + if err != nil { + return err + } + s.rt.SetContextStorage(ts) + // the transaction source is External // validate the transaction externalExt := types.Extrinsic(append([]byte{byte(types.TxnExternal)}, ext...)) diff --git a/dot/state/storage.go b/dot/state/storage.go index 1c3ae45152..8da6a9cd1a 100644 --- a/dot/state/storage.go +++ b/dot/state/storage.go @@ -135,14 +135,7 @@ func (s *StorageState) TrieState(root *common.Hash) (*rtstorage.TrieState, error s.lock.RUnlock() if t != nil && t.MustHash() != *root { - var err error - t, err = s.LoadFromDB(*root) - if err != nil { - return nil, err - } - if t.MustHash() != *root { - panic("trie does not have expected root") - } + panic("trie does not have expected root") } if t == nil { diff --git a/tests/polkadotjs_test/start_polkadotjs_test.go b/tests/polkadotjs_test/start_polkadotjs_test.go index 9f02aaf880..eec1dd5835 100644 --- a/tests/polkadotjs_test/start_polkadotjs_test.go +++ b/tests/polkadotjs_test/start_polkadotjs_test.go @@ -44,7 +44,7 @@ func TestStartGossamerAndPolkadotAPI(t *testing.T) { command := "npx mocha ./test" parts := strings.Fields(command) data, err := exec.Command(parts[0], parts[1:]...).Output() - require.NoError(t, err, fmt.Sprintf("%s", data)) + require.NoError(t, err, data) //uncomment this to see log results from javascript tests //fmt.Printf("%s\n", data)