client: add GetCandidateRegisterPrice method
It's important for clients.
This commit is contained in:
parent
5b45a4ca8d
commit
5bdcd4c241
2 changed files with 22 additions and 1 deletions
|
@ -30,11 +30,20 @@ func (c *Client) GetNNSPrice(nnsHash util.Uint160) (int64, error) {
|
|||
|
||||
// GetGasPerBlock invokes `getGasPerBlock` method on a native NEO contract.
|
||||
func (c *Client) GetGasPerBlock() (int64, error) {
|
||||
return c.getFromNEO("getGasPerBlock")
|
||||
}
|
||||
|
||||
// GetCandidateRegisterPrice invokes `getRegisterPrice` method on native NEO contract.
|
||||
func (c *Client) GetCandidateRegisterPrice() (int64, error) {
|
||||
return c.getFromNEO("getRegisterPrice")
|
||||
}
|
||||
|
||||
func (c *Client) getFromNEO(meth string) (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")
|
||||
return c.invokeNativeGetMethod(neoHash, meth)
|
||||
}
|
||||
|
||||
// GetDesignatedByRole invokes `getDesignatedByRole` method on a native RoleManagement contract.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue