client: add gasperblock getter

It's an important chain parameter.
This commit is contained in:
Roman Khimov 2021-03-16 23:03:51 +03:00
parent 87d4939093
commit 7990fa1b61
2 changed files with 21 additions and 0 deletions

View file

@ -25,3 +25,12 @@ func (c *Client) GetNNSPrice() (int64, error) {
}
return c.invokeNativeGetMethod(nnsHash, "getPrice")
}
// GetGasPerBlock invokes `getGasPerBlock` method on a native NEO contract.
func (c *Client) GetGasPerBlock() (int64, error) {
neoHash, err := c.GetNativeContractHash(nativenames.Neo)
if err != nil {
return 0, fmt.Errorf("failed to get native NEO hash: %w", err)
}
return c.invokeNativeGetMethod(neoHash, "getGasPerBlock")
}