rpc: set transaction's script for test invocation

GetScriptContainer() interop can try to get this transaction and this attempt
will lead to hash calculation with transaction serialization, but transaction
can't be successfully serialized if it doesn't have a script set, so this
makes test invocations fail.
This commit is contained in:
Roman Khimov 2020-07-14 17:32:59 +03:00
parent 4c23aa1d7c
commit 5ba4f3ef08

View file

@ -833,6 +833,7 @@ func (s *Server) invokeFunction(reqParams request.Params) (interface{}, *respons
if err != nil {
return nil, response.NewInternalServerError("can't create invocation script", err)
}
tx.Script = script
return s.runScriptInVM(script, tx), nil
}
@ -855,6 +856,7 @@ func (s *Server) invokescript(reqParams request.Params) (interface{}, *response.
}
tx.Cosigners = cosigners
}
tx.Script = script
return s.runScriptInVM(script, tx), nil
}