core: wrap cached dao properly, don't miss cached data

Fixes #817 where invoked contract missed updated account information because
it got it one layer below cachedDao used to process the block.
This commit is contained in:
Roman Khimov 2020-04-03 09:49:01 +03:00
parent f64aa201c7
commit 5f09381cf4
12 changed files with 251 additions and 113 deletions

View file

@ -881,7 +881,7 @@ func (s *Server) invokescript(reqParams request.Params) (interface{}, error) {
// runScriptInVM runs given script in a new test VM and returns the invocation
// result.
func (s *Server) runScriptInVM(script []byte) *result.Invoke {
vm, _ := s.chain.GetTestVM()
vm := s.chain.GetTestVM()
vm.SetGasLimit(s.config.MaxGasInvoke)
vm.LoadScript(script)
_ = vm.Run()