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:
Anna Shaleva 2020-03-23 17:39:43 +03:00
parent 2001a40312
commit 2187346158

View file

@ -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),