Documentation ¶
Index ¶
- Constants
- Variables
- func Fund(ctx sdk.Context, keeper Keeper, txOutStore *TxOutStore) error
- 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 RefundBond(ctx sdk.Context, txID common.TxID, nodeAcc NodeAccount, keeper Keeper, ...)
- 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) AddChain(ctx sdk.Context, chain common.Chain)
- func (k Keeper) AddIncompleteEvents(ctx sdk.Context, event Event)
- func (k Keeper) AddObservingAddresses(ctx sdk.Context, inAddresses []sdk.AccAddress)
- func (k Keeper) AddToPoolIndex(ctx sdk.Context, asset common.Asset) 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) ClearObservingAddresses(ctx sdk.Context)
- func (k Keeper) CompleteEvents(ctx sdk.Context, in []common.TxID, out common.Tx)
- func (k Keeper) EnableAPool(ctx sdk.Context)
- func (k Keeper) EnsureTrustAccountUnique(ctx sdk.Context, consensusPubKey string, pubKeys common.PubKeys) error
- func (k Keeper) FindPubKeyOfAddress(ctx sdk.Context, addr common.Address, chain common.Chain) (common.PubKey, 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) GetAdminConfigDefaultPoolStatus(ctx sdk.Context, addr sdk.AccAddress) PoolStatus
- 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) 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) GetAdminConfigValue(ctx sdk.Context, kkey AdminConfigKey, addr sdk.AccAddress) (val string, err error)
- func (k Keeper) GetAdminConfigWhiteListGasAsset(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
- func (k Keeper) GetChains(ctx sdk.Context) common.Chains
- 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) GetLastChainHeight(ctx sdk.Context, chain common.Chain) (height sdk.Uint)
- func (k Keeper) GetLastEventID(ctx sdk.Context) int64
- func (k Keeper) GetLastSignedHeight(ctx sdk.Context) (height sdk.Uint)
- func (k Keeper) GetLowestActiveVersion(ctx sdk.Context) int64
- 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) GetNodeAccountByPubKey(ctx sdk.Context, pk common.PubKey) (NodeAccount, error)
- func (k Keeper) GetNodeAccountIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetObservingAddresses(ctx sdk.Context) []sdk.AccAddress
- func (k Keeper) GetPool(ctx sdk.Context, asset common.Asset) Pool
- func (k Keeper) GetPoolAddresses(ctx sdk.Context) PoolAddresses
- func (k Keeper) GetPoolBalances(ctx sdk.Context, asset, asset2 common.Asset) (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, asset common.Asset) (PoolStaker, error)
- func (k Keeper) GetPoolStakerIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetReservesContributors(ctx sdk.Context) ReserveContributors
- 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) GetVaultData(ctx sdk.Context) VaultData
- func (k Keeper) GetYggdrasil(ctx sdk.Context, pk common.PubKey) Yggdrasil
- func (k Keeper) GetYggdrasilIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) HasValidYggdrasilPools(ctx sdk.Context) (bool, error)
- 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, asset common.Asset) bool
- func (k Keeper) RemoveActiveObserver(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) RemoveFromPoolIndex(ctx sdk.Context, asset common.Asset) 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) SetLastChainHeight(ctx sdk.Context, chain common.Chain, height sdk.Uint) error
- func (k Keeper) SetLastEventID(ctx sdk.Context, id int64)
- 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, asset common.Asset, ps PoolStatus)
- func (k Keeper) SetPoolIndex(ctx sdk.Context, pi PoolIndex)
- func (k Keeper) SetPoolStaker(ctx sdk.Context, asset common.Asset, ps PoolStaker)
- func (k Keeper) SetReserveContributors(ctx sdk.Context, contribs ReserveContributors)
- 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) SetVaultData(ctx sdk.Context, data VaultData)
- func (k Keeper) SetYggdrasil(ctx sdk.Context, ygg Yggdrasil)
- func (k Keeper) SlashNodeAccountBond(ctx sdk.Context, na *NodeAccount, slash sdk.Uint)
- func (k Keeper) SlashNodeAccountRewards(ctx sdk.Context, na *NodeAccount, pts int64)
- func (k Keeper) SupportedChain(ctx sdk.Context, chain common.Chain) bool
- func (k Keeper) TotalActiveNodeAccount(ctx sdk.Context) (int, error)
- func (k Keeper) TotalNodeAccounts(ctx sdk.Context) (count int)
- func (k Keeper) UpdateVaultData(ctx sdk.Context)
- type LeaveMemo
- type Memo
- type MemoBase
- func (m MemoBase) GetAmount() string
- func (m MemoBase) GetAsset() common.Asset
- func (m MemoBase) GetDestination() common.Address
- func (m MemoBase) GetKey() string
- func (m MemoBase) GetNextPoolAddress() common.PubKey
- func (m MemoBase) GetNodeAddress() sdk.AccAddress
- func (m MemoBase) GetSlipLimit() sdk.Uint
- func (m MemoBase) GetTxID() common.TxID
- func (m MemoBase) GetType() TxType
- func (m MemoBase) GetValue() string
- func (m MemoBase) IsType(tx TxType) bool
- func (m MemoBase) String() string
- type MockInMemoryPoolStorage
- func (p *MockInMemoryPoolStorage) AddIncompleteEvents(ctx sdk.Context, event Event)
- func (p *MockInMemoryPoolStorage) GetAdminConfigDefaultPoolStatus(ctx sdk.Context, addr sdk.AccAddress) PoolStatus
- 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) int64
- func (p *MockInMemoryPoolStorage) GetPool(ctx sdk.Context, asset common.Asset) Pool
- func (p *MockInMemoryPoolStorage) GetPoolStaker(ctx sdk.Context, asset common.Asset) (PoolStaker, error)
- func (p *MockInMemoryPoolStorage) GetStakerPool(ctx sdk.Context, stakerID common.Address) (StakerPool, error)
- func (p *MockInMemoryPoolStorage) PoolExist(ctx sdk.Context, asset common.Asset) bool
- func (p *MockInMemoryPoolStorage) SetCompletedEvent(ctx sdk.Context, event Event)
- func (p *MockInMemoryPoolStorage) SetPool(ctx sdk.Context, ps Pool)
- func (p *MockInMemoryPoolStorage) SetPoolStaker(ctx sdk.Context, asset common.Asset, 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 MsgReserveContributor
- type MsgSetAdminConfig
- type MsgSetPoolData
- type MsgSetStakeData
- type MsgSetTrustAccount
- type MsgSetTxIn
- type MsgSetUnStake
- type MsgSetVersion
- type MsgSwap
- type MsgYggdrasil
- type NextPoolMemo
- type NodeAccount
- type NodeAccounts
- type NodeAccountsBySlashingPoint
- 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 ReserveContributor
- type ReserveContributors
- type ReservesMemo
- 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
- func (tos *TxOutStore) AddTxOutItem(ctx sdk.Context, keeper Keeper, toi *TxOutItem, deductFee, asgard bool)
- func (tos *TxOutStore) ApplyBNBFees(ctx sdk.Context, keeper Keeper, toi *TxOutItem)
- func (tos *TxOutStore) CommitBlock(ctx sdk.Context)
- func (tos *TxOutStore) GetOutboundItems() []*TxOutItem
- func (tos *TxOutStore) NewBlock(height uint64)
- type TxType
- type ValidatorManager
- type ValidatorMeta
- type ValidatorRotationPolicy
- type VaultData
- type WithdrawMemo
- type Yggdrasil
- type YggdrasilFundMemo
- type YggdrasilReturnMemo
- type Yggdrasils
Constants ¶
const ( ModuleName = types.ModuleName RouterKey = types.RouterKey StoreKey = types.StoreKey DefaultCodespace = types.DefaultCodespace PoolEnabled = types.Enabled PoolBootstrap = types.Bootstrap PoolSuspended = types.Suspended EventSuccess = types.Success EventRefund = types.Refund // Admin config keys GSLKey = types.GSLKey StakerAmtIntervalKey = types.StakerAmtIntervalKey MaxWithdrawBasisPoints = types.MaxWithdrawBasisPoints MinValidatorBondKey = types.MinValidatorBondKey WhiteListGasAssetKey = types.WhiteListGasAssetKey PoolRefundGasKey = types.PoolRefundGasKey DefaultPoolStatus = types.DefaultPoolStatus NodeActive = types.Active NodeWhiteListed = types.WhiteListed NodeDisabled = types.Disabled NodeReady = types.Ready NodeStandby = types.Standby NodeUnknown = types.Unknown )
const ( EventTypeNewPoolAddress = `NewPoolAddress` EventTypeAbortPoolRotation = "AbortPoolRotation" )
const values used to emit events
const ( EventTypeNodeReady = `node_ready` EventTypeNextPoolPubKeyObserved = `next_pool_pubkey_observed` EventTypeNexePoolPubKeyConfirmed = `next_pool_pubkey_confirmed` EventTypeSignerAct = `signer_acked` )
const ( EventTypeValidatorManager = `validator_manager` EventTypeNominatedValidator = `validator_nominated` EventTypeQueuedValidator = `validator_queued` EventTypeValidatorActive = `validator_active` EventTypeValidatorStandby = `validator_standby` )
Variables ¶
var ( NewPool = types.NewPool NewVaultData = types.NewVaultData NewAdminConfig = types.NewAdminConfig NewMsgNoOp = types.NewMsgNoOp NewMsgAdd = types.NewMsgAdd NewMsgSetPoolData = types.NewMsgSetPoolData NewMsgSetStakeData = types.NewMsgSetStakeData NewMsgSetUnStake = types.NewMsgSetUnStake NewMsgSwap = types.NewMsgSwap NewMsgSetAdminConfig = types.NewMsgSetAdminConfig NewTxInVoter = types.NewTxInVoter NewTxOut = types.NewTxOut NewEvent = types.NewEvent NewEventPool = types.NewEventPool NewEventAdd = types.NewEventAdd NewEventAdminConfig = types.NewEventAdminConfig 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 NewYggdrasil = types.NewYggdrasil NewReserveContributor = types.NewReserveContributor NewMsgYggdrasil = types.NewMsgYggdrasil NewMsgReserveContributor = types.NewMsgReserveContributor NewMsgBond = types.NewMsgBond NewPoolAddresses = types.NewPoolAddresses NewMsgNextPoolAddress = types.NewMsgNextPoolAddress NewMsgLeave = types.NewMsgLeave GetPoolStatus = types.GetPoolStatus GetRandomTx = types.GetRandomTx GetRandomNodeAccount = types.GetRandomNodeAccount GetRandomBNBAddress = types.GetRandomBNBAddress GetRandomTxHash = types.GetRandomTxHash GetRandomBech32Addr = types.GetRandomBech32Addr GetRandomBech32ConsensusPubKey = types.GetRandomBech32ConsensusPubKey GetRandomPubKey = types.GetRandomPubKey GetRandomPubkeys = types.GetRandomPubKeys SetupConfigForTest = types.SetupConfigForTest EmptyPoolAddresses = types.EmptyPoolAddresses )
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 "thorchain" type messages.
func NewQuerier ¶
func NewQuerier(keeper Keeper, poolAddressMgr *PoolAddressManager, validatorMgr *ValidatorManager) sdk.Querier
NewQuerier is the module level router for state queries
func RefundBond ¶
func RefundBond(ctx sdk.Context, txID common.TxID, nodeAcc NodeAccount, keeper Keeper, txOut *TxOutStore)
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 int64 `json:"last_event_id"` PoolAddresses PoolAddresses `json:"pool_addresses"` }
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 thorchain Keeper
func (Keeper) AddIncompleteEvents ¶
AddIncompleteEvents append to incomplete events
func (Keeper) AddObservingAddresses ¶
func (k Keeper) AddObservingAddresses(ctx sdk.Context, inAddresses []sdk.AccAddress)
AddObservingAddresses - add a list of addresses that have been helpful in getting enough observations to process an inbound tx.
func (Keeper) AddToPoolIndex ¶
AddToPoolIndex will add the given asset 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) ClearObservingAddresses ¶
ClearObservingAddresses - clear all observing addresses
func (Keeper) CompleteEvents ¶
CompleteEvent
func (Keeper) EnableAPool ¶
Picks the most "deserving" pool (by most staked rune) to be enabled and enables it
func (Keeper) EnsureTrustAccountUnique ¶
func (Keeper) FindPubKeyOfAddress ¶
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) GetAdminConfigDefaultPoolStatus ¶
func (k Keeper) GetAdminConfigDefaultPoolStatus(ctx sdk.Context, addr sdk.AccAddress) PoolStatus
GetAdminConfigDefaultPoolStatus - get the config for Default Pool Status
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) 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) 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) GetAdminConfigWhiteListGasAsset ¶
GetAdminConfigWhiteListGasAsset
func (Keeper) GetCompleteEventIterator ¶
GetCompleteEventIterator iterate complete events
func (Keeper) GetCompletedEvent ¶
GetCompletedEvent retrieve completed event
func (Keeper) GetIncompleteEvents ¶
GetIncompleteEvents retrieve incomplete events
func (Keeper) GetLastChainHeight ¶
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) GetNodeAccountByPubKey ¶
GetNodeAccountByPubKey try to get node account with the given pubkey from db
func (Keeper) GetNodeAccountIterator ¶
GetTrustAccountIterator iterate trust accounts
func (Keeper) GetObservingAddresses ¶
func (k Keeper) GetObservingAddresses(ctx sdk.Context) []sdk.AccAddress
GetObservingAddresses - get list of observed addresses. This is a list of addresses that have recently contributed via observing a tx that got 2/3rds majority
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) GetReservesContributors ¶
func (k Keeper) GetReservesContributors(ctx sdk.Context) ReserveContributors
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) GetVaultData ¶
////////////////////// Vault Data //////////////////////////
func (Keeper) GetYggdrasil ¶
func (Keeper) GetYggdrasilIterator ¶
GetYggdrasilIterator only iterate yggdrasil pools
func (Keeper) HasValidYggdrasilPools ¶
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 asset 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) SetLastChainHeight ¶
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) SetReserveContributors ¶
func (k Keeper) SetReserveContributors(ctx sdk.Context, contribs ReserveContributors)
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 ¶
SetTxInVoter - save a txin voter object
func (Keeper) SetValidatorMeta ¶
func (k Keeper) SetValidatorMeta(ctx sdk.Context, meta ValidatorMeta)
func (Keeper) SlashNodeAccountBond ¶
Slash the bond of a node account NOTE: Should be careful not to slash too much, and have their Yggdrasil vault have more in funds than their bond. This could trigger them to have a untimely exit, stealing an amount of funds from stakers.
func (Keeper) SlashNodeAccountRewards ¶
func (k Keeper) SlashNodeAccountRewards(ctx sdk.Context, na *NodeAccount, pts int64)
Slash the rewards of a node account NOTE: if we slash their rewards so much, they may do an orderly exit and rotate out of the active vault, wait in line to rejoin later.
func (Keeper) SupportedChain ¶
func (Keeper) TotalActiveNodeAccount ¶
TotalActiveNodeAccount count the number of active node account
func (Keeper) TotalNodeAccounts ¶
TotalNodeAccounts counts the number of trust accounts
func (Keeper) UpdateVaultData ¶
Update the vault data to reflect changing in this block
type Memo ¶
type MemoBase ¶
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) GetAdminConfigDefaultPoolStatus ¶
func (p *MockInMemoryPoolStorage) GetAdminConfigDefaultPoolStatus(ctx sdk.Context, addr sdk.AccAddress) PoolStatus
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) int64
func (*MockInMemoryPoolStorage) GetPoolStaker ¶
func (p *MockInMemoryPoolStorage) GetPoolStaker(ctx sdk.Context, asset common.Asset) (PoolStaker, error)
func (*MockInMemoryPoolStorage) GetStakerPool ¶
func (p *MockInMemoryPoolStorage) GetStakerPool(ctx sdk.Context, stakerID common.Address) (StakerPool, error)
func (*MockInMemoryPoolStorage) SetCompletedEvent ¶
func (p *MockInMemoryPoolStorage) SetCompletedEvent(ctx sdk.Context, event Event)
func (*MockInMemoryPoolStorage) SetPool ¶
func (p *MockInMemoryPoolStorage) SetPool(ctx sdk.Context, ps Pool)
func (*MockInMemoryPoolStorage) SetPoolStaker ¶
func (p *MockInMemoryPoolStorage) SetPoolStaker(ctx sdk.Context, asset common.Asset, 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 MsgReserveContributor ¶
type MsgReserveContributor = types.MsgReserveContributor
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 MsgYggdrasil ¶
type MsgYggdrasil = types.MsgYggdrasil
type NextPoolMemo ¶
func (NextPoolMemo) GetNextPoolAddress ¶
func (m NextPoolMemo) GetNextPoolAddress() common.PubKey
type NodeAccount ¶
type NodeAccount = types.NodeAccount
type NodeAccounts ¶
type NodeAccounts = types.NodeAccounts
type NodeAccountsBySlashingPoint ¶
type NodeAccountsBySlashingPoint = types.NodeAccountsBySlashingPoint
type NodeStatus ¶
type NodeStatus = types.NodeStatus
type OutboundMemo ¶
func NewOutboundMemo ¶
func NewOutboundMemo(txID common.TxID) OutboundMemo
func (OutboundMemo) GetTxID ¶
func (m OutboundMemo) GetTxID() common.TxID
func (OutboundMemo) String ¶
func (m OutboundMemo) String() string
type PoolAddressManager ¶
type PoolAddressManager struct { ObservedNextPoolAddrPubKey common.PoolPubKeys IsRotateWindowOpen bool // 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)
BeginBlock should be called when BeginBlock
func (*PoolAddressManager) EndBlock ¶
func (pm *PoolAddressManager) EndBlock(ctx sdk.Context, store *TxOutStore)
EndBlock contains some actions we need to take when block commit
func (*PoolAddressManager) GetCurrentPoolAddresses ¶
func (pm *PoolAddressManager) GetCurrentPoolAddresses() *PoolAddresses
GetCurrentPoolAddresses return current pool addresses
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 ReserveContributor ¶
type ReserveContributor = types.ReserveContributor
type ReserveContributors ¶
type ReserveContributors = types.ReserveContributors
type ReservesMemo ¶
type ReservesMemo struct {
MemoBase
}
type StakeMemo ¶
func (StakeMemo) GetDestination ¶
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, poolAddrMgr *PoolAddressManager) *TxOutStore
NewTxOutStore will create a new instance of TxOutStore.
func (*TxOutStore) AddTxOutItem ¶
func (tos *TxOutStore) AddTxOutItem(ctx sdk.Context, keeper Keeper, toi *TxOutItem, deductFee, asgard bool)
AddTxOutItem add an item to internal structure
func (*TxOutStore) ApplyBNBFees ¶
func (tos *TxOutStore) ApplyBNBFees(ctx sdk.Context, keeper Keeper, toi *TxOutItem)
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) GetOutboundItems ¶
func (tos *TxOutStore) GetOutboundItems() []*TxOutItem
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, poolAddrMgr *PoolAddressManager) *ValidatorManager
NewValidatorManager create a new instance of ValidatorManager
func (*ValidatorManager) BeginBlock ¶
func (vm *ValidatorManager) BeginBlock(ctx sdk.Context)
BeginBlock when block begin
func (*ValidatorManager) EndBlock ¶
func (vm *ValidatorManager) EndBlock(ctx sdk.Context, store *TxOutStore) []abci.ValidatorUpdate
EndBlock when block end
type ValidatorMeta ¶
type ValidatorMeta = types.ValidatorMeta
type ValidatorRotationPolicy ¶
type ValidatorRotationPolicy struct { RotateInNumBeforeFull int64 RotateOutNumBeforeFull int64 RotateNumAfterFull int64 RotatePerBlockHeight int64 ValidatorChangeWindow int64 DesireValidatorSet int64 LeaveProcessPerBlockHeight int64 }
ValidatorRotationPolicy store all the relevant parameters we need to perform validator rotation
func GetValidatorRotationPolicy ¶
func GetValidatorRotationPolicy(ctx sdk.Context, k Keeper) ValidatorRotationPolicy
GetValidatorRotationPolicy from data store
func (ValidatorRotationPolicy) IsValid ¶
func (vp ValidatorRotationPolicy) IsValid() error
type WithdrawMemo ¶
func (WithdrawMemo) GetAmount ¶
func (m WithdrawMemo) GetAmount() string
Transaction Specific Functions
type YggdrasilFundMemo ¶
type YggdrasilFundMemo struct {
MemoBase
}
type YggdrasilReturnMemo ¶
type YggdrasilReturnMemo struct {
MemoBase
}
type Yggdrasils ¶
type Yggdrasils = types.Yggdrasils
Source Files ¶
- alias.go
- event.go
- genesis.go
- handler.go
- keeper.go
- keeper_admin_config.go
- memo.go
- mock_in_memory_pool_storage.go
- mock_txout_setter.go
- module.go
- pool_address_manager.go
- pool_storage.go
- querier.go
- slashing.go
- stake.go
- statechain_events.go
- swap.go
- txout_store.go
- unstake.go
- validator_manager.go
- validator_rotation_policy.go
- vault_data.go
- versioning.go
- yggdrasil.go