Documentation ¶
Index ¶
- Constants
- Variables
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate
- func NewHandler(keeper Keeper, poolAddressMgr *PoolAddressManager, txOutStore *TxOutStore, ...) sdk.Handler
- func NewQuerier(keeper Keeper, poolAddressMgr *PoolAddressManager, ...) sdk.Querier
- func ValidateGenesis(data GenesisState) error
- type AckMemo
- type AddMemo
- type AdminConfig
- type AdminConfigKey
- type AdminMemo
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type BondMemo
- type CreateMemo
- type Event
- type EventStake
- type EventStatus
- type EventSwap
- type Events
- type GasMemo
- type GenesisState
- type Keeper
- func (k Keeper) AddIncompleteEvents(ctx sdk.Context, event Event)
- func (k Keeper) AddToPoolIndex(ctx sdk.Context, ticker common.Ticker) error
- func (k Keeper) AddToTxInIndex(ctx sdk.Context, height uint64, id common.TxID) error
- func (k Keeper) CheckTxHash(ctx sdk.Context, hash common.TxID) bool
- func (k Keeper) CompleteEvents(ctx sdk.Context, in []common.TxID, out common.TxID)
- func (k Keeper) EnsureTrustAccountUnique(ctx sdk.Context, account TrustAccount) error
- func (k Keeper) GetAdminConfigAmountType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) common.Amount
- func (k Keeper) GetAdminConfigBnbAddressType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) common.Address
- func (k Keeper) GetAdminConfigCoinsType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) sdk.Coins
- func (k Keeper) GetAdminConfigDesireValidatorSet(ctx sdk.Context, addr sdk.AccAddress) int64
- func (k Keeper) GetAdminConfigGSL(ctx sdk.Context, addr sdk.AccAddress) common.Amount
- func (k Keeper) GetAdminConfigInt64(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) int64
- func (k Keeper) GetAdminConfigIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetAdminConfigMinValidatorBond(ctx sdk.Context, addr sdk.AccAddress) sdk.Uint
- func (k Keeper) GetAdminConfigRotatePerBlockHeight(ctx sdk.Context, addr sdk.AccAddress) int64
- func (k Keeper) GetAdminConfigStakerAmtInterval(ctx sdk.Context, addr sdk.AccAddress) common.Amount
- func (k Keeper) GetAdminConfigUintType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) sdk.Uint
- func (k Keeper) GetAdminConfigValidatorsChangeWindow(ctx sdk.Context, addr sdk.AccAddress) int64
- func (k Keeper) GetAdminConfigValue(ctx sdk.Context, kkey AdminConfigKey, addr sdk.AccAddress) (val string, err error)
- func (k Keeper) GetAdminConfigWhiteListGasToken(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
- func (k Keeper) GetCompleteEventIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetCompletedEvent(ctx sdk.Context, id int64) (Event, error)
- func (k Keeper) GetIncompleteEvents(ctx sdk.Context) (Events, error)
- func (k Keeper) GetLastBinanceHeight(ctx sdk.Context) (height sdk.Uint)
- func (k Keeper) GetLastEventID(ctx sdk.Context) common.Amount
- func (k Keeper) GetLastSignedHeight(ctx sdk.Context) (height sdk.Uint)
- func (k Keeper) GetLowestActiveVersion(ctx sdk.Context) int
- func (k Keeper) GetNodeAccount(ctx sdk.Context, addr sdk.AccAddress) (NodeAccount, error)
- func (k Keeper) GetNodeAccountByBondAddress(ctx sdk.Context, addr common.Address) (NodeAccount, error)
- func (k Keeper) GetNodeAccountByObserver(ctx sdk.Context, addr sdk.AccAddress) (NodeAccount, error)
- func (k Keeper) GetNodeAccountIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetPool(ctx sdk.Context, ticker common.Ticker) Pool
- func (k Keeper) GetPoolAddresses(ctx sdk.Context) PoolAddresses
- func (k Keeper) GetPoolBalances(ctx sdk.Context, ticker, ticker2 common.Ticker) (sdk.Uint, sdk.Uint)
- func (k Keeper) GetPoolDataIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetPoolIndex(ctx sdk.Context) (PoolIndex, error)
- func (k Keeper) GetPoolStaker(ctx sdk.Context, ticker common.Ticker) (PoolStaker, error)
- func (k Keeper) GetPoolStakerIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetStakerPool(ctx sdk.Context, stakerID common.Address) (StakerPool, error)
- func (k Keeper) GetStakerPoolIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetTxInIndex(ctx sdk.Context, height uint64) (TxInIndex, error)
- func (k Keeper) GetTxInIndexIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetTxInVoter(ctx sdk.Context, hash common.TxID) TxInVoter
- func (k Keeper) GetTxInVoterIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetTxOut(ctx sdk.Context, height uint64) (*TxOut, error)
- func (k Keeper) GetTxOutIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetValidatorMeta(ctx sdk.Context) ValidatorMeta
- func (k Keeper) IsActiveObserver(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) IsWhitelistedNode(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) ListActiveNodeAccounts(ctx sdk.Context) (NodeAccounts, error)
- func (k Keeper) ListNodeAccounts(ctx sdk.Context) (NodeAccounts, error)
- func (k Keeper) ListNodeAccountsByStatus(ctx sdk.Context, status NodeStatus) (NodeAccounts, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) PoolExist(ctx sdk.Context, ticker common.Ticker) bool
- func (k Keeper) RemoveActiveObserver(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) RemoveFromPoolIndex(ctx sdk.Context, ticker common.Ticker) error
- func (k Keeper) SetActiveObserver(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) SetAdminConfig(ctx sdk.Context, config AdminConfig)
- func (k Keeper) SetCompletedEvent(ctx sdk.Context, event Event)
- func (k Keeper) SetIncompleteEvents(ctx sdk.Context, events Events)
- func (k Keeper) SetLastBinanceHeight(ctx sdk.Context, height sdk.Uint) error
- func (k Keeper) SetLastEventID(ctx sdk.Context, id common.Amount)
- func (k Keeper) SetLastSignedHeight(ctx sdk.Context, height sdk.Uint)
- func (k Keeper) SetNodeAccount(ctx sdk.Context, na NodeAccount)
- func (k Keeper) SetPool(ctx sdk.Context, pool Pool)
- func (k Keeper) SetPoolAddresses(ctx sdk.Context, addresses PoolAddresses)
- func (k Keeper) SetPoolData(ctx sdk.Context, ticker common.Ticker, ps PoolStatus)
- func (k Keeper) SetPoolIndex(ctx sdk.Context, pi PoolIndex)
- func (k Keeper) SetPoolStaker(ctx sdk.Context, ticker common.Ticker, ps PoolStaker)
- func (k Keeper) SetStakerPool(ctx sdk.Context, stakerID common.Address, sp StakerPool)
- func (k Keeper) SetTxInIndex(ctx sdk.Context, height uint64, index TxInIndex)
- func (k Keeper) SetTxInVoter(ctx sdk.Context, tx TxInVoter)
- func (k Keeper) SetTxOut(ctx sdk.Context, blockOut *TxOut)
- func (k Keeper) SetValidatorMeta(ctx sdk.Context, meta ValidatorMeta)
- func (k Keeper) TotalActiveNodeAccount(ctx sdk.Context) (int, error)
- func (k Keeper) TotalNodeAccounts(ctx sdk.Context) (count int)
- type LeaveMemo
- type Memo
- type MemoBase
- func (m MemoBase) GetAmount() string
- func (m MemoBase) GetBlockHeight() uint64
- func (m MemoBase) GetDestination() common.Address
- func (m MemoBase) GetKey() string
- func (m MemoBase) GetNextPoolAddress() common.Address
- func (m MemoBase) GetNodeAddress() sdk.AccAddress
- func (m MemoBase) GetSlipLimit() sdk.Uint
- func (m MemoBase) GetTicker() common.Ticker
- func (m MemoBase) GetType() TxType
- func (m MemoBase) GetValue() string
- func (m MemoBase) IsType(tx TxType) bool
- type MockInMemoryPoolStorage
- func (p *MockInMemoryPoolStorage) AddIncompleteEvents(ctx sdk.Context, event Event)
- func (p *MockInMemoryPoolStorage) GetAdminConfigStakerAmtInterval(ctx sdk.Context, addr sdk.AccAddress) common.Amount
- func (p *MockInMemoryPoolStorage) GetAdminConfigValue(ctx sdk.Context, key AdminConfigKey, addr sdk.AccAddress) (string, error)
- func (p *MockInMemoryPoolStorage) GetLowestActiveVersion(ctx sdk.Context) int
- func (p *MockInMemoryPoolStorage) GetPool(ctx sdk.Context, ticker common.Ticker) Pool
- func (p *MockInMemoryPoolStorage) GetPoolStaker(ctx sdk.Context, ticker common.Ticker) (PoolStaker, error)
- func (p *MockInMemoryPoolStorage) GetStakerPool(ctx sdk.Context, stakerID common.Address) (StakerPool, error)
- func (p *MockInMemoryPoolStorage) PoolExist(ctx sdk.Context, ticker common.Ticker) bool
- func (p *MockInMemoryPoolStorage) SetPool(ctx sdk.Context, ps Pool)
- func (p *MockInMemoryPoolStorage) SetPoolStaker(ctx sdk.Context, ticker common.Ticker, ps PoolStaker)
- func (p *MockInMemoryPoolStorage) SetStakerPool(ctx sdk.Context, stakerID common.Address, sp StakerPool)
- type MockTxOutSetter
- type MsgAck
- type MsgAdd
- type MsgBond
- type MsgEndPool
- type MsgLeave
- type MsgNextPoolAddress
- type MsgNoOp
- type MsgOutboundTx
- type MsgSetAdminConfig
- type MsgSetPoolData
- type MsgSetStakeData
- type MsgSetTrustAccount
- type MsgSetTxIn
- type MsgSetUnStake
- type MsgSetVersion
- type MsgSwap
- type NextPoolMemo
- type NodeAccount
- type NodeAccounts
- type NodeStatus
- type OutboundMemo
- type Pool
- type PoolAddressManager
- type PoolAddresses
- type PoolIndex
- type PoolStaker
- type PoolStatus
- type QueryResHeights
- type QueryResPools
- type QueryResTxOut
- type ResTxOut
- type StakeMemo
- type StakeTxDetail
- type StakerPool
- type StakerPoolItem
- type StakerUnit
- type SwapMemo
- type TrustAccount
- type TrustAccounts
- type TxIn
- type TxInIndex
- type TxInVoter
- type TxOut
- type TxOutItem
- type TxOutSetter
- type TxOutStore
- type TxType
- type ValidatorManager
- type ValidatorMeta
- type WithdrawMemo
Constants ¶
const ( ModuleName = types.ModuleName RouterKey = types.RouterKey StoreKey = types.StoreKey DefaultCodespace = types.DefaultCodespace PoolEnabled = types.Enabled PoolSuspended = types.Suspended EventSuccess = types.Success EventRefund = types.Refund // Admin config keys GSLKey = types.GSLKey StakerAmtIntervalKey = types.StakerAmtIntervalKey MaxWithdrawBasisPoints = types.MaxWithdrawBasisPoints MinValidatorBondKey = types.MinValidatorBondKey WhiteListGasTokenKey = types.WhiteListGasTokenKey DesireValidatorSetKey = types.DesireValidatorSetKey RotatePerBlockHeightKey = types.RotatePerBlockHeightKey ValidatorsChangeWindowKey = types.ValidatorsChangeWindowKey NodeActive = types.Active NodeWhiteListed = types.WhiteListed NodeDisabled = types.Disabled NodeReady = types.Ready NodeStandby = types.Standby NodeUnknown = types.Unknown )
const ( EventTypeNewPoolAddress = `pooladdress_new` EventTypePoolAddress = `pooladdress` PoolAddressAction = `action` )
const values used to emit events
const ( EventTypeNodeReady = `node_ready` EventTypeNextPoolAddress = `next_pool_address` EventTypeSignerAct = `signer_acked` )
const ( EventTypeValidatorManager = `validator_manager` EventTypeNominatedValidator = `validator_nominated` EventTypeQueuedValidator = `validator_queued` EventTypeValidatorActive = `validator_active` EventTypeValidatorStandby = `validator_standby` )
Variables ¶
var ( NewPool = types.NewPool NewAdminConfig = types.NewAdminConfig NewMsgNoOp = types.NewMsgNoOp NewMsgAdd = types.NewMsgAdd NewMsgSetPoolData = types.NewMsgSetPoolData NewMsgSetStakeData = types.NewMsgSetStakeData NewMsgSetUnStake = types.NewMsgSetUnStake NewMsgSwap = types.NewMsgSwap NewMsgSetAdminConfig = types.NewMsgSetAdminConfig NewTxOut = types.NewTxOut NewEvent = types.NewEvent NewEventSwap = types.NewEventSwap NewEventStake = types.NewEventStake NewEmptyRefundEvent = types.NewEmptyRefundEvent NewEventUnstake = types.NewEventUnstake NewMsgOutboundTx = types.NewMsgOutboundTx NewPoolStaker = types.NewPoolStaker NewStakerPool = types.NewStakerPool NewMsgEndPool = types.NewMsgEndPool NewMsgAck = types.NewMsgAck HasMajority = types.HasMajority GetAdminConfigKey = types.GetAdminConfigKey ModuleCdc = types.ModuleCdc RegisterCodec = types.RegisterCodec NewTrustAccount = types.NewTrustAccount NewNodeAccount = types.NewNodeAccount NewMsgBond = types.NewMsgBond NewPoolAddresses = types.NewPoolAddresses NewMsgNextPoolAddress = types.NewMsgNextPoolAddress NewMsgLeave = types.NewMsgLeave GetRandomNodeAccount = types.GetRandomNodeAccount GetRandomBNBAddress = types.GetRandomBNBAddress GetRandomTxHash = types.GetRandomTxHash GetRandomBech32Addr = types.GetRandomBech32Addr GetRandomBech32ConsensusPubKey = types.GetRandomBech32ConsensusPubKey SetupConfigForTest = types.SetupConfigForTest )
var EmptyAccAddress = sdk.AccAddress{}
EmptyAccAddress empty address
Functions ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate
InitGenesis read the data in GenesisState and apply it to data store
func NewHandler ¶
func NewHandler(keeper Keeper, poolAddressMgr *PoolAddressManager, txOutStore *TxOutStore, validatorManager *ValidatorManager) sdk.Handler
NewHandler returns a handler for "swapservice" type messages.
func NewQuerier ¶
func NewQuerier(keeper Keeper, poolAddressMgr *PoolAddressManager, validatorMgr *ValidatorManager) sdk.Querier
NewQuerier is the module level router for state queries
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validate genesis is valid or not
Types ¶
type AdminConfig ¶
type AdminConfig = types.AdminConfig
type AdminConfigKey ¶
type AdminConfigKey = types.AdminConfigKey
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
func NewAppModule ¶
NewAppModule creates a new AppModule Object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
func (AppModule) NewHandler ¶
func (AppModule) NewQuerierHandler ¶
func (AppModule) QuerierRoute ¶
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module Basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
Get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
Get the root tx command of this module
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
Register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
Validation check of the Genesis
type BondMemo ¶
type BondMemo struct { MemoBase NodeAddress sdk.AccAddress }
func (BondMemo) GetNodeAddress ¶
func (m BondMemo) GetNodeAddress() sdk.AccAddress
type CreateMemo ¶
type CreateMemo struct {
MemoBase
}
type EventStake ¶
type EventStake = types.EventStake
type EventStatus ¶
type EventStatus = types.EventStatus
type GenesisState ¶
type GenesisState struct { Pools []Pool `json:"pools"` PoolIndex PoolIndex `json:"pool_index"` PoolStakers []PoolStaker `json:"pool_stakers"` StakerPools []StakerPool `json:"staker_pools"` TxInVoters []TxInVoter `json:"txin_voters"` TxInIndexes []txIndex `json:"txin_indexes"` TxOuts []TxOut `json:"txouts"` CompleteEvents Events `json:"complete_events"` IncompleteEvents Events `json:"incomplete_events"` NodeAccounts NodeAccounts `json:"node_accounts"` AdminConfigs []AdminConfig `json:"admin_configs"` LastEventID common.Amount `json:"last_event_id"` }
GenesisState strcture that used to store the data we put in genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState the default values we put in the Genesis
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis export the data in Genesis
func NewGenesisState ¶
func NewGenesisState(pools []Pool, nodeAccounts NodeAccounts, configs []AdminConfig) GenesisState
NewGenesisState create a new instance of GenesisState
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(coinKeeper bank.Keeper, supplyKeeper supply.Keeper, storeKey sdk.StoreKey, cdc *codec.Codec) Keeper
NewKeeper creates new instances of the swapservice Keeper
func (Keeper) AddIncompleteEvents ¶
AddIncompleteEvents append to incomplete events
func (Keeper) AddToPoolIndex ¶
AddToPoolIndex will add the given ticker into the poolindex
func (Keeper) AddToTxInIndex ¶
AddToTxInIndex will add the given txIn into the index
func (Keeper) CheckTxHash ¶
CheckTxHash - check to see if we have already processed a specific tx
func (Keeper) CompleteEvents ¶
CompleteEvent
func (Keeper) EnsureTrustAccountUnique ¶
func (k Keeper) EnsureTrustAccountUnique(ctx sdk.Context, account TrustAccount) error
func (Keeper) GetAdminConfigAmountType ¶
func (k Keeper) GetAdminConfigAmountType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) common.Amount
GetAdminConfigAmountType - get the config for TSL
func (Keeper) GetAdminConfigBnbAddressType ¶
func (k Keeper) GetAdminConfigBnbAddressType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) common.Address
GetAdminConfigBnbAddressType - get the config with return type is BNBAddress
func (Keeper) GetAdminConfigCoinsType ¶
func (k Keeper) GetAdminConfigCoinsType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) sdk.Coins
GetAdminConfigCoinsType - get the config for TSL
func (Keeper) GetAdminConfigDesireValidatorSet ¶
GetAdminConfigDesireValidatorSet
func (Keeper) GetAdminConfigGSL ¶
GetAdminConfigGSL - get the config for GSL
func (Keeper) GetAdminConfigInt64 ¶
func (k Keeper) GetAdminConfigInt64(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) int64
GetAdminConfigInt64 - get the int64 config
func (Keeper) GetAdminConfigIterator ¶
GetAdminConfigIterator iterate admin configs
func (Keeper) GetAdminConfigMinValidatorBond ¶
GetAdminConfigMinValidatorBond get the minimum bond to become a validator
func (Keeper) GetAdminConfigRotatePerBlockHeight ¶
GetAdminConfigRotatePerBlockHeight get rotate per block height
func (Keeper) GetAdminConfigStakerAmtInterval ¶
GetAdminConfigStakerAmtInterval - get the config for StakerAmtInterval
func (Keeper) GetAdminConfigUintType ¶
func (k Keeper) GetAdminConfigUintType(ctx sdk.Context, key AdminConfigKey, dValue string, addr sdk.AccAddress) sdk.Uint
func (Keeper) GetAdminConfigValidatorsChangeWindow ¶
GetAdminConfigValidatorsChangeWindow get validator change window
func (Keeper) GetAdminConfigValue ¶
func (k Keeper) GetAdminConfigValue(ctx sdk.Context, kkey AdminConfigKey, addr sdk.AccAddress) (val string, err error)
GetAdminConfigValue - gets the value of a given admin key
func (Keeper) GetAdminConfigWhiteListGasToken ¶
GetAdminConfigWhiteListGasToken
func (Keeper) GetCompleteEventIterator ¶
GetCompleteEventIterator iterate complete events
func (Keeper) GetCompletedEvent ¶
GetCompletedEvent retrieve completed event
func (Keeper) GetIncompleteEvents ¶
GetIncompleteEvents retrieve incomplete events
func (Keeper) GetLastBinanceHeight ¶
func (Keeper) GetLastEventID ¶
GetLastEventID get last event id
func (Keeper) GetLastSignedHeight ¶
func (Keeper) GetLowestActiveVersion ¶
GetLowestActiveVersion - get version number of lowest active node
func (Keeper) GetNodeAccount ¶
func (k Keeper) GetNodeAccount(ctx sdk.Context, addr sdk.AccAddress) (NodeAccount, error)
GetNodeAccount try to get node account with the given address from db
func (Keeper) GetNodeAccountByBondAddress ¶
func (k Keeper) GetNodeAccountByBondAddress(ctx sdk.Context, addr common.Address) (NodeAccount, error)
GetNodeAccountByBondAddress go through data store to get node account by it's signer bnb address
func (Keeper) GetNodeAccountByObserver ¶
func (k Keeper) GetNodeAccountByObserver(ctx sdk.Context, addr sdk.AccAddress) (NodeAccount, error)
GetNodeAccountByObserver
func (Keeper) GetNodeAccountIterator ¶
GetTrustAccountIterator iterate trust accounts
func (Keeper) GetPoolAddresses ¶
func (k Keeper) GetPoolAddresses(ctx sdk.Context) PoolAddresses
GetPoolAddresses get current pool addresses
func (Keeper) GetPoolBalances ¶
func (Keeper) GetPoolDataIterator ¶
GetPoolDataIterator only iterate pool data
func (Keeper) GetPoolIndex ¶
GetPoolIndex retrieve pool index from the data store
func (Keeper) GetPoolStaker ¶
GetPoolStaker retrieve poolStaker from the data store
func (Keeper) GetPoolStakerIterator ¶
GetPoolStakerIterator iterate pool stakers
func (Keeper) GetStakerPool ¶
GetStakerPool get the stakerpool from key value store
func (Keeper) GetStakerPoolIterator ¶
GetStakerPoolIterator iterate stakers pools
func (Keeper) GetTxInIndex ¶
GetTxInIndex retrieve txIn by height
func (Keeper) GetTxInIndexIterator ¶
GetTxInIndexIterator iterate tx in indexes
func (Keeper) GetTxInVoter ¶
GetTxIn - gets information of a tx hash
func (Keeper) GetTxInVoterIterator ¶
GetTxInVoterIterator iterate tx in voters
func (Keeper) GetTxOutIterator ¶
GetTxOutIterator iterate tx out
func (Keeper) GetValidatorMeta ¶
func (k Keeper) GetValidatorMeta(ctx sdk.Context) ValidatorMeta
func (Keeper) IsActiveObserver ¶
IsActiveObserver check the given account address, whether they are active
func (Keeper) IsWhitelistedNode ¶
IsWhitelistedAccount check whether the given account is white listed
func (Keeper) ListActiveNodeAccounts ¶
func (k Keeper) ListActiveNodeAccounts(ctx sdk.Context) (NodeAccounts, error)
ListActiveNodeAccounts - get a list of active trust accounts
func (Keeper) ListNodeAccounts ¶
func (k Keeper) ListNodeAccounts(ctx sdk.Context) (NodeAccounts, error)
ListNodeAccounts - gets a list of all trust accounts
func (Keeper) ListNodeAccountsByStatus ¶
func (k Keeper) ListNodeAccountsByStatus(ctx sdk.Context, status NodeStatus) (NodeAccounts, error)
ListNodeAccountsByStatus - get a list of node accounts with the given status if status = NodeUnknown, then it return everything
func (Keeper) RemoveActiveObserver ¶
func (k Keeper) RemoveActiveObserver(ctx sdk.Context, addr sdk.AccAddress)
RemoveActiveObserver remove the given address from active observer
func (Keeper) RemoveFromPoolIndex ¶
RemoveFromPoolIndex remove the given ticker from the poolIndex
func (Keeper) SetActiveObserver ¶
func (k Keeper) SetActiveObserver(ctx sdk.Context, addr sdk.AccAddress)
SetActiveObserver set the given addr as an active observer address
func (Keeper) SetAdminConfig ¶
func (k Keeper) SetAdminConfig(ctx sdk.Context, config AdminConfig)
SetAdminConfig - saving a given admin config to the KVStore
func (Keeper) SetCompletedEvent ¶
SetCompletedEvent write a completed event
func (Keeper) SetIncompleteEvents ¶
SetIncompleteEvents write incomplete events
func (Keeper) SetLastBinanceHeight ¶
func (Keeper) SetLastEventID ¶
SetLastEventID write a last event id
func (Keeper) SetLastSignedHeight ¶
func (Keeper) SetNodeAccount ¶
func (k Keeper) SetNodeAccount(ctx sdk.Context, na NodeAccount)
SetNodeAccount save the given node account into datastore
func (Keeper) SetPoolAddresses ¶
func (k Keeper) SetPoolAddresses(ctx sdk.Context, addresses PoolAddresses)
SetPoolAddresses save the pool address to key value store
func (Keeper) SetPoolData ¶
SetPoolData - sets the value string that a pool ID resolves to
func (Keeper) SetPoolIndex ¶
SetPoolIndex write a pool index into datastore
func (Keeper) SetPoolStaker ¶
SetPoolStaker store the poolstaker to datastore
func (Keeper) SetStakerPool ¶
SetStakerPool save the given stakerpool object to key value store
func (Keeper) SetTxInIndex ¶
SetTxInIndex write a TxIn index into datastore
func (Keeper) SetTxInVoter ¶
SetTxHas - saving a given txhash to the KVStore
func (Keeper) SetValidatorMeta ¶
func (k Keeper) SetValidatorMeta(ctx sdk.Context, meta ValidatorMeta)
func (Keeper) TotalActiveNodeAccount ¶
TotalActiveNodeAccount count the number of active node account
type Memo ¶
type MemoBase ¶
func (MemoBase) GetBlockHeight ¶
func (MemoBase) GetDestination ¶
func (MemoBase) GetNextPoolAddress ¶
func (MemoBase) GetNodeAddress ¶
func (m MemoBase) GetNodeAddress() sdk.AccAddress
func (MemoBase) GetSlipLimit ¶
type MockInMemoryPoolStorage ¶
type MockInMemoryPoolStorage struct {
// contains filtered or unexported fields
}
func NewMockInMemoryPoolStorage ¶
func NewMockInMemoryPoolStorage() *MockInMemoryPoolStorage
NewMockInMemoryPoolStorage
func (*MockInMemoryPoolStorage) AddIncompleteEvents ¶
func (p *MockInMemoryPoolStorage) AddIncompleteEvents(ctx sdk.Context, event Event)
func (*MockInMemoryPoolStorage) GetAdminConfigStakerAmtInterval ¶
func (p *MockInMemoryPoolStorage) GetAdminConfigStakerAmtInterval(ctx sdk.Context, addr sdk.AccAddress) common.Amount
func (*MockInMemoryPoolStorage) GetAdminConfigValue ¶
func (p *MockInMemoryPoolStorage) GetAdminConfigValue(ctx sdk.Context, key AdminConfigKey, addr sdk.AccAddress) (string, error)
func (*MockInMemoryPoolStorage) GetLowestActiveVersion ¶
func (p *MockInMemoryPoolStorage) GetLowestActiveVersion(ctx sdk.Context) int
func (*MockInMemoryPoolStorage) GetPoolStaker ¶
func (p *MockInMemoryPoolStorage) GetPoolStaker(ctx sdk.Context, ticker common.Ticker) (PoolStaker, error)
func (*MockInMemoryPoolStorage) GetStakerPool ¶
func (p *MockInMemoryPoolStorage) GetStakerPool(ctx sdk.Context, stakerID common.Address) (StakerPool, error)
func (*MockInMemoryPoolStorage) SetPool ¶
func (p *MockInMemoryPoolStorage) SetPool(ctx sdk.Context, ps Pool)
func (*MockInMemoryPoolStorage) SetPoolStaker ¶
func (p *MockInMemoryPoolStorage) SetPoolStaker(ctx sdk.Context, ticker common.Ticker, ps PoolStaker)
func (*MockInMemoryPoolStorage) SetStakerPool ¶
func (p *MockInMemoryPoolStorage) SetStakerPool(ctx sdk.Context, stakerID common.Address, sp StakerPool)
type MsgEndPool ¶
type MsgEndPool = types.MsgEndPool
type MsgNextPoolAddress ¶
type MsgNextPoolAddress = types.MsgNextPoolAddress
type MsgOutboundTx ¶
type MsgOutboundTx = types.MsgOutboundTx
type MsgSetAdminConfig ¶
type MsgSetAdminConfig = types.MsgSetAdminConfig
type MsgSetPoolData ¶
type MsgSetPoolData = types.MsgSetPoolData
type MsgSetStakeData ¶
type MsgSetStakeData = types.MsgSetStakeData
type MsgSetTrustAccount ¶
type MsgSetTrustAccount = types.MsgSetTrustAccount
type MsgSetTxIn ¶
type MsgSetTxIn = types.MsgSetTxIn
type MsgSetUnStake ¶
type MsgSetUnStake = types.MsgSetUnStake
type MsgSetVersion ¶
type MsgSetVersion = types.MsgSetVersion
type NextPoolMemo ¶
func (NextPoolMemo) GetNextPoolAddress ¶
func (m NextPoolMemo) GetNextPoolAddress() common.Address
type NodeAccount ¶
type NodeAccount = types.NodeAccount
type NodeAccounts ¶
type NodeAccounts = types.NodeAccounts
type NodeStatus ¶
type NodeStatus = types.NodeStatus
type OutboundMemo ¶
func (OutboundMemo) GetBlockHeight ¶
func (m OutboundMemo) GetBlockHeight() uint64
type PoolAddressManager ¶
type PoolAddressManager struct {
// contains filtered or unexported fields
}
PoolAddressManager is going to manage the pool addresses , rotate etc
func NewPoolAddressManager ¶
func NewPoolAddressManager(k Keeper) *PoolAddressManager
NewPoolAddressManager create a new PoolAddressManager
func (*PoolAddressManager) BeginBlock ¶
func (pm *PoolAddressManager) BeginBlock(ctx sdk.Context, height int64)
BeginBlock
func (*PoolAddressManager) EndBlock ¶
func (pm *PoolAddressManager) EndBlock(ctx sdk.Context, height int64, store *TxOutStore)
func (*PoolAddressManager) GetCurrentPoolAddresses ¶
func (pm *PoolAddressManager) GetCurrentPoolAddresses() PoolAddresses
type PoolAddresses ¶
type PoolAddresses = types.PoolAddresses
type PoolStaker ¶
type PoolStaker = types.PoolStaker
type PoolStatus ¶
type PoolStatus = types.PoolStatus
type QueryResHeights ¶
type QueryResHeights = types.QueryResHeights
type QueryResPools ¶
type QueryResPools = types.QueryResPools
type QueryResTxOut ¶
type QueryResTxOut = types.QueryResTxOut
type StakeTxDetail ¶
type StakeTxDetail = types.StakeTxDetail
type StakerPool ¶
type StakerPool = types.StakerPool
type StakerPoolItem ¶
type StakerPoolItem = types.StakerPoolItem
type StakerUnit ¶
type StakerUnit = types.StakerUnit
type TrustAccount ¶
type TrustAccount = types.TrustAccount
type TrustAccounts ¶
type TrustAccounts = types.TrustAccounts
type TxOutSetter ¶
TxOutSetter define a method that is required to be used in TxOutStore We need this interface thus we could test the refund logic accordingly
type TxOutStore ¶
type TxOutStore struct {
// contains filtered or unexported fields
}
TxOutStore is going to manage all the outgoing tx
func NewTxOutStore ¶
func NewTxOutStore(txOutSetter TxOutSetter) *TxOutStore
NewTxOutStore will create a new instance of TxOutStore.
func (*TxOutStore) AddTxOutItem ¶
func (tos *TxOutStore) AddTxOutItem(ctx sdk.Context, keeper Keeper, toi *TxOutItem)
AddTxOutItem add an item to internal structure
func (*TxOutStore) CommitBlock ¶
func (tos *TxOutStore) CommitBlock(ctx sdk.Context)
CommitBlock we write the block into key value store , thus we could send to signer later.
func (*TxOutStore) NewBlock ¶
func (tos *TxOutStore) NewBlock(height uint64)
NewBlock create a new block
type ValidatorManager ¶
type ValidatorManager struct { Meta *ValidatorMeta // contains filtered or unexported fields }
ValidatorManager is to manage a list of validators , and rotate them
func NewValidatorManager ¶
func NewValidatorManager(k Keeper) *ValidatorManager
NewValidatorManager create a new instance of ValidatorManager
func (*ValidatorManager) BeginBlock ¶
func (vm *ValidatorManager) BeginBlock(ctx sdk.Context, height int64)
BeginBlock when block begin
func (*ValidatorManager) EndBlock ¶
func (vm *ValidatorManager) EndBlock(ctx sdk.Context, height int64) []abci.ValidatorUpdate
EndBlock when block end
type ValidatorMeta ¶
type ValidatorMeta = types.ValidatorMeta
type WithdrawMemo ¶
func (WithdrawMemo) GetAmount ¶
func (m WithdrawMemo) GetAmount() string
Transaction Specific Functions