From c8f4eee5f49f20af30b6d201eecab4242e846a67 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 13 Mar 2020 16:47:08 +0300 Subject: [PATCH] rpc: fix invocations of contracts using hash160 ERROR Error encountered with rpc request {"error": "expected string size of 40 got 42",... --- pkg/rpc/request/param.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/rpc/request/param.go b/pkg/rpc/request/param.go index 66e054842..fa9141546 100644 --- a/pkg/rpc/request/param.go +++ b/pkg/rpc/request/param.go @@ -86,6 +86,9 @@ func (p Param) GetUint160FromHex() (util.Uint160, error) { if err != nil { return util.Uint160{}, err } + if len(s) == 2*util.Uint160Size+2 && s[0] == '0' && s[1] == 'x' { + s = s[2:] + } return util.Uint160DecodeStringLE(s) }