mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-02 19:45:50 +00:00
1fd5e5928c
pkg/rpc/neoScanBalanceGetter.go:54:56: method parameter assetIdUint should be assetIDUint pkg/rpc/neoScanBalanceGetter.go:62:3: var assetId should be assetID pkg/rpc/server_test.go:27:5: var testRpcCases should be testRPCCases pkg/rpc/txTypes.go:19:3: struct field assetId should be assetID pkg/rpc/txTypes.go:39:35: interface method parameter assetId should be assetID pkg/rpc/types.go:115:2: struct field TxId should be TxID Refs. #213.
45 lines
1.5 KiB
Go
45 lines
1.5 KiB
Go
package wrappers
|
|
|
|
import (
|
|
"github.com/CityOfZion/neo-go/pkg/core"
|
|
"github.com/CityOfZion/neo-go/pkg/core/transaction"
|
|
"github.com/CityOfZion/neo-go/pkg/crypto"
|
|
"github.com/CityOfZion/neo-go/pkg/util"
|
|
)
|
|
|
|
// AssetState wrapper used for the representation of
|
|
// core.AssetState on the RPC Server.
|
|
type AssetState struct {
|
|
ID util.Uint256 `json:"assetID"`
|
|
AssetType transaction.AssetType `json:"assetType"`
|
|
Name string `json:"name"`
|
|
Amount util.Fixed8 `json:"amount"`
|
|
Available util.Fixed8 `json:"available"`
|
|
Precision uint8 `json:"precision"`
|
|
FeeMode uint8 `json:"fee"`
|
|
FeeAddress util.Uint160 `json:"address"`
|
|
Owner string `json:"owner"`
|
|
Admin string `json:"admin"`
|
|
Issuer string `json:"issuer"`
|
|
Expiration uint32 `json:"expiration"`
|
|
IsFrozen bool `json:"is_frozen"`
|
|
}
|
|
|
|
// NewAssetState creates a new AssetState wrapper.
|
|
func NewAssetState(a *core.AssetState) AssetState {
|
|
return AssetState{
|
|
ID: a.ID,
|
|
AssetType: a.AssetType,
|
|
Name: a.GetName(),
|
|
Amount: a.Amount,
|
|
Available: a.Available,
|
|
Precision: a.Precision,
|
|
FeeMode: a.FeeMode,
|
|
FeeAddress: a.FeeAddress,
|
|
Owner: a.Owner.String(),
|
|
Admin: crypto.AddressFromUint160(a.Admin),
|
|
Issuer: crypto.AddressFromUint160(a.Issuer),
|
|
Expiration: a.Expiration,
|
|
IsFrozen: a.IsFrozen,
|
|
}
|
|
}
|