core: allow to provide block in GetTestVM()

Sometimes amount of GAS consumed depends on block height.
This commit is contained in:
Evgenii Stratonikov 2020-11-21 15:19:23 +03:00
parent 42ae226f9e
commit a5914f89fa
5 changed files with 6 additions and 6 deletions

View file

@ -1127,7 +1127,7 @@ func (s *Server) invokescript(reqParams request.Params) (interface{}, *response.
// runScriptInVM runs given script in a new test VM and returns the invocation
// result.
func (s *Server) runScriptInVM(script []byte, tx *transaction.Transaction) *result.Invoke {
vm := s.chain.GetTestVM(tx)
vm := s.chain.GetTestVM(tx, nil)
vm.GasLimit = int64(s.config.MaxGasInvoke)
vm.LoadScriptWithFlags(script, smartcontract.All)
err := vm.Run()