rpc: allow to get contract scripthash from address, id or name [Server]

... for `invokefunction` RPC method.
This commit is contained in:
Anna Shaleva 2020-09-25 18:43:47 +03:00
parent 15a939b1da
commit d3daaafbe4
2 changed files with 7 additions and 3 deletions

View file

@ -984,9 +984,9 @@ func (s *Server) getCommittee(_ request.Params) (interface{}, *response.Error) {
// invokeFunction implements the `invokeFunction` RPC call.
func (s *Server) invokeFunction(reqParams request.Params) (interface{}, *response.Error) {
scriptHash, err := reqParams.ValueWithType(0, request.StringT).GetUint160FromHex()
if err != nil {
return nil, response.ErrInvalidParams
scriptHash, responseErr := s.contractScriptHashFromParam(reqParams.Value(0))
if responseErr != nil {
return nil, responseErr
}
tx := &transaction.Transaction{}
checkWitnessHashesIndex := len(reqParams)