Documentation
¶
Index ¶
- Constants
- Variables
- func AddressStoreKey(addr sdk.AccAddress) []byte
- func EndBlocker(ctx sdk.Context, aux AccountXKeeper, keeper auth.AccountKeeper)
- func ErrGasPriceTooLow(required, actual sdk.Dec) sdk.Error
- func ErrInvalidMinGasPriceLimit(limit sdk.Dec) sdk.Error
- func InitGenesis(ctx sdk.Context, keeper AccountXKeeper, data GenesisState)
- func KeyUnlockedCoinsQueue(unlockedTime int64, address sdk.AccAddress) []byte
- func NewAnteHandler(ak auth.AccountKeeper, fck auth.FeeCollectionKeeper, axk AccountXKeeper, ...) sdk.AnteHandler
- func NewQuerier(keeper AccountXKeeper) sdk.Querier
- func ParamKeyTable() params.KeyTable
- func PrefixUnlockedTimeQueueTime(unlockedTime int64) []byte
- func RegisterCodec(cdc *codec.Codec)
- type AccountAll
- type AccountMix
- type AccountX
- func (acc *AccountX) AddLockedCoins(coins LockedCoins)
- func (acc *AccountX) GetAddress() sdk.AccAddress
- func (acc *AccountX) GetAllLockedCoins() LockedCoins
- func (acc *AccountX) GetAllUnlockedCoinsAtTheTime(time int64) LockedCoins
- func (acc *AccountX) GetLockedCoinsByDemon(demon string) LockedCoins
- func (acc *AccountX) GetUnlockedCoinsAtTheTime(demon string, time int64) LockedCoins
- func (acc *AccountX) IsMemoRequired() bool
- func (acc *AccountX) SetAddress(address sdk.AccAddress)
- func (acc *AccountX) SetMemoRequired(b bool)
- func (acc AccountX) String() string
- func (acc *AccountX) TransferUnlockedCoins(time int64, ctx sdk.Context, kx AccountXKeeper, keeper auth.AccountKeeper)
- type AccountXKeeper
- func (axk AccountXKeeper) GetAccountX(ctx sdk.Context, addr sdk.AccAddress) (ax AccountX, ok bool)
- func (axk AccountXKeeper) GetOrCreateAccountX(ctx sdk.Context, addr sdk.AccAddress) AccountX
- func (axk AccountXKeeper) GetParams(ctx sdk.Context) (params Params)
- func (axk AccountXKeeper) InsertUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)
- func (axk AccountXKeeper) IterateAccounts(ctx sdk.Context, process func(AccountX) (stop bool))
- func (axk AccountXKeeper) RemoveFromUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)
- func (axk AccountXKeeper) RemoveFromUnlockedCoinsQueueByKey(ctx sdk.Context, key []byte)
- func (axk AccountXKeeper) SetAccountX(ctx sdk.Context, ax AccountX)
- func (axk AccountXKeeper) SetParams(ctx sdk.Context, params Params)
- func (axk AccountXKeeper) UnlockedCoinsQueueIterator(ctx sdk.Context, unlockedTime int64) sdk.Iterator
- type AnteHelper
- type GenesisState
- type LockedCoin
- type LockedCoins
- type Params
Constants ¶
const ( CodeSpaceAuthX sdk.CodespaceType = "authx" // 201 ~ 299 CodeInvalidMinGasPriceLimit sdk.CodeType = 201 CodeGasPriceTooLow sdk.CodeType = 202 )
const ( // StoreKey is string representation of the store key for authx StoreKey = "accx" // QuerierRoute is the querier route for accx QuerierRoute = StoreKey )
const ( // DefaultMinGasPrice of the network // Make token transfer/send tx to costs around 0.01CET // activated account send to self, costs 38883 gas // activated account send to non-activated account, costs 48951 gas // activated account send to other activated addr, costs 33903 gas // consider it takes 50000 to do transfer/send tx // so, min_gas_price = 100000000sato.CET * 0.01 / 50000 = 20 sato.CET DefaultMinGasPriceLimit = "20.0" )
Default parameter values
const DefaultParamspace = "authx"
DefaultParamspace defines the default authx module parameter subspace
const (
QueryAccountX = "accountx"
)
query endpoints supported by the auth Querier
Variables ¶
var ( PrefixUnlockedCoinsQueue = []byte("UnlockedCoinsQueue") KeyDelimiter = []byte(";") )
var ( // AddressStoreKeyPrefix prefix for accountx-by-address store AddressStoreKeyPrefix = []byte{0x01} )
var (
KeyMinGasPriceLimit = []byte("MinGasPriceLimit")
)
Parameter keys
Functions ¶
func AddressStoreKey ¶
func AddressStoreKey(addr sdk.AccAddress) []byte
func EndBlocker ¶
func EndBlocker(ctx sdk.Context, aux AccountXKeeper, keeper auth.AccountKeeper)
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper AccountXKeeper, data GenesisState)
InitGenesis - Init store state from genesis data
func KeyUnlockedCoinsQueue ¶
func KeyUnlockedCoinsQueue(unlockedTime int64, address sdk.AccAddress) []byte
func NewAnteHandler ¶
func NewAnteHandler(ak auth.AccountKeeper, fck auth.FeeCollectionKeeper, axk AccountXKeeper, anteHelper AnteHelper) sdk.AnteHandler
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.
func NewQuerier ¶
func NewQuerier(keeper AccountXKeeper) sdk.Querier
creates a querier for auth REST endpoints
func RegisterCodec ¶
RegisterCodec registers concrete types on the codec
Types ¶
type AccountAll ¶
type AccountAll struct { Account auth.Account `json:"account"` AccountX AccountX `json:"account_x"` }
func (AccountAll) String ¶
func (accAll AccountAll) String() string
type AccountMix ¶
type AccountMix struct { Address sdk.AccAddress `json:"address"` Coins sdk.Coins `json:"coins"` LockedCoins LockedCoins `json:"locked_coins"` FrozenCoins sdk.Coins `json:"frozen_coins"` PubKey crypto.PubKey `json:"public_key"` AccountNumber uint64 `json:"account_number"` Sequence uint64 `json:"sequence"` MemoRequired bool `json:"memo_required"` // if memo is required for receiving coins }
func NewAccountMix ¶
func NewAccountMix(acc auth.Account, x AccountX) AccountMix
type AccountX ¶
type AccountX struct { Address sdk.AccAddress `json:"address"` MemoRequired bool `json:"memo_required"` // if memo is required for receiving coins LockedCoins LockedCoins `json:"locked_coins"` FrozenCoins sdk.Coins `json:"frozen_coins"` }
func NewAccountXWithAddress ¶
func NewAccountXWithAddress(addr sdk.AccAddress) AccountX
func (*AccountX) AddLockedCoins ¶
func (acc *AccountX) AddLockedCoins(coins LockedCoins)
func (*AccountX) GetAddress ¶
func (acc *AccountX) GetAddress() sdk.AccAddress
func (*AccountX) GetAllLockedCoins ¶
func (acc *AccountX) GetAllLockedCoins() LockedCoins
func (*AccountX) GetAllUnlockedCoinsAtTheTime ¶
func (acc *AccountX) GetAllUnlockedCoinsAtTheTime(time int64) LockedCoins
func (*AccountX) GetLockedCoinsByDemon ¶
func (acc *AccountX) GetLockedCoinsByDemon(demon string) LockedCoins
func (*AccountX) GetUnlockedCoinsAtTheTime ¶
func (acc *AccountX) GetUnlockedCoinsAtTheTime(demon string, time int64) LockedCoins
func (*AccountX) IsMemoRequired ¶
func (*AccountX) SetAddress ¶
func (acc *AccountX) SetAddress(address sdk.AccAddress)
func (*AccountX) SetMemoRequired ¶
func (*AccountX) TransferUnlockedCoins ¶
func (acc *AccountX) TransferUnlockedCoins(time int64, ctx sdk.Context, kx AccountXKeeper, keeper auth.AccountKeeper)
type AccountXKeeper ¶
type AccountXKeeper struct {
// contains filtered or unexported fields
}
func (AccountXKeeper) GetAccountX ¶
func (axk AccountXKeeper) GetAccountX(ctx sdk.Context, addr sdk.AccAddress) (ax AccountX, ok bool)
func (AccountXKeeper) GetOrCreateAccountX ¶
func (axk AccountXKeeper) GetOrCreateAccountX(ctx sdk.Context, addr sdk.AccAddress) AccountX
func (AccountXKeeper) GetParams ¶
func (axk AccountXKeeper) GetParams(ctx sdk.Context) (params Params)
GetParams gets the asset module's parameters.
func (AccountXKeeper) InsertUnlockedCoinsQueue ¶
func (axk AccountXKeeper) InsertUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)
func (AccountXKeeper) IterateAccounts ¶
func (axk AccountXKeeper) IterateAccounts(ctx sdk.Context, process func(AccountX) (stop bool))
func (AccountXKeeper) RemoveFromUnlockedCoinsQueue ¶
func (axk AccountXKeeper) RemoveFromUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)
func (AccountXKeeper) RemoveFromUnlockedCoinsQueueByKey ¶
func (axk AccountXKeeper) RemoveFromUnlockedCoinsQueueByKey(ctx sdk.Context, key []byte)
func (AccountXKeeper) SetAccountX ¶
func (axk AccountXKeeper) SetAccountX(ctx sdk.Context, ax AccountX)
func (AccountXKeeper) SetParams ¶
func (axk AccountXKeeper) SetParams(ctx sdk.Context, params Params)
SetParams sets the asset module's parameters.
func (AccountXKeeper) UnlockedCoinsQueueIterator ¶
type AnteHelper ¶
type GenesisState ¶
type GenesisState struct {
Params Params `json:"params"`
}
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - Return a default genesis state
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper AccountXKeeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
func NewGenesisState ¶
func NewGenesisState(params Params) GenesisState
func (GenesisState) Validate ¶
func (data GenesisState) Validate() error
ValidateGenesis performs basic validation of asset genesis data returning an error for any failed validation criteria.
type LockedCoin ¶
func (LockedCoin) String ¶
func (coin LockedCoin) String() string
type LockedCoins ¶
type LockedCoins []LockedCoin
func (LockedCoins) String ¶
func (coins LockedCoins) String() string
type Params ¶
Params defines the parameters for the authx module.
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of authx module's parameters.