Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func AddressStoreKey(addr sdk.AccAddress) []byte
- func InitGenesis(ctx sdk.Context, keeper FeeKeeper, ak AccountKeeper, data GenesisState)
- func NewAnteHandler(am AccountKeeper, fck FeeKeeper) sdk.AnteHandler
- func NewFeePreprocessHandler(fk FeeKeeper) types.FeePreprocessHandler
- func NewFeeRefundHandler(am AccountKeeper, fk FeeKeeper) types.FeeRefundHandler
- func ParamTypeTable() params.TypeTable
- func RegisterBaseAccount(cdc *codec.Codec)
- func RegisterCodec(cdc *codec.Codec)
- func TotalSupplyStoreKey(denom string) []byte
- func ValidateFee(collectedFee sdk.Coins) error
- func ValidateGenesis(data GenesisState) error
- func WithSigners(ctx types.Context, accounts []Account) types.Context
- type Account
- type AccountDecoder
- type AccountKeeper
- func (am AccountKeeper) DecreaseTotalLoosenToken(ctx sdk.Context, coins sdk.Coins)
- func (am AccountKeeper) DecreaseTotalSupply(ctx sdk.Context, coin sdk.Coin) sdk.Error
- func (am AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) Account
- func (am AccountKeeper) GetAllAccounts(ctx sdk.Context) []Account
- func (am AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64
- func (am AccountKeeper) GetPubKey(ctx sdk.Context, addr sdk.AccAddress) (crypto.PubKey, sdk.Error)
- func (am AccountKeeper) GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, sdk.Error)
- func (am AccountKeeper) GetTotalLoosenToken(ctx sdk.Context) sdk.Coins
- func (am AccountKeeper) GetTotalSupplies(ctx sdk.Context) sdk.Iterator
- func (am AccountKeeper) GetTotalSupply(ctx sdk.Context, denom string) (coin sdk.Coin, found bool)
- func (am AccountKeeper) IncreaseTotalLoosenToken(ctx sdk.Context, coins sdk.Coins)
- func (am AccountKeeper) IncreaseTotalSupply(ctx sdk.Context, coin sdk.Coin) sdk.Error
- func (am AccountKeeper) InitTotalSupply(ctx sdk.Context)
- func (am AccountKeeper) IterateAccounts(ctx sdk.Context, process func(Account) (stop bool))
- func (am AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) Account
- func (am AccountKeeper) RemoveAccount(ctx sdk.Context, acc Account)
- func (am AccountKeeper) SetAccount(ctx sdk.Context, acc Account)
- func (am AccountKeeper) SetGenesisAccount(ctx sdk.Context, acc Account)
- func (am AccountKeeper) SetTotalSupply(ctx sdk.Context, totalSupply sdk.Coin)
- type BaseAccount
- func (acc *BaseAccount) GetAccountNumber() uint64
- func (acc BaseAccount) GetAddress() sdk.AccAddress
- func (acc *BaseAccount) GetCoins() sdk.Coins
- func (acc *BaseAccount) GetMemoRegexp() string
- func (acc BaseAccount) GetPubKey() crypto.PubKey
- func (acc *BaseAccount) GetSequence() uint64
- func (acc BaseAccount) HumanString(converter sdk.CoinsConverter) string
- func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error
- func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error
- func (acc *BaseAccount) SetCoins(coins sdk.Coins) error
- func (acc *BaseAccount) SetMemoRegexp(regexp string)
- func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error
- func (acc *BaseAccount) SetSequence(seq uint64) error
- func (acc BaseAccount) String() string
- type FeeAuth
- type FeeKeeper
- func (fk FeeKeeper) AddCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins
- func (fk FeeKeeper) ClearCollectedFees(ctx sdk.Context)
- func (fk FeeKeeper) GetCollectedFees(ctx sdk.Context) sdk.Coins
- func (fk FeeKeeper) GetFeeAuth(ctx sdk.Context) (feeAuth FeeAuth)
- func (fk FeeKeeper) GetParamSet(ctx sdk.Context) Params
- func (fk FeeKeeper) RefundCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins
- func (fk FeeKeeper) SetFeeAuth(ctx sdk.Context, feeAuth FeeAuth)
- func (fk FeeKeeper) SetParamSet(ctx sdk.Context, feeParams Params)
- type GenesisState
- type Params
- func (p *Params) GetParamSpace() string
- func (p *Params) KeyValuePairs() params.KeyValuePairs
- func (p *Params) ReadOnly() bool
- func (p Params) String() string
- func (p *Params) StringFromBytes(cdc *codec.Codec, key string, bytes []byte) (string, error)
- func (p *Params) Validate(key string, value string) (interface{}, sdk.Error)
- type StdFee
- type StdSignature
- type StdTx
Constants ¶
const (
DefaultParamSpace = "auth"
)
Variables ¶
var ( TotalLoosenTokenKey = []byte("totalLoosenToken") //system default special address BurnedCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("burnedCoins"))) GovDepositCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("govDepositedCoins"))) CommunityTaxCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("communityTaxCoins"))) ServiceDepositCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("serviceDepositedCoins"))) ServiceRequestCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("serviceRequestCoins"))) ServiceTaxCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("serviceTaxCoins"))) HTLCLockedCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("HTLCLockedCoins"))) // HTLCLockedCoinsAccAddr store All HTLC locked coins )
var ( MinimumGasPrice = sdk.ZeroInt() MaximumGasPrice = sdk.NewIntWithDecimal(1, 18) //1iris, 10^18iris-atto MinimumTxSizeLimit = uint64(500) MaximumTxSizeLimit = uint64(1500) )
var ( StdSignBytes = auth.StdSignBytes DefaultTxDecoder = auth.DefaultTxDecoder NewStdFee = auth.NewStdFee NewStdTx = auth.NewStdTx )
var (
TxSizeLimitKey = []byte("txSizeLimit")
)
Parameter store key
Functions ¶
func AddressStoreKey ¶
func AddressStoreKey(addr sdk.AccAddress) []byte
Turn an address to key used to get it from the account store
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper FeeKeeper, ak AccountKeeper, data GenesisState)
Init store state from genesis data
func NewAnteHandler ¶
func NewAnteHandler(am AccountKeeper, fck FeeKeeper) sdk.AnteHandler
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.
func NewFeePreprocessHandler ¶
func NewFeePreprocessHandler(fk FeeKeeper) types.FeePreprocessHandler
NewFeePreprocessHandler creates a fee token preprocesser
func NewFeeRefundHandler ¶
func NewFeeRefundHandler(am AccountKeeper, fk FeeKeeper) types.FeeRefundHandler
NewFeePreprocessHandler creates a fee token refund handler
func RegisterBaseAccount ¶
Most users shouldn't use this, but this comes in handy for tests.
func RegisterCodec ¶
Register concrete types on codec codec for default AppAccount
func TotalSupplyStoreKey ¶
Turn a token id to key used to get it from the account store
func ValidateFee ¶
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
Types ¶
type Account ¶
type Account interface { GetAddress() sdk.AccAddress SetAddress(sdk.AccAddress) error // errors if already set. GetPubKey() crypto.PubKey // can return nil. SetPubKey(crypto.PubKey) error GetAccountNumber() uint64 SetAccountNumber(uint64) error GetSequence() uint64 SetSequence(uint64) error GetCoins() sdk.Coins SetCoins(sdk.Coins) error GetMemoRegexp() string SetMemoRegexp(string) }
Account is an interface used to store coins at a given address within state. It presumes a notion of sequence numbers for replay protection, a notion of account numbers for replay protection for previously pruned accounts, and a pubkey for authentication purposes.
Many complex conditions can be used in the concrete struct which implements Account.
type AccountDecoder ¶
AccountDecoder unmarshals account bytes
type AccountKeeper ¶
type AccountKeeper struct {
// contains filtered or unexported fields
}
This AccountKeeper encodes/decodes accounts using the go-amino (binary) encoding/decoding library.
func NewAccountKeeper ¶
NewAccountKeeper returns a new sdk.AccountKeeper that uses go-amino to (binary) encode and decode concrete sdk.Accounts. nolint
func (AccountKeeper) DecreaseTotalLoosenToken ¶
func (am AccountKeeper) DecreaseTotalLoosenToken(ctx sdk.Context, coins sdk.Coins)
func (AccountKeeper) DecreaseTotalSupply ¶
func (AccountKeeper) GetAccount ¶
func (am AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) Account
Implements sdk.AccountKeeper.
func (AccountKeeper) GetAllAccounts ¶
func (am AccountKeeper) GetAllAccounts(ctx sdk.Context) []Account
func (AccountKeeper) GetNextAccountNumber ¶
func (am AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64
Returns and increments the global account number counter
func (AccountKeeper) GetPubKey ¶
func (am AccountKeeper) GetPubKey(ctx sdk.Context, addr sdk.AccAddress) (crypto.PubKey, sdk.Error)
Returns the PubKey of the account at address
func (AccountKeeper) GetSequence ¶
func (am AccountKeeper) GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, sdk.Error)
Returns the Sequence of the account at address
func (AccountKeeper) GetTotalLoosenToken ¶
func (am AccountKeeper) GetTotalLoosenToken(ctx sdk.Context) sdk.Coins
func (AccountKeeper) GetTotalSupplies ¶
func (am AccountKeeper) GetTotalSupplies(ctx sdk.Context) sdk.Iterator
func (AccountKeeper) GetTotalSupply ¶
func (AccountKeeper) IncreaseTotalLoosenToken ¶
func (am AccountKeeper) IncreaseTotalLoosenToken(ctx sdk.Context, coins sdk.Coins)
func (AccountKeeper) IncreaseTotalSupply ¶
func (AccountKeeper) InitTotalSupply ¶
func (am AccountKeeper) InitTotalSupply(ctx sdk.Context)
func (AccountKeeper) IterateAccounts ¶
func (am AccountKeeper) IterateAccounts(ctx sdk.Context, process func(Account) (stop bool))
Implements sdk.AccountKeeper.
func (AccountKeeper) NewAccountWithAddress ¶
func (am AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) Account
Implaements sdk.AccountKeeper.
func (AccountKeeper) RemoveAccount ¶
func (am AccountKeeper) RemoveAccount(ctx sdk.Context, acc Account)
RemoveAccount removes an account for the account mapper store.
func (AccountKeeper) SetAccount ¶
func (am AccountKeeper) SetAccount(ctx sdk.Context, acc Account)
Implements sdk.AccountKeeper.
func (AccountKeeper) SetGenesisAccount ¶
func (am AccountKeeper) SetGenesisAccount(ctx sdk.Context, acc Account)
Implements sdk.AccountKeeper.
func (AccountKeeper) SetTotalSupply ¶
func (am AccountKeeper) SetTotalSupply(ctx sdk.Context, totalSupply sdk.Coin)
type BaseAccount ¶
type BaseAccount struct { Address sdk.AccAddress `json:"address"` Coins sdk.Coins `json:"coins"` PubKey crypto.PubKey `json:"public_key"` AccountNumber uint64 `json:"account_number"` Sequence uint64 `json:"sequence"` MemoRegexp string `json:"memo_regexp"` }
BaseAccount - a base account structure. This can be extended by embedding within in your AppAccount. There are examples of this in: examples/basecoin/types/account.go. However one doesn't have to use BaseAccount as long as your struct implements Account.
func NewBaseAccountWithAddress ¶
func NewBaseAccountWithAddress(addr sdk.AccAddress) BaseAccount
func (*BaseAccount) GetAccountNumber ¶
func (acc *BaseAccount) GetAccountNumber() uint64
Implements Account
func (BaseAccount) GetAddress ¶
func (acc BaseAccount) GetAddress() sdk.AccAddress
Implements sdk.Account.
func (*BaseAccount) GetMemoRegexp ¶
func (acc *BaseAccount) GetMemoRegexp() string
Implements sdk.Account.
func (BaseAccount) GetPubKey ¶
func (acc BaseAccount) GetPubKey() crypto.PubKey
Implements sdk.Account.
func (*BaseAccount) GetSequence ¶
func (acc *BaseAccount) GetSequence() uint64
Implements sdk.Account.
func (BaseAccount) HumanString ¶
func (acc BaseAccount) HumanString(converter sdk.CoinsConverter) string
String implements human.Stringer
func (*BaseAccount) SetAccountNumber ¶
func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error
Implements Account
func (*BaseAccount) SetAddress ¶
func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error
Implements sdk.Account.
func (*BaseAccount) SetCoins ¶
func (acc *BaseAccount) SetCoins(coins sdk.Coins) error
Implements sdk.Account.
func (*BaseAccount) SetMemoRegexp ¶
func (acc *BaseAccount) SetMemoRegexp(regexp string)
Implements sdk.Account.
func (*BaseAccount) SetPubKey ¶
func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error
Implements sdk.Account.
func (*BaseAccount) SetSequence ¶
func (acc *BaseAccount) SetSequence(seq uint64) error
Implements sdk.Account.
type FeeAuth ¶
type FeeAuth struct {
NativeFeeDenom string `json:"native_fee_denom"`
}
func InitialFeeAuth ¶
func InitialFeeAuth() FeeAuth
func NewFeeAuth ¶
type FeeKeeper ¶
type FeeKeeper struct {
// contains filtered or unexported fields
}
This FeeKeeper handles collection of fees in the anteHandler and setting of MinFees for different fee tokens
func NewFeeKeeper ¶
func (FeeKeeper) AddCollectedFees ¶
add to the fee pool
func (FeeKeeper) ClearCollectedFees ¶
func (FeeKeeper) GetCollectedFees ¶
retrieves the collected fee pool
func (FeeKeeper) RefundCollectedFees ¶
RefundCollectedFees deducts fees from fee collector
type GenesisState ¶
type GenesisState struct { CollectedFees sdk.Coins `json:"collected_fee"` FeeAuth FeeAuth `json:"data"` Params Params `json:"params"` }
GenesisState - all auth state that must be provided at genesis
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper FeeKeeper, ak AccountKeeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
func NewGenesisState ¶
func NewGenesisState(collectedFees sdk.Coins, feeAuth FeeAuth, params Params) GenesisState
Create a new genesis state
type Params ¶
type Params struct { GasPriceThreshold sdk.Int `json:"gas_price_threshold"` // gas price threshold TxSizeLimit uint64 `json:"tx_size"` // tx size limit }
auth parameters
func (*Params) GetParamSpace ¶
Implements params.ParamStruct
func (*Params) KeyValuePairs ¶
func (p *Params) KeyValuePairs() params.KeyValuePairs
func (*Params) StringFromBytes ¶
type StdSignature ¶
type StdSignature = auth.StdSignature