diff --git a/pkg/rpc/client/rpc_test.go b/pkg/rpc/client/rpc_test.go index cf89eeae9..d7e1437f1 100644 --- a/pkg/rpc/client/rpc_test.go +++ b/pkg/rpc/client/rpc_test.go @@ -913,6 +913,20 @@ var rpcClientTestCases = map[string][]rpcClientTestCase{ }, }, }, + "verifyproof": { + { + name: "positive", + invoke: func(c *Client) (interface{}, error) { + return c.VerifyProof(util.Uint256{}, new(result.ProofWithKey)) + }, + serverResponse: `{"id":1,"jsonrpc":"2.0","result":{"value":"7465737476616c7565"}}`, + result: func(c *Client) interface{} { + return &result.VerifyProof{ + Value: []byte("testvalue"), + } + }, + }, + }, } type rpcClientErrorCase struct { diff --git a/pkg/rpc/client/state.go b/pkg/rpc/client/state.go index b3259279d..bfd78439b 100644 --- a/pkg/rpc/client/state.go +++ b/pkg/rpc/client/state.go @@ -48,3 +48,14 @@ func (c *Client) GetProof(root util.Uint256, sc util.Uint160, key []byte) (*resu } return &resp, nil } + +// VerifyProof verifies keyed proof for the state with the specified root. +func (c *Client) VerifyProof(root util.Uint256, proof *result.ProofWithKey) (*result.VerifyProof, error) { + resp := new(result.VerifyProof) + ps := request.NewRawParams(root, proof.String()) + err := c.performRequest("verifyproof", ps, resp) + if err != nil { + return nil, err + } + return resp, nil +}