Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func AddressStoreKey(addr sdk.AccAddress) []byte
- func CalcFees(gaswanted uint64, gasprice uint64) sdk.Coins
- func DefaultTxDecoder(cdc *codec.Codec) sdk.TxDecoder
- func DefaultTxEncoder(cdc *codec.Codec) sdk.TxEncoder
- func EnsureSufficientMempoolFees(ctx sdk.Context, stdFee StdFee) sdk.Result
- func ExistsMsgSend(tx sdk.Tx) bool
- func GetSignBytes(chainID string, stdTx StdTx, acc Account, genesis bool) []byte
- func InitGenesis(ctx sdk.Context, ak AccountKeeper, fck FeeCollectionKeeper, data GenesisState)
- func NewAnteHandler(ak AccountKeeper, fck FeeCollectionKeeper) sdk.AnteHandler
- func NewFeePreprocessHandler(fk FeeCollectionKeeper) types.FeePreprocessHandler
- func NewFeeRefundHandler(am AccountKeeper, fk FeeCollectionKeeper) types.FeeRefundHandler
- func NewQuerier(keeper AccountKeeper) sdk.Querier
- func ParamKeyTable() params.KeyTable
- func ProcessPubKey(acc Account, sig StdSignature, simulate bool) (crypto.PubKey, sdk.Result)
- func RegisterBaseAccount(cdc *codec.Codec)
- func RegisterCodec(cdc *codec.Codec)
- func SetGasMeter(simulate bool, ctx sdk.Context, gasLimit uint64) sdk.Context
- func StdSignBytes(chainID string, accnum uint64, sequence uint64, fee StdFee, msgs []sdk.Msg, ...) []byte
- func ValidateFee(auth FeeAuth, collectedFee sdk.Coins) error
- func ValidateGenesis(data GenesisState) error
- func ValidateMemo(stdTx StdTx, params Params) sdk.Result
- 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 (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) Account
- func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) []Account
- func (am AccountKeeper) GetBurnedToken(ctx sdk.Context) sdk.Coins
- func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64
- func (ak AccountKeeper) GetParams(ctx sdk.Context) (params Params)
- func (ak AccountKeeper) GetPubKey(ctx sdk.Context, addr sdk.AccAddress) (crypto.PubKey, sdk.Error)
- func (ak AccountKeeper) GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, sdk.Error)
- func (am AccountKeeper) GetTotalLoosenToken(ctx sdk.Context) sdk.Coins
- func (am AccountKeeper) IncreaseBurnedToken(ctx sdk.Context, coins sdk.Coins)
- func (am AccountKeeper) IncreaseTotalLoosenToken(ctx sdk.Context, coins sdk.Coins)
- func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, process func(Account) (stop bool))
- func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc Account) Account
- func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) Account
- func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc Account)
- func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc Account)
- func (ak AccountKeeper) SetGenesisAccount(ctx sdk.Context, acc Account)
- func (ak AccountKeeper) SetParams(ctx sdk.Context, params Params)
- type BaseAccount
- func (acc *BaseAccount) GetAccountNumber() uint64
- func (acc BaseAccount) GetAddress() sdk.AccAddress
- func (acc *BaseAccount) GetCoins() sdk.Coins
- func (acc BaseAccount) GetPubKey() crypto.PubKey
- func (acc *BaseAccount) GetSequence() uint64
- 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) SetPubKey(pubKey crypto.PubKey) error
- func (acc *BaseAccount) SetSequence(seq uint64) error
- func (acc *BaseAccount) SpendableCoins(_ time.Time) sdk.Coins
- func (acc BaseAccount) String() string
- type BaseVestingAccount
- type ContinuousVestingAccount
- func (cva *ContinuousVestingAccount) GetEndTime() int64
- func (cva *ContinuousVestingAccount) GetStartTime() int64
- func (cva ContinuousVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
- func (cva ContinuousVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
- func (cva ContinuousVestingAccount) SpendableCoins(blockTime time.Time) sdk.Coins
- func (cva ContinuousVestingAccount) String() string
- func (cva *ContinuousVestingAccount) TrackDelegation(blockTime time.Time, amount sdk.Coins)
- type DelayedVestingAccount
- func (dva *DelayedVestingAccount) GetEndTime() int64
- func (dva *DelayedVestingAccount) GetStartTime() int64
- func (dva DelayedVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
- func (dva DelayedVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
- func (dva DelayedVestingAccount) SpendableCoins(blockTime time.Time) sdk.Coins
- func (dva *DelayedVestingAccount) TrackDelegation(blockTime time.Time, amount sdk.Coins)
- type FeeAuth
- type FeeCollectionKeeper
- func (fck FeeCollectionKeeper) AddCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins
- func (fck FeeCollectionKeeper) ClearCollectedFees(ctx sdk.Context)
- func (fck FeeCollectionKeeper) GetCollectedFees(ctx sdk.Context) sdk.Coins
- func (fk FeeCollectionKeeper) GetFeeAuth(ctx sdk.Context) (feeAuth FeeAuth)
- func (fk FeeCollectionKeeper) RefundCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins
- type GenesisState
- type Params
- func (p Params) Equal(p2 Params) bool
- func (p *Params) GetParamSpace() string
- func (p *Params) ParamSetPairs() params.ParamSetPairs
- 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 QueryAccountParams
- type StdFee
- type StdSignDoc
- type StdSignature
- type StdTx
- type VestingAccount
Constants ¶
const ( // StoreKey is string representation of the store key for auth StoreKey = "acc" // FeeStoreKey is a string representation of the store key for fees FeeStoreKey = "fee" // QuerierRoute is the querier route for acc QuerierRoute = StoreKey )
const ( DefaultMaxMemoCharacters uint64 = 256 DefaultTxSigLimit uint64 = 7 //DefaultTxSizeLimit uint64 = 1000 DefaultTxSizeCostPerByte uint64 = 10 DefaultSigVerifyCostED25519 uint64 = 590 DefaultSigVerifyCostSecp256k1 uint64 = 4000 // modified by junying, 2019-09-04, 1000 to 4000 )
Default parameter values
const DefaultFeeCollection = "fee"
const DefaultParamspace = "auth"
DefaultParamspace defines the default auth module parameter subspace
const (
QueryAccount = "account"
)
query endpoints supported by the auth Querier
Variables ¶
var ( // AddressStoreKeyPrefix prefix for account-by-address store AddressStoreKeyPrefix = []byte{0x01} TotalLoosenTokenKey = []byte("totalLoosenToken") BurnedTokenKey = []byte("burnedToken") )
var ( MinimumGasPrice = sdk.ZeroInt() MaximumGasPrice = sdk.NewIntWithDecimal(1, 18) //1htdf, 10^18satoshi MinimumTxSizeLimit = uint64(500) MaximumTxSizeLimit = uint64(1500) )
var ( KeygasPriceThreshold = []byte("GasPriceThreshold") KeyMaxMemoCharacters = []byte("MaxMemoCharacters") KeyTxSigLimit = []byte("TxSigLimit") KeyTxSizeLimit = []byte("TxSizeLimit") KeyTxSizeCostPerByte = []byte("TxSizeCostPerByte") KeySigVerifyCostED25519 = []byte("SigVerifyCostED25519") KeySigVerifyCostSecp256k1 = []byte("SigVerifyCostSecp256k1") )
Parameter keys
Functions ¶
func AddressStoreKey ¶
func AddressStoreKey(addr sdk.AccAddress) []byte
AddressStoreKey turn an address to key used to get it from the account store
func DefaultTxDecoder ¶
DefaultTxDecoder logic for standard transaction decoding
func DefaultTxEncoder ¶
DefaultTxEncoder logic for standard transaction encoding
func EnsureSufficientMempoolFees ¶
EnsureSufficientMempoolFees verifies that the given transaction has supplied enough fees to cover a proposer's minimum fees. A result object is returned indicating success or failure.
Contract: This should only be called during CheckTx as it cannot be part of consensus.
func GetSignBytes ¶
GetSignBytes returns a slice of bytes to sign over for a given transaction and an account.
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, ak AccountKeeper, fck FeeCollectionKeeper, data GenesisState)
InitGenesis - Init store state from genesis data
func NewAnteHandler ¶
func NewAnteHandler(ak AccountKeeper, fck FeeCollectionKeeper) 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 FeeCollectionKeeper) types.FeePreprocessHandler
NewFeePreprocessHandler creates a fee token preprocesser
func NewFeeRefundHandler ¶
func NewFeeRefundHandler(am AccountKeeper, fk FeeCollectionKeeper) types.FeeRefundHandler
NewFeePreprocessHandler creates a fee token refund handler
func NewQuerier ¶
func NewQuerier(keeper AccountKeeper) sdk.Querier
creates a querier for auth REST endpoints
func ProcessPubKey ¶
ProcessPubKey verifies that the given account address matches that of the StdSignature. In addition, it will set the public key of the account if it has not been set.
func RegisterBaseAccount ¶
RegisterBaseAccount most users shouldn't use this, but this comes in handy for tests.
func RegisterCodec ¶
RegisterCodec registers concrete types on the codec
func SetGasMeter ¶
SetGasMeter returns a new context with a gas meter set from a given context.
func StdSignBytes ¶
func StdSignBytes(chainID string, accnum uint64, sequence uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte
StdSignBytes returns the bytes to sign for a transaction.
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of auth genesis data returning an error for any failed validation criteria.
func ValidateMemo ¶
ValidateMemo validates the memo size.
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 // Calculates the amount of coins that can be sent to other accounts given // the current time. SpendableCoins(blockTime time.Time) sdk.Coins // Ensure that account implements stringer String() 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.
func DeductFees ¶
DeductFees deducts fees from the given account.
NOTE: We could use the CoinKeeper (in addition to the AccountKeeper, because the CoinKeeper doesn't give us accounts), but it seems easier to do this.
func GetSignerAcc ¶
func GetSignerAcc(ctx sdk.Context, ak AccountKeeper, addr sdk.AccAddress) (Account, sdk.Result)
GetSignerAcc returns an account for a given address that is expected to sign a transaction.
func ProtoBaseAccount ¶
func ProtoBaseAccount() Account
ProtoBaseAccount - a prototype function for BaseAccount
type AccountDecoder ¶
AccountDecoder unmarshals account bytes TODO: Think about removing
type AccountKeeper ¶
type AccountKeeper struct {
// contains filtered or unexported fields
}
AccountKeeper encodes/decodes accounts using the go-amino (binary) encoding/decoding library.
func NewAccountKeeper ¶
func NewAccountKeeper( cdc *codec.Codec, key sdk.StoreKey, paramstore params.Subspace, proto func() Account, ) AccountKeeper
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) GetAccount ¶
func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) Account
GetAccount implements sdk.AccountKeeper.
func (AccountKeeper) GetAllAccounts ¶
func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) []Account
GetAllAccounts returns all accounts in the accountKeeper.
func (AccountKeeper) GetBurnedToken ¶
func (am AccountKeeper) GetBurnedToken(ctx sdk.Context) sdk.Coins
func (AccountKeeper) GetNextAccountNumber ¶
func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64
GetNextAccountNumber Returns and increments the global account number counter
func (AccountKeeper) GetParams ¶
func (ak AccountKeeper) GetParams(ctx sdk.Context) (params Params)
GetParams gets the auth module's parameters.
func (AccountKeeper) GetPubKey ¶
func (ak AccountKeeper) GetPubKey(ctx sdk.Context, addr sdk.AccAddress) (crypto.PubKey, sdk.Error)
GetPubKey Returns the PubKey of the account at address
func (AccountKeeper) GetSequence ¶
func (ak AccountKeeper) GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, sdk.Error)
GetSequence Returns the Sequence of the account at address
func (AccountKeeper) GetTotalLoosenToken ¶
func (am AccountKeeper) GetTotalLoosenToken(ctx sdk.Context) sdk.Coins
func (AccountKeeper) IncreaseBurnedToken ¶
func (am AccountKeeper) IncreaseBurnedToken(ctx sdk.Context, coins sdk.Coins)
func (AccountKeeper) IncreaseTotalLoosenToken ¶
func (am AccountKeeper) IncreaseTotalLoosenToken(ctx sdk.Context, coins sdk.Coins)
func (AccountKeeper) IterateAccounts ¶
func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, process func(Account) (stop bool))
IterateAccounts implements sdk.AccountKeeper.
func (AccountKeeper) NewAccount ¶
func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc Account) Account
NewAccount creates a new account
func (AccountKeeper) NewAccountWithAddress ¶
func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) Account
NewAccountWithAddress implements sdk.AccountKeeper.
func (AccountKeeper) RemoveAccount ¶
func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc Account)
RemoveAccount removes an account for the account mapper store. NOTE: this will cause supply invariant violation if called
func (AccountKeeper) SetAccount ¶
func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc Account)
SetAccount implements sdk.AccountKeeper.
func (AccountKeeper) SetGenesisAccount ¶
func (ak AccountKeeper) SetGenesisAccount(ctx sdk.Context, acc Account)
Implements sdk.AccountKeeper.
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"` }
BaseAccount - a base account structure. This can be extended by embedding within in your AppAccount. However one doesn't have to use BaseAccount as long as your struct implements Account.
func NewBaseAccountWithAddress ¶
func NewBaseAccountWithAddress(addr sdk.AccAddress) BaseAccount
NewBaseAccountWithAddress - returns a new base account with a given address
func (*BaseAccount) GetAccountNumber ¶
func (acc *BaseAccount) GetAccountNumber() uint64
GetAccountNumber - Implements Account
func (BaseAccount) GetAddress ¶
func (acc BaseAccount) GetAddress() sdk.AccAddress
GetAddress - Implements sdk.Account.
func (*BaseAccount) GetCoins ¶
func (acc *BaseAccount) GetCoins() sdk.Coins
GetCoins - Implements sdk.Account.
func (BaseAccount) GetPubKey ¶
func (acc BaseAccount) GetPubKey() crypto.PubKey
GetPubKey - Implements sdk.Account.
func (*BaseAccount) GetSequence ¶
func (acc *BaseAccount) GetSequence() uint64
GetSequence - Implements sdk.Account.
func (*BaseAccount) SetAccountNumber ¶
func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error
SetAccountNumber - Implements Account
func (*BaseAccount) SetAddress ¶
func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error
SetAddress - Implements sdk.Account.
func (*BaseAccount) SetCoins ¶
func (acc *BaseAccount) SetCoins(coins sdk.Coins) error
SetCoins - Implements sdk.Account.
func (*BaseAccount) SetPubKey ¶
func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error
SetPubKey - Implements sdk.Account.
func (*BaseAccount) SetSequence ¶
func (acc *BaseAccount) SetSequence(seq uint64) error
SetSequence - Implements sdk.Account.
func (*BaseAccount) SpendableCoins ¶
func (acc *BaseAccount) SpendableCoins(_ time.Time) sdk.Coins
SpendableCoins returns the total set of spendable coins. For a base account, this is simply the base coins.
type BaseVestingAccount ¶
type BaseVestingAccount struct { *BaseAccount OriginalVesting sdk.Coins `json:"original_vesting"` // coins in account upon initialization DelegatedFree sdk.Coins `json:"delegated_free"` // coins that are vested and delegated DelegatedVesting sdk.Coins `json:"delegated_vesting"` // coins that vesting and delegated EndTime int64 `json:"end_time"` // when the coins become unlocked }
BaseVestingAccount implements the VestingAccount interface. It contains all the necessary fields needed for any vesting account implementation.
func (BaseVestingAccount) GetDelegatedFree ¶
func (bva BaseVestingAccount) GetDelegatedFree() sdk.Coins
GetDelegatedFree returns a vesting account's delegation amount that is not vesting.
func (BaseVestingAccount) GetDelegatedVesting ¶
func (bva BaseVestingAccount) GetDelegatedVesting() sdk.Coins
GetDelegatedVesting returns a vesting account's delegation amount that is still vesting.
func (BaseVestingAccount) GetOriginalVesting ¶
func (bva BaseVestingAccount) GetOriginalVesting() sdk.Coins
GetOriginalVesting returns a vesting account's original vesting amount
func (BaseVestingAccount) String ¶
func (bva BaseVestingAccount) String() string
String implements fmt.Stringer
func (*BaseVestingAccount) TrackUndelegation ¶
func (bva *BaseVestingAccount) TrackUndelegation(amount sdk.Coins)
TrackUndelegation tracks an undelegation amount by setting the necessary values by which delegated vesting and delegated vesting need to decrease and by which amount the base coins need to increase. The resulting base coins are returned.
NOTE: The undelegation (bond refund) amount may exceed the delegated vesting (bond) amount due to the way undelegation truncates the bond refund, which can increase the validator's exchange rate (tokens/shares) slightly if the undelegated tokens are non-integral.
CONTRACT: The account's coins and undelegation coins must be sorted.
type ContinuousVestingAccount ¶
type ContinuousVestingAccount struct { *BaseVestingAccount StartTime int64 `json:"start_time"` // when the coins start to vest }
ContinuousVestingAccount implements the VestingAccount interface. It continuously vests by unlocking coins linearly with respect to time.
func NewContinuousVestingAccount ¶
func NewContinuousVestingAccount( baseAcc *BaseAccount, StartTime, EndTime int64, ) *ContinuousVestingAccount
NewContinuousVestingAccount returns a new ContinuousVestingAccount
func (*ContinuousVestingAccount) GetEndTime ¶
func (cva *ContinuousVestingAccount) GetEndTime() int64
GetEndTime returns the time when vesting ends for a continuous vesting account.
func (*ContinuousVestingAccount) GetStartTime ¶
func (cva *ContinuousVestingAccount) GetStartTime() int64
GetStartTime returns the time when vesting starts for a continuous vesting account.
func (ContinuousVestingAccount) GetVestedCoins ¶
func (cva ContinuousVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
GetVestedCoins returns the total number of vested coins. If no coins are vested, nil is returned.
func (ContinuousVestingAccount) GetVestingCoins ¶
func (cva ContinuousVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
GetVestingCoins returns the total number of vesting coins. If no coins are vesting, nil is returned.
func (ContinuousVestingAccount) SpendableCoins ¶
func (cva ContinuousVestingAccount) SpendableCoins(blockTime time.Time) sdk.Coins
SpendableCoins returns the total number of spendable coins per denom for a continuous vesting account.
func (ContinuousVestingAccount) String ¶
func (cva ContinuousVestingAccount) String() string
func (*ContinuousVestingAccount) TrackDelegation ¶
func (cva *ContinuousVestingAccount) TrackDelegation(blockTime time.Time, amount sdk.Coins)
TrackDelegation tracks a desired delegation amount by setting the appropriate values for the amount of delegated vesting, delegated free, and reducing the overall amount of base coins.
type DelayedVestingAccount ¶
type DelayedVestingAccount struct {
*BaseVestingAccount
}
DelayedVestingAccount implements the VestingAccount interface. It vests all coins after a specific time, but non prior. In other words, it keeps them locked until a specified time.
func NewDelayedVestingAccount ¶
func NewDelayedVestingAccount(baseAcc *BaseAccount, EndTime int64) *DelayedVestingAccount
NewDelayedVestingAccount returns a DelayedVestingAccount
func (*DelayedVestingAccount) GetEndTime ¶
func (dva *DelayedVestingAccount) GetEndTime() int64
GetEndTime returns the time when vesting ends for a delayed vesting account.
func (*DelayedVestingAccount) GetStartTime ¶
func (dva *DelayedVestingAccount) GetStartTime() int64
GetStartTime returns zero since a delayed vesting account has no start time.
func (DelayedVestingAccount) GetVestedCoins ¶
func (dva DelayedVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
GetVestedCoins returns the total amount of vested coins for a delayed vesting account. All coins are only vested once the schedule has elapsed.
func (DelayedVestingAccount) GetVestingCoins ¶
func (dva DelayedVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
GetVestingCoins returns the total number of vesting coins for a delayed vesting account.
func (DelayedVestingAccount) SpendableCoins ¶
func (dva DelayedVestingAccount) SpendableCoins(blockTime time.Time) sdk.Coins
SpendableCoins returns the total number of spendable coins for a delayed vesting account.
func (*DelayedVestingAccount) TrackDelegation ¶
func (dva *DelayedVestingAccount) TrackDelegation(blockTime time.Time, amount sdk.Coins)
TrackDelegation tracks a desired delegation amount by setting the appropriate values for the amount of delegated vesting, delegated free, and reducing the overall amount of base coins.
type FeeAuth ¶
type FeeAuth struct {
NativeFeeDenom string `json:"native_fee_denom"`
}
func InitialFeeAuth ¶
func InitialFeeAuth() FeeAuth
func NewFeeAuth ¶
type FeeCollectionKeeper ¶
type FeeCollectionKeeper struct {
// contains filtered or unexported fields
}
FeeCollectionKeeper handles collection of fees in the anteHandler and setting of MinFees for different fee tokens
func NewFeeCollectionKeeper ¶
func NewFeeCollectionKeeper(cdc *codec.Codec, key sdk.StoreKey) FeeCollectionKeeper
NewFeeCollectionKeeper returns a new FeeCollectionKeeper
func (FeeCollectionKeeper) AddCollectedFees ¶
AddCollectedFees - add to the fee pool
func (FeeCollectionKeeper) ClearCollectedFees ¶
func (fck FeeCollectionKeeper) ClearCollectedFees(ctx sdk.Context)
ClearCollectedFees - clear the fee pool
func (FeeCollectionKeeper) GetCollectedFees ¶
func (fck FeeCollectionKeeper) GetCollectedFees(ctx sdk.Context) sdk.Coins
GetCollectedFees - retrieves the collected fee pool
func (FeeCollectionKeeper) GetFeeAuth ¶
func (fk FeeCollectionKeeper) GetFeeAuth(ctx sdk.Context) (feeAuth FeeAuth)
func (FeeCollectionKeeper) RefundCollectedFees ¶
RefundCollectedFees deducts fees from fee collector
type GenesisState ¶
type GenesisState struct { CollectedFees sdk.Coins `json:"collected_fees"` Params Params `json:"params"` }
GenesisState - all auth state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - Return a default genesis state
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, ak AccountKeeper, fck FeeCollectionKeeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
func NewGenesisState ¶
func NewGenesisState(collectedFees sdk.Coins, params Params) GenesisState
NewGenesisState - Create a new genesis state
type Params ¶
type Params struct { GasPriceThreshold sdk.Int `json:"gas_price_threshold"` MaxMemoCharacters uint64 `json:"max_memo_characters"` TxSigLimit uint64 `json:"tx_sig_limit"` //TxSizeLimit uint64 `json:"tx_size"` // tx size limit TxSizeCostPerByte uint64 `json:"tx_size_cost_per_byte"` SigVerifyCostED25519 uint64 `json:"sig_verify_cost_ed25519"` SigVerifyCostSecp256k1 uint64 `json:"sig_verify_cost_secp256k1"` }
Params defines the parameters for the auth module.
func (*Params) GetParamSpace ¶
Implements params.ParamStruct
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint
func (*Params) StringFromBytes ¶
type QueryAccountParams ¶
type QueryAccountParams struct {
Address sdk.AccAddress
}
defines the params for query: "custom/acc/account"
func NewQueryAccountParams ¶
func NewQueryAccountParams(addr sdk.AccAddress) QueryAccountParams
type StdFee ¶
StdFee includes the amount of coins paid in fees and the maximum gas to be used by the transaction. The ratio yields an effective "gasprice", which must be above some miminum to be accepted into the mempool.
func EstimateFee ¶
Estimate RealFee by calculating real gas consumption
func (StdFee) GasPriceCoin ¶
GasPrices returns the gas prices for a StdFee.
NOTE: The gas prices returned are not the true gas prices that were originally part of the submitted transaction because the fee is computed as fee = ceil(gasWanted * gasPrices).
type StdSignDoc ¶
type StdSignDoc struct { AccountNumber uint64 `json:"account_number"` ChainID string `json:"chain_id"` Fee json.RawMessage `json:"fee"` Memo string `json:"memo"` Msgs []json.RawMessage `json:"msgs"` Sequence uint64 `json:"sequence"` }
StdSignDoc is replay-prevention structure. It includes the result of msg.GetSignBytes(), as well as the ChainID (prevent cross chain replay) and the Sequence numbers for each signature (prevent inchain replay and enforce tx ordering per account).
type StdSignature ¶
type StdSignature struct { crypto.PubKey `json:"pub_key"` // optional Signature []byte `json:"signature"` }
StdSignature represents a sig
type StdTx ¶
type StdTx struct { Msgs []sdk.Msg `json:"msg"` Fee StdFee `json:"fee"` Signatures []StdSignature `json:"signatures"` Memo string `json:"memo"` }
StdTx is a standard way to wrap a Msg with Fee and Signatures. NOTE: the first signature is the fee payer (Signatures must not be nil).
func (StdTx) GetSignatures ¶
func (tx StdTx) GetSignatures() []StdSignature
GetSignatures returns the signature of signers who signed the Msg. CONTRACT: Length returned is same as length of pubkeys returned from MsgKeySigners, and the order matches. CONTRACT: If the signature is missing (ie the Msg is invalid), then the corresponding signature is .Empty().
func (StdTx) GetSigners ¶
func (tx StdTx) GetSigners() []sdk.AccAddress
GetSigners returns the addresses that must sign the transaction. Addresses are returned in a deterministic order. They are accumulated from the GetSigners method for each Msg in the order they appear in tx.GetMsgs(). Duplicate addresses will be omitted.
func (StdTx) ValidateBasic ¶
ValidateBasic does a simple and lightweight validation check that doesn't require access to any other information.
type VestingAccount ¶
type VestingAccount interface { Account // Delegation and undelegation accounting that returns the resulting base // coins amount. TrackDelegation(blockTime time.Time, amount sdk.Coins) TrackUndelegation(amount sdk.Coins) GetVestedCoins(blockTime time.Time) sdk.Coins GetVestingCoins(blockTime time.Time) sdk.Coins GetStartTime() int64 GetEndTime() int64 GetOriginalVesting() sdk.Coins GetDelegatedFree() sdk.Coins GetDelegatedVesting() sdk.Coins }
VestingAccount defines an account type that vests coins via a vesting schedule.