rpc: adjust getunclaimedgas RPC-call

Part of #1130
This commit is contained in:
Anna Shaleva 2020-07-09 17:25:26 +03:00
parent 3a3cd0353d
commit 2ab23dc56a
5 changed files with 80 additions and 18 deletions

View file

@ -2,7 +2,6 @@ package client
import (
"encoding/hex"
"strconv"
"github.com/nspcc-dev/neo-go/pkg/core"
"github.com/nspcc-dev/neo-go/pkg/core/block"
@ -308,19 +307,15 @@ func (c *Client) GetTransactionHeight(hash util.Uint256) (uint32, error) {
}
// GetUnclaimedGas returns unclaimed GAS amount for the specified address.
func (c *Client) GetUnclaimedGas(address string) (util.Fixed8, error) {
func (c *Client) GetUnclaimedGas(address string) (result.UnclaimedGas, error) {
var (
params = request.NewRawParams(address)
resp string
resp result.UnclaimedGas
)
if err := c.performRequest("getunclaimedgas", params, &resp); err != nil {
return 0, err
return resp, err
}
i, err := strconv.ParseInt(resp, 10, 64)
if err != nil {
return 0, err
}
return util.Fixed8(i), nil
return resp, nil
}
// GetValidators returns the current NEO consensus nodes information and voting status.