mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 13:38:35 +00:00
rpc: fix json marshalling of result.AssetState
Modified result.AssetState: - removed `FeeMode` and `FeeAddress` fields - fixed json name of `ID` and `AssetType` fields to be consistent with C# RPC server
This commit is contained in:
parent
2001a40312
commit
2187346158
1 changed files with 2 additions and 6 deletions
|
@ -10,14 +10,12 @@ import (
|
||||||
// AssetState wrapper used for the representation of
|
// AssetState wrapper used for the representation of
|
||||||
// state.Asset on the RPC Server.
|
// state.Asset on the RPC Server.
|
||||||
type AssetState struct {
|
type AssetState struct {
|
||||||
ID util.Uint256 `json:"assetID"`
|
ID util.Uint256 `json:"id"`
|
||||||
AssetType transaction.AssetType `json:"assetType"`
|
AssetType transaction.AssetType `json:"type"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Amount util.Fixed8 `json:"amount"`
|
Amount util.Fixed8 `json:"amount"`
|
||||||
Available util.Fixed8 `json:"available"`
|
Available util.Fixed8 `json:"available"`
|
||||||
Precision uint8 `json:"precision"`
|
Precision uint8 `json:"precision"`
|
||||||
FeeMode uint8 `json:"fee"`
|
|
||||||
FeeAddress util.Uint160 `json:"address"`
|
|
||||||
Owner string `json:"owner"`
|
Owner string `json:"owner"`
|
||||||
Admin string `json:"admin"`
|
Admin string `json:"admin"`
|
||||||
Issuer string `json:"issuer"`
|
Issuer string `json:"issuer"`
|
||||||
|
@ -34,8 +32,6 @@ func NewAssetState(a *state.Asset) AssetState {
|
||||||
Amount: a.Amount,
|
Amount: a.Amount,
|
||||||
Available: a.Available,
|
Available: a.Available,
|
||||||
Precision: a.Precision,
|
Precision: a.Precision,
|
||||||
FeeMode: a.FeeMode,
|
|
||||||
FeeAddress: a.FeeAddress,
|
|
||||||
Owner: a.Owner.String(),
|
Owner: a.Owner.String(),
|
||||||
Admin: address.Uint160ToString(a.Admin),
|
Admin: address.Uint160ToString(a.Admin),
|
||||||
Issuer: address.Uint160ToString(a.Issuer),
|
Issuer: address.Uint160ToString(a.Issuer),
|
||||||
|
|
Loading…
Reference in a new issue