rpc: adjust getnep5transfers RPC-call JSON fields names

Part of #1130
This commit is contained in:
Anna Shaleva 2020-07-09 15:42:23 +03:00
parent dc273736be
commit 15f7b78a8c
2 changed files with 5 additions and 5 deletions

View file

@ -400,7 +400,7 @@ var rpcClientTestCases = map[string][]rpcClientTestCase{
invoke: func(c *Client) (interface{}, error) { invoke: func(c *Client) (interface{}, error) {
return c.GetNEP5Transfers("AbHgdBaWEnHkCiLtDZXjhvhaAK2cwFh5pF") return c.GetNEP5Transfers("AbHgdBaWEnHkCiLtDZXjhvhaAK2cwFh5pF")
}, },
serverResponse: `{"jsonrpc":"2.0","id":1,"result":{"sent":[],"received":[{"timestamp":1555651816,"assethash":"600c4f5200db36177e3e8a09e9f18e2fc7d12a0f","transfer_address":"AYwgBNMepiv5ocGcyNT4mA8zPLTQ8pDBis","amount":"1000000","block_index":436036,"transfer_notify_index":0,"tx_hash":"df7683ece554ecfb85cf41492c5f143215dd43ef9ec61181a28f922da06aba58"}],"address":"AbHgdBaWEnHkCiLtDZXjhvhaAK2cwFh5pF"}}`, serverResponse: `{"jsonrpc":"2.0","id":1,"result":{"sent":[],"received":[{"timestamp":1555651816,"assethash":"600c4f5200db36177e3e8a09e9f18e2fc7d12a0f","transferaddress":"AYwgBNMepiv5ocGcyNT4mA8zPLTQ8pDBis","amount":"1000000","blockindex":436036,"transfernotifyindex":0,"txhash":"df7683ece554ecfb85cf41492c5f143215dd43ef9ec61181a28f922da06aba58"}],"address":"AbHgdBaWEnHkCiLtDZXjhvhaAK2cwFh5pF"}}`,
result: func(c *Client) interface{} { result: func(c *Client) interface{} {
assetHash, err := util.Uint160DecodeStringLE("600c4f5200db36177e3e8a09e9f18e2fc7d12a0f") assetHash, err := util.Uint160DecodeStringLE("600c4f5200db36177e3e8a09e9f18e2fc7d12a0f")
if err != nil { if err != nil {

View file

@ -37,11 +37,11 @@ type NEP5Transfers struct {
type NEP5Transfer struct { type NEP5Transfer struct {
Timestamp uint64 `json:"timestamp"` Timestamp uint64 `json:"timestamp"`
Asset util.Uint160 `json:"assethash"` Asset util.Uint160 `json:"assethash"`
Address string `json:"transfer_address,omitempty"` Address string `json:"transferaddress,omitempty"`
Amount string `json:"amount"` Amount string `json:"amount"`
Index uint32 `json:"block_index"` Index uint32 `json:"blockindex"`
NotifyIndex uint32 `json:"transfer_notify_index"` NotifyIndex uint32 `json:"transfernotifyindex"`
TxHash util.Uint256 `json:"tx_hash"` TxHash util.Uint256 `json:"txhash"`
} }
// MarshalJSON implements json.Marshaler interface. // MarshalJSON implements json.Marshaler interface.