rpc: add GetStateHeight to client

This commit is contained in:
Roman Khimov 2021-07-22 20:02:59 +03:00
parent a188d20fd1
commit 7366d45985
2 changed files with 27 additions and 0 deletions

View file

@ -374,6 +374,18 @@ func (c *Client) GetRawTransactionVerbose(hash util.Uint256) (*result.Transactio
return resp, nil
}
// GetStateHeight returns current validated and local node state height.
func (c *Client) GetStateHeight() (*result.StateHeight, error) {
var (
params = request.NewRawParams()
resp = new(result.StateHeight)
)
if err := c.performRequest("getstateheight", params, resp); err != nil {
return nil, err
}
return resp, nil
}
// GetStorageByID returns the stored value, according to the contract ID and the stored key.
func (c *Client) GetStorageByID(id int32, key []byte) ([]byte, error) {
return c.getStorage(request.NewRawParams(id, base64.StdEncoding.EncodeToString(key)))