mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
rpc: wrap calculatenetworkfee result in a structure
C#: { "jsonrpc": "2.0", "id": 2, "result": { "networkfee": "1185120" } } Go: { "id": 2, "jsonrpc": "2.0", "result": 1185120 } Thanks @csmuller for finding it.
This commit is contained in:
parent
ed6652bf1f
commit
6a61e86d12
3 changed files with 10 additions and 4 deletions
|
@ -34,12 +34,12 @@ var errNetworkNotInitialized = errors.New("RPC client network is not initialized
|
|||
func (c *Client) CalculateNetworkFee(tx *transaction.Transaction) (int64, error) {
|
||||
var (
|
||||
params = request.NewRawParams(tx.Bytes())
|
||||
resp int64
|
||||
resp = new(result.NetworkFee)
|
||||
)
|
||||
if err := c.performRequest("calculatenetworkfee", params, &resp); err != nil {
|
||||
if err := c.performRequest("calculatenetworkfee", params, resp); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return resp, nil
|
||||
return resp.Value, nil
|
||||
}
|
||||
|
||||
// GetApplicationLog returns the contract log based on the specified txid.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue