Documentation ¶
Index ¶
- func GenerateCoinKey() (addr types.Address, secret string, err error)
- func InitBaseCoinGenStateJSON(cdc *amino.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
- func InitBaseCoinGenTx(cdc *amino.Codec, pk crypto.PubKey, genTxConfig config.GenTx) (appGenTx, cliPrint json.RawMessage, validator tmtypes.GenesisValidator, ...)
- func InitBaseCoinInit() server.AppInit
- func NewAppAccount() account.Account
- type AppAccount
- type BaseCoinGenTx
- type Coin
- func (coin *Coin) GetAmount() types.BigInt
- func (coin *Coin) GetName() string
- func (coin Coin) IsEqual(other Coin) bool
- func (coin Coin) IsGTE(other Coin) bool
- func (coin Coin) IsLT(other Coin) bool
- func (coin Coin) IsNotNegative() bool
- func (coin Coin) IsPositive() bool
- func (coin Coin) IsZero() bool
- func (coin Coin) Minus(coinB Coin) Coin
- func (coin Coin) Plus(coinB Coin) Coin
- func (coin Coin) SameNameAs(other Coin) bool
- func (coin *Coin) SetAmount(amount types.BigInt)
- func (coin Coin) String() string
- type Coins
- func (coins Coins) AmountOf(denom string) types.BigInt
- func (coins Coins) IsEqual(coinsB Coins) bool
- func (coins Coins) IsGTE(coinsB Coins) bool
- func (coins Coins) IsLT(coinsB Coins) bool
- func (coins Coins) IsNotNegative() bool
- func (coins Coins) IsPositive() bool
- func (coins Coins) IsValid() bool
- func (coins Coins) IsZero() bool
- func (coins Coins) Minus(coinsB Coins) Coins
- func (coins Coins) MinusSingle(coin Coin) Coins
- func (coins Coins) Negative() Coins
- func (coins Coins) Plus(coinsB Coins) Coins
- func (coins Coins) PlusSingle(coin Coin) Coins
- func (coins Coins) String() string
- type GenesisAccount
- type GenesisState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBaseCoinGenStateJSON ¶
func InitBaseCoinGenStateJSON(cdc *amino.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
func InitBaseCoinGenTx ¶
func InitBaseCoinGenTx(cdc *amino.Codec, pk crypto.PubKey, genTxConfig config.GenTx) ( appGenTx, cliPrint json.RawMessage, validator tmtypes.GenesisValidator, err error)
Generate a genesis transaction
func InitBaseCoinInit ¶
func NewAppAccount ¶
Types ¶
type AppAccount ¶
type AppAccount struct { account.BaseAccount `json:"base_account"` Coins Coins `json:"coins"` }
func (*AppAccount) GetCoins ¶
func (acc *AppAccount) GetCoins() Coins
func (*AppAccount) SetCoins ¶
func (acc *AppAccount) SetCoins(coins Coins) error
type BaseCoinGenTx ¶
type Coin ¶
func (Coin) IsGTE ¶
IsGTE returns true if they are the same type and the receiver is an equal or greater value
func (Coin) IsNotNegative ¶
IsNotNegative returns true if coin amount is not negative
func (Coin) IsPositive ¶
IsPositive returns true if coin amount is positive
func (Coin) SameNameAs ¶
SameDenomAs returns true if the two coins are the same denom
type Coins ¶
type Coins []Coin
Coins is a set of Coin, one per currency
func (Coins) IsGTE ¶
IsGTE returns True iff coins is NonNegative(), and for every currency in coinsB, the currency is present at an equal or greater amount in coinsB
func (Coins) IsLT ¶
IsLT returns True iff every currency in coins, the currency is present at a smaller amount in coins
func (Coins) IsNotNegative ¶
IsNotNegative returns true if there is no currency with a negative value (even no coins is true here)
func (Coins) IsPositive ¶
IsPositive returns true if there is at least one coin, and all currencies have a positive value
func (Coins) MinusSingle ¶
func (Coins) Plus ¶
Plus combines two sets of coins CONTRACT: Plus will never return Coins where one Coin has a 0 amount.
func (Coins) PlusSingle ¶
type GenesisAccount ¶
初始账户
func NewGenesisAccount ¶
func NewGenesisAccount(aa *AppAccount) *GenesisAccount
给定 AppAccpunt 创建 GenesisAccount
func (*GenesisAccount) ToAppAccount ¶
func (ga *GenesisAccount) ToAppAccount() (acc *AppAccount, err error)
给定 GenesisAccount 创建 AppAccpunt
type GenesisState ¶
type GenesisState struct { CAPubKey crypto.PubKey `json:"ca_pub_key"` Accounts []*GenesisAccount `json:"accounts"` }
QOS初始状态