thorchain

package
v1.137.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 73 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName             = types.ModuleName
	ReserveName            = types.ReserveName
	AsgardName             = types.AsgardName
	BondName               = types.BondName
	LendingName            = types.LendingName
	AffiliateCollectorName = types.AffiliateCollectorName
	TreasuryName           = types.TreasuryName
	RUNEPoolName           = types.RUNEPoolName
	RouterKey              = types.RouterKey
	StoreKey               = types.StoreKey
	DefaultCodespace       = types.DefaultCodespace

	// pool status
	PoolAvailable = types.PoolStatus_Available
	PoolStaged    = types.PoolStatus_Staged
	PoolSuspended = types.PoolStatus_Suspended

	// Admin config keys
	MaxWithdrawBasisPoints = types.MaxWithdrawBasisPoints

	// Vaults
	AsgardVault   = types.VaultType_AsgardVault
	UnknownVault  = types.VaultType_UnknownVault
	ActiveVault   = types.VaultStatus_ActiveVault
	InactiveVault = types.VaultStatus_InactiveVault
	RetiringVault = types.VaultStatus_RetiringVault
	InitVault     = types.VaultStatus_InitVault

	// Node status
	NodeActive      = types.NodeStatus_Active
	NodeWhiteListed = types.NodeStatus_Whitelisted
	NodeDisabled    = types.NodeStatus_Disabled
	NodeReady       = types.NodeStatus_Ready
	NodeStandby     = types.NodeStatus_Standby
	NodeUnknown     = types.NodeStatus_Unknown

	// Node type
	NodeTypeUnknown   = types.NodeType_TypeUnknown
	NodeTypeValidator = types.NodeType_TypeValidator
	NodeTypeVault     = types.NodeType_TypeVault

	// Bond type
	BondPaid     = types.BondType_bond_paid
	BondReturned = types.BondType_bond_returned
	BondCost     = types.BondType_bond_cost
	BondReward   = types.BondType_bond_reward
	AsgardKeygen = types.KeygenType_AsgardKeygen

	// Bond type
	AddPendingLiquidity      = types.PendingLiquidityType_add
	WithdrawPendingLiquidity = types.PendingLiquidityType_withdraw

	// Order Type
	MarketOrder = types.OrderType_market
	LimitOrder  = types.OrderType_limit

	// Mint/Burn type
	MintSupplyType = types.MintBurnSupplyType_mint
	BurnSupplyType = types.MintBurnSupplyType_burn

	// Memos
	TxSwap          = mem.TxSwap
	TxLimitOrder    = mem.TxLimitOrder
	TxAdd           = mem.TxAdd
	TxBond          = mem.TxBond
	TxMigrate       = mem.TxMigrate
	TxRagnarok      = mem.TxRagnarok
	TxReserve       = mem.TxReserve
	TxOutbound      = mem.TxOutbound
	TxRefund        = mem.TxRefund
	TxUnBond        = mem.TxUnbond
	TxLeave         = mem.TxLeave
	TxWithdraw      = mem.TxWithdraw
	TxTHORName      = mem.TxTHORName
	TxLoanOpen      = mem.TxLoanOpen
	TxLoanRepayment = mem.TxLoanRepayment
)
View Source
const (
	// CodeBadVersion error code for bad version
	CodeInternalError     uint32 = 99
	CodeTxFail            uint32 = 100
	CodeBadVersion        uint32 = 101
	CodeInvalidMessage    uint32 = 102
	CodeInvalidVault      uint32 = 104
	CodeInvalidMemo       uint32 = 105
	CodeInvalidPoolStatus uint32 = 107

	CodeSwapFail                 uint32 = 108
	CodeSwapFailNotEnoughFee     uint32 = 110
	CodeSwapFailInvalidAmount    uint32 = 113
	CodeSwapFailInvalidBalance   uint32 = 114
	CodeSwapFailNotEnoughBalance uint32 = 115

	CodeAddLiquidityFailValidation   uint32 = 120
	CodeFailGetLiquidityProvider     uint32 = 122
	CodeAddLiquidityMismatchAddr     uint32 = 123
	CodeLiquidityInvalidPoolAsset    uint32 = 124
	CodeAddLiquidityRUNEOverLimit    uint32 = 125
	CodeAddLiquidityRUNEMoreThanBond uint32 = 126

	CodeWithdrawFailValidation uint32 = 130
	CodeFailAddOutboundTx      uint32 = 131
	CodeFailSaveEvent          uint32 = 132
	CodeNoLiquidityUnitLeft    uint32 = 135
	CodeWithdrawWithin24Hours  uint32 = 136
	CodeWithdrawFail           uint32 = 137
	CodeEmptyChain             uint32 = 138
	CodeWithdrawLockup         uint32 = 139
)

THORChain error code start at 99

View Source
const (
	EventTypeActiveVault   = "ActiveVault"
	EventTypeInactiveVault = "InactiveVault"
)

const values used to emit events

View Source
const (
	MimirRecallFund      = `MimirRecallFund`
	MimirUpgradeContract = `MimirUpgradeContract`

	MimirRecallFundTemplate      = `MimirRecallFund%s`
	MimirUpgradeContractTemplate = `MimirUpgradeContract%s`
)

Variables

View Source
var (
	NewPool                        = types.NewPool
	NewNetwork                     = types.NewNetwork
	NewProtocolOwnedLiquidity      = types.NewProtocolOwnedLiquidity
	NewRUNEPool                    = types.NewRUNEPool
	NewObservedTx                  = types.NewObservedTx
	NewTssVoter                    = types.NewTssVoter
	NewBanVoter                    = types.NewBanVoter
	NewErrataTxVoter               = types.NewErrataTxVoter
	NewObservedTxVoter             = types.NewObservedTxVoter
	NewMsgRunePoolDeposit          = types.NewMsgRunePoolDeposit
	NewMsgRunePoolWithdraw         = types.NewMsgRunePoolWithdraw
	NewMsgTradeAccountDeposit      = types.NewMsgTradeAccountDeposit
	NewMsgTradeAccountWithdrawal   = types.NewMsgTradeAccountWithdrawal
	NewMsgLoanOpen                 = types.NewMsgLoanOpen
	NewMsgLoanRepayment            = types.NewMsgLoanRepayment
	NewMsgMimir                    = types.NewMsgMimir
	NewMsgNodePauseChain           = types.NewMsgNodePauseChain
	NewMsgDeposit                  = types.NewMsgDeposit
	NewMsgTssPool                  = types.NewMsgTssPool
	NewMsgTssKeysignFail           = types.NewMsgTssKeysignFail
	NewMsgObservedTxIn             = types.NewMsgObservedTxIn
	NewMsgObservedTxOut            = types.NewMsgObservedTxOut
	NewMsgNoOp                     = types.NewMsgNoOp
	NewMsgConsolidate              = types.NewMsgConsolidate
	NewMsgDonate                   = types.NewMsgDonate
	NewMsgAddLiquidity             = types.NewMsgAddLiquidity
	NewMsgWithdrawLiquidity        = types.NewMsgWithdrawLiquidity
	NewMsgSwap                     = types.NewMsgSwap
	NewKeygen                      = types.NewKeygen
	NewKeygenBlock                 = types.NewKeygenBlock
	NewMsgSetNodeKeys              = types.NewMsgSetNodeKeys
	NewMsgManageTHORName           = types.NewMsgManageTHORName
	NewTxOut                       = types.NewTxOut
	NewEventRewards                = types.NewEventRewards
	NewEventPool                   = types.NewEventPool
	NewEventDonate                 = types.NewEventDonate
	NewEventSwap                   = types.NewEventSwap
	NewEventStreamingSwap          = types.NewEventStreamingSwap
	NewEventLimitOrder             = types.NewEventLimitOrder
	NewEventAddLiquidity           = types.NewEventAddLiquidity
	NewEventWithdraw               = types.NewEventWithdraw
	NewEventRefund                 = types.NewEventRefund
	NewEventBond                   = types.NewEventBond
	NewEventGas                    = types.NewEventGas
	NewEventScheduledOutbound      = types.NewEventScheduledOutbound
	NewEventSecurity               = types.NewEventSecurity
	NewEventSlash                  = types.NewEventSlash
	NewEventSlashPoint             = types.NewEventSlashPoint
	NewEventReserve                = types.NewEventReserve
	NewEventErrata                 = types.NewEventErrata
	NewEventFee                    = types.NewEventFee
	NewEventOutbound               = types.NewEventOutbound
	NewEventSetMimir               = types.NewEventSetMimir
	NewEventSetNodeMimir           = types.NewEventSetNodeMimir
	NewEventTssKeygenSuccess       = types.NewEventTssKeygenSuccess
	NewEventTssKeygenFailure       = types.NewEventTssKeygenFailure
	NewEventTssKeygenMetric        = types.NewEventTssKeygenMetric
	NewEventTssKeysignMetric       = types.NewEventTssKeysignMetric
	NewEventPoolBalanceChanged     = types.NewEventPoolBalanceChanged
	NewEventPendingLiquidity       = types.NewEventPendingLiquidity
	NewEventTHORName               = types.NewEventTHORName
	NewEventMintBurn               = types.NewEventMintBurn
	NewEventVersion                = types.NewEventVersion
	NewEventTradeAccountDeposit    = types.NewEventTradeAccountDeposit
	NewEventTradeAccountWithdraw   = types.NewEventTradeAccountWithdraw
	NewEventRUNEPoolDeposit        = types.NewEventRUNEPoolDeposit
	NewEventRUNEPoolWithdraw       = types.NewEventRUNEPoolWithdraw
	NewEventLoanOpen               = types.NewEventLoanOpen
	NewEventLoanRepayment          = types.NewEventLoanRepayment
	NewPoolMod                     = types.NewPoolMod
	NewMsgRefundTx                 = types.NewMsgRefundTx
	NewMsgOutboundTx               = types.NewMsgOutboundTx
	NewMsgMigrate                  = types.NewMsgMigrate
	NewMsgRagnarok                 = types.NewMsgRagnarok
	ModuleCdc                      = types.ModuleCdc
	RegisterCodec                  = types.RegisterCodec
	RegisterInterfaces             = types.RegisterInterfaces
	NewBondProviders               = types.NewBondProviders
	NewBondProvider                = types.NewBondProvider
	NewNodeAccount                 = types.NewNodeAccount
	NewVault                       = types.NewVault
	NewReserveContributor          = types.NewReserveContributor
	NewMsgReserveContributor       = types.NewMsgReserveContributor
	NewMsgBond                     = types.NewMsgBond
	NewMsgUnBond                   = types.NewMsgUnBond
	NewMsgErrataTx                 = types.NewMsgErrataTx
	NewMsgBan                      = types.NewMsgBan
	NewMsgLeave                    = types.NewMsgLeave
	NewMsgSetVersion               = types.NewMsgSetVersion
	NewMsgProposeUpgrade           = types.NewMsgProposeUpgrade
	NewMsgApproveUpgrade           = types.NewMsgApproveUpgrade
	NewMsgRejectUpgrade            = types.NewMsgRejectUpgrade
	NewMsgSetIPAddress             = types.NewMsgSetIPAddress
	NewMsgNetworkFee               = types.NewMsgNetworkFee
	NewNetworkFee                  = types.NewNetworkFee
	NewTHORName                    = types.NewTHORName
	NewLoan                        = types.NewLoan
	NewStreamingSwap               = types.NewStreamingSwap
	GetPoolStatus                  = types.GetPoolStatus
	GetRandomVault                 = types.GetRandomVault
	GetRandomTx                    = types.GetRandomTx
	GetRandomObservedTx            = types.GetRandomObservedTx
	GetRandomTxOutItem             = types.GetRandomTxOutItem
	GetRandomObservedTxVoter       = types.GetRandomObservedTxVoter
	GetRandomValidatorNode         = types.GetRandomValidatorNode
	GetRandomVaultNode             = types.GetRandomVaultNode
	GetRandomTHORAddress           = types.GetRandomTHORAddress
	GetRandomRUNEAddress           = types.GetRandomRUNEAddress
	GetRandomETHAddress            = types.GetRandomETHAddress
	GetRandomGAIAAddress           = types.GetRandomGAIAAddress
	GetRandomBTCAddress            = types.GetRandomBTCAddress
	GetRandomLTCAddress            = types.GetRandomLTCAddress
	GetRandomDOGEAddress           = types.GetRandomDOGEAddress
	GetRandomTxHash                = types.GetRandomTxHash
	GetRandomBech32Addr            = types.GetRandomBech32Addr
	GetRandomBech32ConsensusPubKey = types.GetRandomBech32ConsensusPubKey
	GetRandomPubKey                = types.GetRandomPubKey
	GetRandomPubKeySet             = types.GetRandomPubKeySet
	GetCurrentVersion              = types.GetCurrentVersion
	SetupConfigForTest             = types.SetupConfigForTest
	HasSimpleMajority              = types.HasSimpleMajority
	HasSuperMajority               = types.HasSuperMajority
	HasMinority                    = types.HasMinority
	DefaultGenesis                 = types.DefaultGenesis
	NewSolvencyVoter               = types.NewSolvencyVoter
	NewMsgSolvency                 = types.NewMsgSolvency
	NewSwapperClout                = types.NewSwapperClout

	// Memo
	ParseMemo              = mem.ParseMemo
	ParseMemoWithTHORNames = mem.ParseMemoWithTHORNames
	FetchAddress           = mem.FetchAddress
	NewRefundMemo          = mem.NewRefundMemo
	NewOutboundMemo        = mem.NewOutboundMemo
	NewRagnarokMemo        = mem.NewRagnarokMemo
	NewMigrateMemo         = mem.NewMigrateMemo

	FetchDexAggregator         = aggregators.FetchDexAggregator
	FetchDexAggregatorGasLimit = aggregators.FetchDexAggregatorGasLimit
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ADMINS = []string{
	"thor1xghvhe4p50aqh5zq2t2vls938as0dkr2mzgpgh",
	"thor19pkncem64gajdwrd5kasspyj0t75hhkpqjn5qh",
}

ADMINS hard coded admin address

View Source
var ErrNotEnoughToPayFee = errors.New("not enough asset to pay for fees")

ErrNotEnoughToPayFee will happen when the emitted asset is not enough to pay for fee

View Source
var IsValidTHORName = regexp.MustCompile(`^[a-zA-Z0-9+_-]+$`).MatchString

Functions

func ActiveValidatorAnteHandler

func ActiveValidatorAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, signer cosmos.AccAddress) error

ActiveValidatorAnteHandler called by the ante handler to gate mempool entry and also during deliver to only active validator nodes. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func BanAnteHandler

func BanAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgBan) error

BanAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func DepositAnteHandler

func DepositAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgDeposit) error

DepositAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func ErrInternal

func ErrInternal(err error, msg string) error

ErrInternal return an error of errInternal with additional message

func ErrataTxAnteHandler

func ErrataTxAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgErrataTx) error

ErrataTxAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func GetKeeper

func GetKeeper(
	version semver.Version,
	cdc codec.BinaryCodec,
	coinKeeper bankkeeper.Keeper,
	accountKeeper authkeeper.AccountKeeper,
	upgradeKeeper upgradekeeper.Keeper,
	storeKey cosmos.StoreKey,
) (keeper.Keeper, error)

GetKeeper return Keeper

func IPAddressAnteHandler

func IPAddressAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgSetIPAddress) error

IPAddressAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func InitGenesis

func InitGenesis(ctx cosmos.Context, keeper keeper.Keeper, data GenesisState) []abci.ValidatorUpdate

func IsModuleAccAddress

func IsModuleAccAddress(keeper keeper.Keeper, accAddr cosmos.AccAddress) bool

func MimirAnteHandler

func MimirAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgMimir) error

MimirAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func MsgSendHandleV116

func MsgSendHandleV116(ctx cosmos.Context, mgr Manager, msg *MsgSend) (*cosmos.Result, error)

func MsgSendLogger

func MsgSendLogger(ctx cosmos.Context, msg *MsgSend)

func MsgSendValidateV130

func MsgSendValidateV130(ctx cosmos.Context, mgr Manager, msg *MsgSend) error

func MsgTssPoolHandleV134

func MsgTssPoolHandleV134(ctx cosmos.Context, mgr Manager, msg *MsgTssPool) (*cosmos.Result, error)

func MsgTssPoolHandleV137

func MsgTssPoolHandleV137(ctx cosmos.Context, mgr Manager, msg *MsgTssPool) (*cosmos.Result, error)

func MsgTssPoolLogger

func MsgTssPoolLogger(ctx cosmos.Context, msg *MsgTssPool)

func MsgTssPoolValidateV124

func MsgTssPoolValidateV124(ctx cosmos.Context, mgr Manager, msg *MsgTssPool) error

func MsgTssPoolValidateV137

func MsgTssPoolValidateV137(ctx cosmos.Context, mgr Manager, msg *MsgTssPool) error

func NetworkFeeAnteHandler

func NetworkFeeAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgNetworkFee) error

NetworkFeeAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func NewExternalHandler

func NewExternalHandler(mgr Manager) cosmos.Handler

NewExternalHandler returns a handler for "thorchain" type messages.

func NewInternalHandler

func NewInternalHandler(mgr Manager) cosmos.Handler

NewInternalHandler returns a handler for "thorchain" internal type messages.

func NewQuerier

func NewQuerier(mgr *Mgrs, kbs cosmos.KeybaseStore) cosmos.Querier

NewQuerier is the module level router for state queries

func NewSwapMemo

func NewSwapMemo(ctx cosmos.Context, mgr Manager, targetAsset common.Asset, destination common.Address, limit cosmos.Uint, affiliate string, affiliateBps cosmos.Uint) string

func NodePauseChainAnteHandler

func NodePauseChainAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgNodePauseChain) error

NodePauseChainAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func ObservedTxInAnteHandler

func ObservedTxInAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgObservedTxIn) error

ObservedTxInAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func ObservedTxOutAnteHandler

func ObservedTxOutAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgObservedTxOut) error

ObservedTxOutAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func SendAnteHandler

func SendAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgSend) error

SendAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func SetNodeKeysAnteHandler

func SetNodeKeysAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgSetNodeKeys) error

SetNodeKeysAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func SolvencyAnteHandler

func SolvencyAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgSolvency) error

SolvencyAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func TssAnteHandler

func TssAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgTssPool) error

TssAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func TssKeysignFailAnteHandler

func TssKeysignFailAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgTssKeysignFail) error

TssKeysignAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validate genesis is valid or not

func VersionAnteHandler

func VersionAnteHandler(ctx cosmos.Context, v semver.Version, k keeper.Keeper, msg MsgSetVersion) error

VersionAnteHandler called by the ante handler to gate mempool entry and also during deliver. Store changes will persist if this function succeeds, regardless of the success of the transaction.

Types

type AddLiquidityHandler

type AddLiquidityHandler struct {
	// contains filtered or unexported fields
}

AddLiquidityHandler is to handle add liquidity

func NewAddLiquidityHandler

func NewAddLiquidityHandler(mgr Manager) AddLiquidityHandler

NewAddLiquidityHandler create a new instance of AddLiquidityHandler

func (AddLiquidityHandler) Run

Run execute the handler

type AddLiquidityMemo

type AddLiquidityMemo = mem.AddLiquidityMemo

type AffiliateFeeCollector

type AffiliateFeeCollector = types.AffiliateFeeCollector

type AnteDecorator

type AnteDecorator struct {
	// contains filtered or unexported fields
}

func NewAnteDecorator

func NewAnteDecorator(keeper keeper.Keeper) AnteDecorator

func (AnteDecorator) AnteHandle

func (ad AnteDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements an application module for the thorchain module.

func NewAppModule

func NewAppModule(
	k keeper.Keeper,
	cdc codec.Codec,
	coinKeeper bankkeeper.Keeper,
	accountKeeper authkeeper.AccountKeeper,
	upgradeKeeper upgradekeeper.Keeper,
	storeKey cosmos.StoreKey,
	telemetryEnabled bool,
) AppModule

NewAppModule creates a new AppModule Object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)

BeginBlock called when a block get proposed

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

func (AppModule) EndBlock

func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate

EndBlock called when a block get committed

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis export genesis

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate

InitGenesis initialise genesis

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

LegacyQuerierHandler returns the capability module's Querier.

func (AppModule) Name

func (AppModule) Name() string

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers module services.

func (AppModule) Route

func (am AppModule) Route() cosmos.Route

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic app module Basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns default genesis state as raw bytes for the module.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name return the module's name

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the mint module. thornode current doesn't have grpc endpoint yet

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the module's types for the given codec.

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx client.Context, rtr *mux.Router)

RegisterRESTRoutes register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error

ValidateGenesis check of the Genesis

type ApproveUpgradeHandler

type ApproveUpgradeHandler struct {
	// contains filtered or unexported fields
}

ApproveUpgradeHandler is to handle the ApproveUpgrade message

func NewApproveUpgradeHandler

func NewApproveUpgradeHandler(mgr Manager) ApproveUpgradeHandler

NewApproveUpgradeHandler create new instance of ApproveUpgradeHandler

func (ApproveUpgradeHandler) Run

Run it the main entry point to execute Version logic

type BanHandler

type BanHandler struct {
	// contains filtered or unexported fields
}

BanHandler is to handle Ban message

func NewBanHandler

func NewBanHandler(mgr Manager) BanHandler

NewBanHandler create new instance of BanHandler

func (BanHandler) Run

func (h BanHandler) Run(ctx cosmos.Context, m cosmos.Msg) (*cosmos.Result, error)

Run is the main entry point to execute Ban logic

type BanVoter

type BanVoter = types.BanVoter

type BaseHandler

type BaseHandler[M cosmos.Msg] struct {
	TypedHandler[M]
	// contains filtered or unexported fields
}

func NewSendHandler

func NewSendHandler(mgr Manager) BaseHandler[*MsgSend]

NewSendHandler create a new instance of SendHandler

func NewTssHandler

func NewTssHandler(mgr Manager) BaseHandler[*MsgTssPool]

NewTssHandler create a new handler to process MsgTssPool

func (BaseHandler[M]) Run

func (h BaseHandler[M]) Run(ctx cosmos.Context, m cosmos.Msg) (*cosmos.Result, error)

type Blame

type Blame = types.Blame

type BondHandler

type BondHandler struct {
	// contains filtered or unexported fields
}

BondHandler a handler to process bond

func NewBondHandler

func NewBondHandler(mgr Manager) BondHandler

NewBondHandler create new BondHandler

func (BondHandler) Run

func (h BondHandler) Run(ctx cosmos.Context, m cosmos.Msg) (*cosmos.Result, error)

Run execute the handler

type BondMemo

type BondMemo = mem.BondMemo

type BondProvider

type BondProvider = types.BondProvider

type BondProviders

type BondProviders = types.BondProviders

type ChainContract

type ChainContract = types.ChainContract

type CommonOutboundTxHandler

type CommonOutboundTxHandler struct {
	// contains filtered or unexported fields
}

CommonOutboundTxHandler is the place where those common logic can be shared between multiple different kind of outbound tx handler at the moment, handler_refund, and handler_outbound_tx are largely the same , only some small difference

func NewCommonOutboundTxHandler

func NewCommonOutboundTxHandler(mgr Manager) CommonOutboundTxHandler

NewCommonOutboundTxHandler create a new instance of the CommonOutboundTxHandler

type ConsolidateHandler

type ConsolidateHandler struct {
	// contains filtered or unexported fields
}

ConsolidateHandler handles transactions the network sends to itself, to consolidate UTXOs

func NewConsolidateHandler

func NewConsolidateHandler(mgr Manager) ConsolidateHandler

NewConsolidateHandler create a new instance of the ConsolidateHandler

func (ConsolidateHandler) Run

type ConsolidateMemo

type ConsolidateMemo = mem.ConsolidateMemo

type DepositHandler

type DepositHandler struct {
	// contains filtered or unexported fields
}

DepositHandler is to process native messages on THORChain

func NewDepositHandler

func NewDepositHandler(mgr Manager) DepositHandler

NewDepositHandler create a new instance of DepositHandler

func (DepositHandler) Run

Run is the main entry of DepositHandler

type DonateHandler

type DonateHandler struct {
	// contains filtered or unexported fields
}

DonateHandler is to handle donate message

func NewDonateHandler

func NewDonateHandler(mgr Manager) DonateHandler

NewDonateHandler create a new instance of DonateHandler

func (DonateHandler) Run

Run is the main entry point to execute donate logic

type DonateMemo

type DonateMemo = mem.DonateMemo

type DroppedSwapOutTx

type DroppedSwapOutTx struct {
	// contains filtered or unexported fields
}

type EmitEventItem

type EmitEventItem interface {
	Events() (cosmos.Events, error)
}

EmitEventItem define the method all event need to implement

type ErrataTxHandler

type ErrataTxHandler struct {
	// contains filtered or unexported fields
}

ErrataTxHandler is to handle ErrataTx message

func NewErrataTxHandler

func NewErrataTxHandler(mgr Manager) ErrataTxHandler

NewErrataTxHandler create new instance of ErrataTxHandler

func (ErrataTxHandler) Run

Run is the main entry point to execute ErrataTx logic

type ErrataTxVoter

type ErrataTxVoter = types.ErrataTxVoter

type EventAddLiquidity

type EventAddLiquidity = types.EventAddLiquidity

type EventBond

type EventBond = types.EventBond

type EventDonate

type EventDonate = types.EventDonate

type EventErrata

type EventErrata = types.EventErrata

type EventFee

type EventFee = types.EventFee

type EventGas

type EventGas = types.EventGas

type EventLoanOpen

type EventLoanOpen = types.EventLoanOpen

type EventLoanRepayment

type EventLoanRepayment = types.EventLoanRepayment

type EventManager

type EventManager interface {
	EmitEvent(ctx cosmos.Context, evt EmitEventItem) error
	EmitGasEvent(ctx cosmos.Context, gasEvent *EventGas) error
	EmitSwapEvent(ctx cosmos.Context, swap *EventSwap) error
	EmitFeeEvent(ctx cosmos.Context, feeEvent *EventFee) error
}

EventManager define methods need to be support to manage events

func GetEventManager

func GetEventManager(version semver.Version) (EventManager, error)

GetEventManager will return an implementation of EventManager

type EventMgrVCUR

type EventMgrVCUR struct{}

EventMgrVCUR implement EventManager interface

func (*EventMgrVCUR) EmitEvent

func (m *EventMgrVCUR) EmitEvent(ctx cosmos.Context, evt EmitEventItem) error

EmitEvent to block

func (*EventMgrVCUR) EmitFeeEvent

func (m *EventMgrVCUR) EmitFeeEvent(ctx cosmos.Context, feeEvent *EventFee) error

EmitFeeEvent emit a fee event through event manager

func (*EventMgrVCUR) EmitGasEvent

func (m *EventMgrVCUR) EmitGasEvent(ctx cosmos.Context, gasEvent *EventGas) error

EmitGasEvent emit gas events

func (*EventMgrVCUR) EmitSwapEvent

func (m *EventMgrVCUR) EmitSwapEvent(ctx cosmos.Context, swap *EventSwap) error

EmitSwapEvent emit swap event to block

type EventOutbound

type EventOutbound = types.EventOutbound

type EventPool

type EventPool = types.EventPool

type EventRefund

type EventRefund = types.EventRefund

type EventReserve

type EventReserve = types.EventReserve

type EventRewards

type EventRewards = types.EventRewards

type EventSlash

type EventSlash = types.EventSlash

type EventSwap

type EventSwap = types.EventSwap

type EventWithdraw

type EventWithdraw = types.EventWithdraw

type GasManager

type GasManager interface {
	BeginBlock()
	EndBlock(ctx cosmos.Context, keeper keeper.Keeper, eventManager EventManager)
	AddGasAsset(outAsset common.Asset, gas common.Gas, increaseTxCount bool)
	ProcessGas(ctx cosmos.Context, keeper keeper.Keeper)
	GetGas() common.Gas
	GetAssetOutboundFee(ctx cosmos.Context, asset common.Asset, inRune bool) (cosmos.Uint, error)
	GetMaxGas(ctx cosmos.Context, chain common.Chain) (common.Coin, error)
	GetGasRate(ctx cosmos.Context, chain common.Chain) cosmos.Uint
	GetNetworkFee(ctx cosmos.Context, chain common.Chain) (types.NetworkFee, error)
	CalcOutboundFeeMultiplier(ctx cosmos.Context, targetSurplusRune, gasSpentRune, gasWithheldRune, maxMultiplier, minMultiplier cosmos.Uint) cosmos.Uint
}

GasManager define all the methods required to manage gas

func GetGasManager

func GetGasManager(version semver.Version, keeper keeper.Keeper) (GasManager, error)

GetGasManager return GasManager

type GasMgrVCUR

type GasMgrVCUR struct {
	// contains filtered or unexported fields
}

GasMgrVCUR implement GasManager interface which will store the gas related events happened in thorchain to memory emit GasEvent per block if there are any

func (*GasMgrVCUR) AddGasAsset

func (gm *GasMgrVCUR) AddGasAsset(outAsset common.Asset, gas common.Gas, increaseTxCount bool)

AddGasAsset for EndBlock's ProcessGas; add the outbound-Asset-associated Gas to the gas manager's outAssetGas, and optionally increment the gas manager's gasCount.

func (*GasMgrVCUR) BeginBlock

func (gm *GasMgrVCUR) BeginBlock()

BeginBlock need to be called when a new block get created , update the internal EventGas to new one

func (*GasMgrVCUR) CalcOutboundFeeMultiplier

func (gm *GasMgrVCUR) CalcOutboundFeeMultiplier(ctx cosmos.Context, targetSurplusRune, gasSpentRune, gasWithheldRune, maxMultiplier, minMultiplier cosmos.Uint) cosmos.Uint

CalcOutboundFeeMultiplier returns the current outbound fee multiplier based on current and target outbound fee surplus

func (*GasMgrVCUR) EndBlock

func (gm *GasMgrVCUR) EndBlock(ctx cosmos.Context, keeper keeper.Keeper, eventManager EventManager)

EndBlock emit the events

func (*GasMgrVCUR) GetAssetOutboundFee

func (gm *GasMgrVCUR) GetAssetOutboundFee(ctx cosmos.Context, asset common.Asset, inRune bool) (cosmos.Uint, error)

GetAssetOutboundFee returns current outbound fee for the asset. fee = chainBaseFee * assetDOFM (asset-specific Dynamic Outbound Fee Multiplier) - asset: the asset to calculate the fee for - inRune: whether the fee should be returned in RUNE. If false the fee is returned in asset units.

func (*GasMgrVCUR) GetGas

func (gm *GasMgrVCUR) GetGas() common.Gas

GetGas return gas

func (*GasMgrVCUR) GetGasRate

func (gm *GasMgrVCUR) GetGasRate(ctx cosmos.Context, chain common.Chain) cosmos.Uint

GetGasRate return the gas rate

func (*GasMgrVCUR) GetMaxGas

func (gm *GasMgrVCUR) GetMaxGas(ctx cosmos.Context, chain common.Chain) (common.Coin, error)

GetMaxGas will calculate the maximum gas fee a tx can use

func (*GasMgrVCUR) GetNetworkFee

func (gm *GasMgrVCUR) GetNetworkFee(ctx cosmos.Context, chain common.Chain) (types.NetworkFee, error)

func (*GasMgrVCUR) ProcessGas

func (gm *GasMgrVCUR) ProcessGas(ctx cosmos.Context, keeper keeper.Keeper)

ProcessGas to subsidise the gas asset pools with RUNE for the gas they have spent

type GasPool

type GasPool = types.GasPool

type GenesisState

type GenesisState struct {
	Pools                   []types.Pool                                                        `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools"`
	LiquidityProviders      gitlab_com_thorchain_thornode_x_thorchain_types.LiquidityProviders  `` /* 185-byte string literal not displayed */
	ObservedTxInVoters      gitlab_com_thorchain_thornode_x_thorchain_types.ObservedTxVoters    `` /* 187-byte string literal not displayed */
	ObservedTxOutVoters     gitlab_com_thorchain_thornode_x_thorchain_types.ObservedTxVoters    `` /* 190-byte string literal not displayed */
	TxOuts                  []types.TxOut                                                       `protobuf:"bytes,5,rep,name=tx_outs,json=txOuts,proto3" json:"tx_outs"`
	NodeAccounts            gitlab_com_thorchain_thornode_x_thorchain_types.NodeAccounts        `` /* 161-byte string literal not displayed */
	Vaults                  gitlab_com_thorchain_thornode_x_thorchain_types.Vaults              `protobuf:"bytes,7,rep,name=vaults,proto3,castrepeated=gitlab.com/thorchain/thornode/x/thorchain/types.Vaults" json:"vaults"`
	Reserve                 uint64                                                              `protobuf:"varint,8,opt,name=reserve,proto3" json:"reserve,omitempty"`
	LastSignedHeight        int64                                                               `protobuf:"varint,10,opt,name=last_signed_height,json=lastSignedHeight,proto3" json:"last_signed_height,omitempty"`
	LastChainHeights        []LastChainHeight                                                   `protobuf:"bytes,11,rep,name=last_chain_heights,json=lastChainHeights,proto3" json:"last_chain_heights"`
	ReserveContributors     gitlab_com_thorchain_thornode_x_thorchain_types.ReserveContributors `` /* 190-byte string literal not displayed */
	Network                 types.Network                                                       `protobuf:"bytes,13,opt,name=network,proto3" json:"network"`
	OrderbookItems          []types.MsgSwap                                                     `protobuf:"bytes,19,rep,name=orderbook_items,json=orderbookItems,proto3" json:"orderbook_items"`
	NetworkFees             []types.NetworkFee                                                  `protobuf:"bytes,20,rep,name=network_fees,json=networkFees,proto3" json:"network_fees"`
	ChainContracts          []types.ChainContract                                               `protobuf:"bytes,22,rep,name=chain_contracts,json=chainContracts,proto3" json:"chain_contracts"`
	THORNames               []types.THORName                                                    `protobuf:"bytes,23,rep,name=THORNames,proto3" json:"THORNames"`
	Mimirs                  []Mimir                                                             `protobuf:"bytes,24,rep,name=mimirs,proto3" json:"mimirs"`
	StoreVersion            int64                                                               `protobuf:"varint,25,opt,name=store_version,json=storeVersion,proto3" json:"store_version,omitempty"`
	BondProviders           []types.BondProviders                                               `protobuf:"bytes,26,rep,name=bond_providers,json=bondProviders,proto3" json:"bond_providers"`
	POL                     types.ProtocolOwnedLiquidity                                        `protobuf:"bytes,27,opt,name=POL,proto3" json:"POL"`
	Loans                   []types.Loan                                                        `protobuf:"bytes,28,rep,name=loans,proto3" json:"loans"`
	StreamingSwaps          []types.StreamingSwap                                               `protobuf:"bytes,29,rep,name=streaming_swaps,json=streamingSwaps,proto3" json:"streaming_swaps"`
	SwapQueueItems          []types.MsgSwap                                                     `protobuf:"bytes,30,rep,name=swap_queue_items,json=swapQueueItems,proto3" json:"swap_queue_items"`
	SwapperClout            []types.SwapperClout                                                `protobuf:"bytes,31,rep,name=swapper_clout,json=swapperClout,proto3" json:"swapper_clout"`
	TradeAccounts           []types.TradeAccount                                                `protobuf:"bytes,32,rep,name=trade_accounts,json=tradeAccounts,proto3" json:"trade_accounts"`
	TradeUnits              []types.TradeUnit                                                   `protobuf:"bytes,33,rep,name=trade_units,json=tradeUnits,proto3" json:"trade_units"`
	OutboundFeeWithheldRune gitlab_com_thorchain_thornode_common.Coins                          `` /* 181-byte string literal not displayed */
	OutboundFeeSpentRune    gitlab_com_thorchain_thornode_common.Coins                          `` /* 172-byte string literal not displayed */
	RuneProviders           []types.RUNEProvider                                                `protobuf:"bytes,36,rep,name=rune_providers,json=runeProviders,proto3" json:"rune_providers"`
	RunePool                types.RUNEPool                                                      `protobuf:"bytes,37,opt,name=rune_pool,json=runePool,proto3" json:"rune_pool"`
	NodeMimirs              []types.NodeMimir                                                   `protobuf:"bytes,38,rep,name=nodeMimirs,proto3" json:"nodeMimirs"`
	AffiliateCollectors     []types.AffiliateFeeCollector                                       `protobuf:"bytes,39,rep,name=affiliate_collectors,json=affiliateCollectors,proto3" json:"affiliate_collectors"`
	LoanTotalCollateral     gitlab_com_thorchain_thornode_common.Coins                          `` /* 167-byte string literal not displayed */
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState the default values THORNode put in the Genesis

func ExportGenesis

func ExportGenesis(ctx cosmos.Context, k keeper.Keeper) GenesisState

ExportGenesis export the data in Genesis

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetAffiliateCollectors

func (m *GenesisState) GetAffiliateCollectors() []types.AffiliateFeeCollector

func (*GenesisState) GetBondProviders

func (m *GenesisState) GetBondProviders() []types.BondProviders

func (*GenesisState) GetChainContracts

func (m *GenesisState) GetChainContracts() []types.ChainContract

func (*GenesisState) GetLastChainHeights

func (m *GenesisState) GetLastChainHeights() []LastChainHeight

func (*GenesisState) GetLastSignedHeight

func (m *GenesisState) GetLastSignedHeight() int64

func (*GenesisState) GetLoanTotalCollateral

func (m *GenesisState) GetLoanTotalCollateral() gitlab_com_thorchain_thornode_common.Coins

func (*GenesisState) GetLoans

func (m *GenesisState) GetLoans() []types.Loan

func (*GenesisState) GetMimirs

func (m *GenesisState) GetMimirs() []Mimir

func (*GenesisState) GetNetwork

func (m *GenesisState) GetNetwork() types.Network

func (*GenesisState) GetNetworkFees

func (m *GenesisState) GetNetworkFees() []types.NetworkFee

func (*GenesisState) GetNodeMimirs

func (m *GenesisState) GetNodeMimirs() []types.NodeMimir

func (*GenesisState) GetOrderbookItems

func (m *GenesisState) GetOrderbookItems() []types.MsgSwap

func (*GenesisState) GetOutboundFeeSpentRune

func (m *GenesisState) GetOutboundFeeSpentRune() gitlab_com_thorchain_thornode_common.Coins

func (*GenesisState) GetOutboundFeeWithheldRune

func (m *GenesisState) GetOutboundFeeWithheldRune() gitlab_com_thorchain_thornode_common.Coins

func (*GenesisState) GetPOL

func (*GenesisState) GetPools

func (m *GenesisState) GetPools() []types.Pool

func (*GenesisState) GetReserve

func (m *GenesisState) GetReserve() uint64

func (*GenesisState) GetRunePool

func (m *GenesisState) GetRunePool() types.RUNEPool

func (*GenesisState) GetRuneProviders

func (m *GenesisState) GetRuneProviders() []types.RUNEProvider

func (*GenesisState) GetStoreVersion

func (m *GenesisState) GetStoreVersion() int64

func (*GenesisState) GetStreamingSwaps

func (m *GenesisState) GetStreamingSwaps() []types.StreamingSwap

func (*GenesisState) GetSwapQueueItems

func (m *GenesisState) GetSwapQueueItems() []types.MsgSwap

func (*GenesisState) GetSwapperClout

func (m *GenesisState) GetSwapperClout() []types.SwapperClout

func (*GenesisState) GetTHORNames

func (m *GenesisState) GetTHORNames() []types.THORName

func (*GenesisState) GetTradeAccounts

func (m *GenesisState) GetTradeAccounts() []types.TradeAccount

func (*GenesisState) GetTradeUnits

func (m *GenesisState) GetTradeUnits() []types.TradeUnit

func (*GenesisState) GetTxOuts

func (m *GenesisState) GetTxOuts() []types.TxOut

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type IPAddressHandler

type IPAddressHandler struct {
	// contains filtered or unexported fields
}

IPAddressHandler is to handle ip address message

func NewIPAddressHandler

func NewIPAddressHandler(mgr Manager) IPAddressHandler

NewIPAddressHandler create new instance of IPAddressHandler

func (IPAddressHandler) Run

Run it the main entry point to execute ip address logic

type InfiniteGasDecorator

type InfiniteGasDecorator struct {
	// contains filtered or unexported fields
}

InfiniteGasDecorator uses an infinite gas meter to prevent out-of-gas panics and allow non-versioned changes to be made without breaking consensus, as long as the resulting state is consistent.

func NewInfiniteGasDecorator

func NewInfiniteGasDecorator(keeper keeper.Keeper) InfiniteGasDecorator

func (InfiniteGasDecorator) AnteHandle

func (d InfiniteGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

type Jail

type Jail = types.Jail

type Keygen

type Keygen = types.Keygen

type KeygenBlock

type KeygenBlock = types.KeygenBlock

type LadderDispatch

type LadderDispatch[F interface{}] struct {
	// contains filtered or unexported fields
}

func NewHandlers

func NewHandlers[M cosmos.Msg]() LadderDispatch[func(cosmos.Context, Manager, M) (*cosmos.Result, error)]

func NewValidators

func NewValidators[M cosmos.Msg]() LadderDispatch[func(cosmos.Context, Manager, M) error]

Sadly Go's type system is still primitive and does not allow for generics in type aliases, so the following cleaner convenience type does not work:

type Validators[M MsgType] = LadderDispatch[func(cosmos.Context, Manager, M) error]

See https://github.com/golang/go/issues/46477 for ongoing discussion.

Instead we use these thin convenience functions to do the same type wrapping:

func (LadderDispatch[F]) Get

func (l LadderDispatch[F]) Get(targetVersion semver.Version) F

Return the most recent handler that supports the target version.

func (LadderDispatch[F]) Register

func (l LadderDispatch[F]) Register(version string, handler F) LadderDispatch[F]

Register a handler for a specific version. Enforces descending order of registered versions.

type LastChainHeight

type LastChainHeight struct {
	Chain  string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"`
	Height int64  `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
}

func (*LastChainHeight) Descriptor

func (*LastChainHeight) Descriptor() ([]byte, []int)

func (*LastChainHeight) GetChain

func (m *LastChainHeight) GetChain() string

func (*LastChainHeight) GetHeight

func (m *LastChainHeight) GetHeight() int64

func (*LastChainHeight) Marshal

func (m *LastChainHeight) Marshal() (dAtA []byte, err error)

func (*LastChainHeight) MarshalTo

func (m *LastChainHeight) MarshalTo(dAtA []byte) (int, error)

func (*LastChainHeight) MarshalToSizedBuffer

func (m *LastChainHeight) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LastChainHeight) ProtoMessage

func (*LastChainHeight) ProtoMessage()

func (*LastChainHeight) Reset

func (m *LastChainHeight) Reset()

func (*LastChainHeight) Size

func (m *LastChainHeight) Size() (n int)

func (*LastChainHeight) String

func (m *LastChainHeight) String() string

func (*LastChainHeight) Unmarshal

func (m *LastChainHeight) Unmarshal(dAtA []byte) error

func (*LastChainHeight) XXX_DiscardUnknown

func (m *LastChainHeight) XXX_DiscardUnknown()

func (*LastChainHeight) XXX_Marshal

func (m *LastChainHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LastChainHeight) XXX_Merge

func (m *LastChainHeight) XXX_Merge(src proto.Message)

func (*LastChainHeight) XXX_Size

func (m *LastChainHeight) XXX_Size() int

func (*LastChainHeight) XXX_Unmarshal

func (m *LastChainHeight) XXX_Unmarshal(b []byte) error

type LeaveHandler

type LeaveHandler struct {
	// contains filtered or unexported fields
}

LeaveHandler a handler to process leave request if an operator of THORChain node would like to leave and get their bond back , they have to send a Leave request through THORChain

func NewLeaveHandler

func NewLeaveHandler(mgr Manager) LeaveHandler

NewLeaveHandler create a new LeaveHandler

func (LeaveHandler) Run

func (h LeaveHandler) Run(ctx cosmos.Context, m cosmos.Msg) (*cosmos.Result, error)

Run execute the handler

type LeaveMemo

type LeaveMemo = mem.LeaveMemo

type LiquidityProvider

type LiquidityProvider = types.LiquidityProvider

type LiquidityProviders

type LiquidityProviders = types.LiquidityProviders

type Loan

type Loan = types.Loan

type LoanOpenHandler

type LoanOpenHandler struct {
	// contains filtered or unexported fields
}

LoanOpenHandler a handler to process bond

func NewLoanOpenHandler

func NewLoanOpenHandler(mgr Manager) LoanOpenHandler

NewLoanOpenHandler create new LoanOpenHandler

func (LoanOpenHandler) GetLoanCollateralRemainingForPool

func (h LoanOpenHandler) GetLoanCollateralRemainingForPool(ctx cosmos.Context, pool Pool) (cosmos.Uint, error)

func (LoanOpenHandler) Run

Run execute the handler

type LoanOpenMemo

type LoanOpenMemo = mem.LoanOpenMemo

type LoanRepaymentHandler

type LoanRepaymentHandler struct {
	// contains filtered or unexported fields
}

LoanRepaymentHandler a handler to process bond

func NewLoanRepaymentHandler

func NewLoanRepaymentHandler(mgr Manager) LoanRepaymentHandler

NewLoanRepaymentHandler create new LoanRepaymentHandler

func (LoanRepaymentHandler) Run

Run execute the handler

type LoanRepaymentMemo

type LoanRepaymentMemo = mem.LoanRepaymentMemo

type Loans

type Loans = types.Loans

type ManageTHORNameHandler

type ManageTHORNameHandler struct {
	// contains filtered or unexported fields
}

ManageTHORNameHandler a handler to process MsgNetworkFee messages

func NewManageTHORNameHandler

func NewManageTHORNameHandler(mgr Manager) ManageTHORNameHandler

NewManageTHORNameHandler create a new instance of network fee handler

func (ManageTHORNameHandler) Run

Run is the main entry point for network fee logic

type ManageTHORNameMemo

type ManageTHORNameMemo = mem.ManageTHORNameMemo

type Manager

type Manager interface {
	GetConstants() constants.ConstantValues
	GetVersion() semver.Version
	Keeper() keeper.Keeper
	GasMgr() GasManager
	EventMgr() EventManager
	TxOutStore() TxOutStore
	NetworkMgr() NetworkManager
	ValidatorMgr() ValidatorManager
	ObMgr() ObserverManager
	PoolMgr() PoolManager
	SwapQ() SwapQueue
	OrderBookMgr() OrderBook
	Slasher() Slasher
	TradeAccountManager() TradeAccountManager
}

Manager is an interface to define all the required methods

type Mgrs

type Mgrs struct {
	K keeper.Keeper
	// contains filtered or unexported fields
}

Mgrs is an implementation of Manager interface

func NewManagers

func NewManagers(
	keeper keeper.Keeper,
	cdc codec.Codec,
	coinKeeper bankkeeper.Keeper,
	accountKeeper authkeeper.AccountKeeper,
	upgradeKeeper upgradekeeper.Keeper,
	storeKey cosmos.StoreKey,
) *Mgrs

NewManagers create a new Manager

func (*Mgrs) BeginBlock

func (mgr *Mgrs) BeginBlock(ctx cosmos.Context) error

BeginBlock detect whether there are new version available, if it is available then create a new version of Mgr

func (*Mgrs) EventMgr

func (mgr *Mgrs) EventMgr() EventManager

EventMgr return EventMgr

func (*Mgrs) GasMgr

func (mgr *Mgrs) GasMgr() GasManager

GasMgr return GasManager

func (*Mgrs) GetConstants

func (mgr *Mgrs) GetConstants() constants.ConstantValues

func (*Mgrs) GetVersion

func (mgr *Mgrs) GetVersion() semver.Version

func (*Mgrs) Keeper

func (mgr *Mgrs) Keeper() keeper.Keeper

Keeper return Keeper

func (*Mgrs) NetworkMgr

func (mgr *Mgrs) NetworkMgr() NetworkManager

VaultMgr return a valid NetworkManager

func (*Mgrs) ObMgr

func (mgr *Mgrs) ObMgr() ObserverManager

ObMgr return an implementation of ObserverManager

func (*Mgrs) OrderBookMgr

func (mgr *Mgrs) OrderBookMgr() OrderBook

OrderBookMgr

func (*Mgrs) PoolMgr

func (mgr *Mgrs) PoolMgr() PoolManager

PoolMgr return a valid PoolManager

func (*Mgrs) Slasher

func (mgr *Mgrs) Slasher() Slasher

Slasher return an implementation of Slasher

func (*Mgrs) SwapQ

func (mgr *Mgrs) SwapQ() SwapQueue

SwapQ return an implementation of SwapQueue

func (*Mgrs) TradeAccountManager

func (mgr *Mgrs) TradeAccountManager() TradeAccountManager

func (*Mgrs) TxOutStore

func (mgr *Mgrs) TxOutStore() TxOutStore

TxOutStore return an TxOutStore

func (*Mgrs) ValidatorMgr

func (mgr *Mgrs) ValidatorMgr() ValidatorManager

ValidatorMgr return an implementation of ValidatorManager

type MigrateHandler

type MigrateHandler struct {
	// contains filtered or unexported fields
}

MigrateHandler is a handler to process MsgMigrate

func NewMigrateHandler

func NewMigrateHandler(mgr Manager) MigrateHandler

NewMigrateHandler create a new instance of MigrateHandler

func (MigrateHandler) Run

Run is the main entry point of Migrate handler

type MigrateMemo

type MigrateMemo = mem.MigrateMemo

type Mimir

type Mimir struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*Mimir) Descriptor

func (*Mimir) Descriptor() ([]byte, []int)

func (*Mimir) GetKey

func (m *Mimir) GetKey() string

func (*Mimir) GetValue

func (m *Mimir) GetValue() int64

func (*Mimir) Marshal

func (m *Mimir) Marshal() (dAtA []byte, err error)

func (*Mimir) MarshalTo

func (m *Mimir) MarshalTo(dAtA []byte) (int, error)

func (*Mimir) MarshalToSizedBuffer

func (m *Mimir) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Mimir) ProtoMessage

func (*Mimir) ProtoMessage()

func (*Mimir) Reset

func (m *Mimir) Reset()

func (*Mimir) Size

func (m *Mimir) Size() (n int)

func (*Mimir) String

func (m *Mimir) String() string

func (*Mimir) Unmarshal

func (m *Mimir) Unmarshal(dAtA []byte) error

func (*Mimir) XXX_DiscardUnknown

func (m *Mimir) XXX_DiscardUnknown()

func (*Mimir) XXX_Marshal

func (m *Mimir) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Mimir) XXX_Merge

func (m *Mimir) XXX_Merge(src proto.Message)

func (*Mimir) XXX_Size

func (m *Mimir) XXX_Size() int

func (*Mimir) XXX_Unmarshal

func (m *Mimir) XXX_Unmarshal(b []byte) error

type MimirHandler

type MimirHandler struct {
	// contains filtered or unexported fields
}

MimirHandler is to handle admin messages

func NewMimirHandler

func NewMimirHandler(mgr Manager) MimirHandler

NewMimirHandler create new instance of MimirHandler

func (MimirHandler) Run

func (h MimirHandler) Run(ctx cosmos.Context, m cosmos.Msg) (*cosmos.Result, error)

Run is the main entry point to execute mimir logic

type ModuleBalanceAction

type ModuleBalanceAction struct {
	ModuleName     string
	RuneRecipient  string
	RuneToTransfer cosmos.Uint
	SynthsToBurn   common.Coins
}

send RuneToTransfer from ModuleName to RuneRecipient burn SynthsToBurn from ModuleName

type MsgAddLiquidity

type MsgAddLiquidity = types.MsgAddLiquidity

type MsgApproveUpgrade

type MsgApproveUpgrade = types.MsgApproveUpgrade

type MsgBan

type MsgBan = types.MsgBan

type MsgBond

type MsgBond = types.MsgBond

type MsgConsolidate

type MsgConsolidate = types.MsgConsolidate

type MsgDeposit

type MsgDeposit = types.MsgDeposit

type MsgDonate

type MsgDonate = types.MsgDonate

type MsgErrataTx

type MsgErrataTx = types.MsgErrataTx

type MsgHandler

type MsgHandler interface {
	Run(ctx cosmos.Context, msg cosmos.Msg) (*cosmos.Result, error)
}

MsgHandler is an interface expect all handler to implement

type MsgLeave

type MsgLeave = types.MsgLeave

type MsgLoanOpen

type MsgLoanOpen = types.MsgLoanOpen

type MsgLoanRepayment

type MsgLoanRepayment = types.MsgLoanRepayment

type MsgManageTHORName

type MsgManageTHORName = types.MsgManageTHORName

type MsgMigrate

type MsgMigrate = types.MsgMigrate

type MsgMimir

type MsgMimir = types.MsgMimir

type MsgNetworkFee

type MsgNetworkFee = types.MsgNetworkFee

type MsgNoOp

type MsgNoOp = types.MsgNoOp

type MsgNodePauseChain

type MsgNodePauseChain = types.MsgNodePauseChain

type MsgObservedTxIn

type MsgObservedTxIn = types.MsgObservedTxIn

type MsgObservedTxOut

type MsgObservedTxOut = types.MsgObservedTxOut

type MsgOutboundTx

type MsgOutboundTx = types.MsgOutboundTx

type MsgProposeUpgrade

type MsgProposeUpgrade = types.MsgProposeUpgrade

type MsgRagnarok

type MsgRagnarok = types.MsgRagnarok

type MsgRefundTx

type MsgRefundTx = types.MsgRefundTx

type MsgRejectUpgrade

type MsgRejectUpgrade = types.MsgRejectUpgrade

type MsgReserveContributor

type MsgReserveContributor = types.MsgReserveContributor

type MsgRunePoolDeposit

type MsgRunePoolDeposit = types.MsgRunePoolDeposit

type MsgRunePoolWithdraw

type MsgRunePoolWithdraw = types.MsgRunePoolWithdraw

type MsgSend

type MsgSend = types.MsgSend

Msgs

type MsgSetIPAddress

type MsgSetIPAddress = types.MsgSetIPAddress

type MsgSetNodeKeys

type MsgSetNodeKeys = types.MsgSetNodeKeys

type MsgSetVersion

type MsgSetVersion = types.MsgSetVersion

type MsgSolvency

type MsgSolvency = types.MsgSolvency

type MsgSwap

type MsgSwap = types.MsgSwap

type MsgTradeAccountDeposit

type MsgTradeAccountDeposit = types.MsgTradeAccountDeposit

type MsgTradeAccountWithdrawal

type MsgTradeAccountWithdrawal = types.MsgTradeAccountWithdrawal

type MsgTssKeysignFail

type MsgTssKeysignFail = types.MsgTssKeysignFail

type MsgTssPool

type MsgTssPool = types.MsgTssPool

type MsgUnBond

type MsgUnBond = types.MsgUnBond

type MsgWithdrawLiquidity

type MsgWithdrawLiquidity = types.MsgWithdrawLiquidity

type Network

type Network = types.Network

type NetworkFee

type NetworkFee = types.NetworkFee

type NetworkFeeHandler

type NetworkFeeHandler struct {
	// contains filtered or unexported fields
}

NetworkFeeHandler a handler to process MsgNetworkFee messages

func NewNetworkFeeHandler

func NewNetworkFeeHandler(mgr Manager) NetworkFeeHandler

NewNetworkFeeHandler create a new instance of network fee handler

func (NetworkFeeHandler) Run

Run is the main entry point for network fee logic

type NetworkManager

type NetworkManager interface {
	TriggerKeygen(ctx cosmos.Context, nas NodeAccounts) error
	RotateVault(ctx cosmos.Context, vault Vault) error
	BeginBlock(ctx cosmos.Context, mgr Manager) error
	EndBlock(ctx cosmos.Context, mgr Manager) error
	UpdateNetwork(ctx cosmos.Context, constAccessor constants.ConstantValues, gasManager GasManager, eventMgr EventManager) error
	SpawnDerivedAsset(ctx cosmos.Context, asset common.Asset, mgr Manager)
	CalcAnchor(_ cosmos.Context, _ Manager, _ common.Asset) (cosmos.Uint, cosmos.Uint, cosmos.Uint)
}

NetworkManager interface define the contract of network Manager

func GetNetworkManager

func GetNetworkManager(version semver.Version, keeper keeper.Keeper, txOutStore TxOutStore, eventMgr EventManager) (NetworkManager, error)

GetNetworkManager retrieve a NetworkManager that is compatible with the given version

type NetworkMgrV134

type NetworkMgrV134 struct {
	// contains filtered or unexported fields
}

NetworkMgrV134 is going to manage the vaults

func (*NetworkMgrV134) BeginBlock

func (vm *NetworkMgrV134) BeginBlock(ctx cosmos.Context, mgr Manager) error

func (*NetworkMgrV134) CalcAnchor

func (vm *NetworkMgrV134) CalcAnchor(ctx cosmos.Context, mgr Manager, asset common.Asset) (cosmos.Uint, cosmos.Uint, cosmos.Uint)

func (*NetworkMgrV134) EndBlock

func (vm *NetworkMgrV134) EndBlock(ctx cosmos.Context, mgr Manager) error

EndBlock move funds from retiring asgard vaults

func (*NetworkMgrV134) GetAvailableAnchorsAndDepths

func (vm *NetworkMgrV134) GetAvailableAnchorsAndDepths(
	ctx cosmos.Context, mgr Manager, asset common.Asset,
) ([]common.Asset, []cosmos.Uint)

GetAvailableAnchorsAndDepths returns anchor assets for available pools and a slice of equivalent length with their pool depths in RUNE.

func (*NetworkMgrV134) POLCycle

func (vm *NetworkMgrV134) POLCycle(ctx cosmos.Context, mgr Manager) error

func (*NetworkMgrV134) RotateVault

func (vm *NetworkMgrV134) RotateVault(ctx cosmos.Context, vault Vault) error

RotateVault update vault to Retiring and new vault to active

func (*NetworkMgrV134) SpawnDerivedAsset

func (vm *NetworkMgrV134) SpawnDerivedAsset(ctx cosmos.Context, asset common.Asset, mgr Manager)

func (*NetworkMgrV134) TriggerKeygen

func (vm *NetworkMgrV134) TriggerKeygen(ctx cosmos.Context, nas NodeAccounts) error

TriggerKeygen generate a record to instruct signer kick off keygen process

func (*NetworkMgrV134) UpdateNetwork

func (vm *NetworkMgrV134) UpdateNetwork(ctx cosmos.Context, constAccessor constants.ConstantValues, gasManager GasManager, eventMgr EventManager) error

UpdateNetwork Update the network data to reflect changing in this block

type NetworkMgrV136

type NetworkMgrV136 struct {
	// contains filtered or unexported fields
}

NetworkMgrV136 is going to manage the vaults

func (*NetworkMgrV136) BeginBlock

func (vm *NetworkMgrV136) BeginBlock(ctx cosmos.Context, mgr Manager) error

func (*NetworkMgrV136) CalcAnchor

func (vm *NetworkMgrV136) CalcAnchor(ctx cosmos.Context, mgr Manager, asset common.Asset) (cosmos.Uint, cosmos.Uint, cosmos.Uint)

func (*NetworkMgrV136) EndBlock

func (vm *NetworkMgrV136) EndBlock(ctx cosmos.Context, mgr Manager) error

EndBlock move funds from retiring asgard vaults

func (*NetworkMgrV136) GetAvailableAnchorsAndDepths

func (vm *NetworkMgrV136) GetAvailableAnchorsAndDepths(
	ctx cosmos.Context, mgr Manager, asset common.Asset,
) ([]common.Asset, []cosmos.Uint)

GetAvailableAnchorsAndDepths returns anchor assets for available pools and a slice of equivalent length with their pool depths in RUNE.

func (*NetworkMgrV136) POLCycle

func (vm *NetworkMgrV136) POLCycle(ctx cosmos.Context, mgr Manager) error

func (*NetworkMgrV136) RotateVault

func (vm *NetworkMgrV136) RotateVault(ctx cosmos.Context, vault Vault) error

RotateVault update vault to Retiring and new vault to active

func (*NetworkMgrV136) SpawnDerivedAsset

func (vm *NetworkMgrV136) SpawnDerivedAsset(ctx cosmos.Context, asset common.Asset, mgr Manager)

func (*NetworkMgrV136) TriggerKeygen

func (vm *NetworkMgrV136) TriggerKeygen(ctx cosmos.Context, nas NodeAccounts) error

TriggerKeygen generate a record to instruct signer kick off keygen process

func (*NetworkMgrV136) UpdateNetwork

func (vm *NetworkMgrV136) UpdateNetwork(ctx cosmos.Context, constAccessor constants.ConstantValues, gasManager GasManager, eventMgr EventManager) error

UpdateNetwork Update the network data to reflect changing in this block

type NetworkMgrVCUR

type NetworkMgrVCUR struct {
	// contains filtered or unexported fields
}

NetworkMgrVCUR is going to manage the vaults

func (*NetworkMgrVCUR) BeginBlock

func (vm *NetworkMgrVCUR) BeginBlock(ctx cosmos.Context, mgr Manager) error

func (*NetworkMgrVCUR) CalcAnchor

func (vm *NetworkMgrVCUR) CalcAnchor(ctx cosmos.Context, mgr Manager, asset common.Asset) (cosmos.Uint, cosmos.Uint, cosmos.Uint)

func (*NetworkMgrVCUR) EndBlock

func (vm *NetworkMgrVCUR) EndBlock(ctx cosmos.Context, mgr Manager) error

EndBlock move funds from retiring asgard vaults

func (*NetworkMgrVCUR) GetAvailableAnchorsAndDepths

func (vm *NetworkMgrVCUR) GetAvailableAnchorsAndDepths(
	ctx cosmos.Context, mgr Manager, asset common.Asset,
) ([]common.Asset, []cosmos.Uint)

GetAvailableAnchorsAndDepths returns anchor assets for available pools and a slice of equivalent length with their pool depths in RUNE.

func (*NetworkMgrVCUR) POLCycle

func (vm *NetworkMgrVCUR) POLCycle(ctx cosmos.Context, mgr Manager) error

func (*NetworkMgrVCUR) RotateVault

func (vm *NetworkMgrVCUR) RotateVault(ctx cosmos.Context, vault Vault) error

RotateVault update vault to Retiring and new vault to active

func (*NetworkMgrVCUR) SpawnDerivedAsset

func (vm *NetworkMgrVCUR) SpawnDerivedAsset(ctx cosmos.Context, asset common.Asset, mgr Manager)

func (*NetworkMgrVCUR) TriggerKeygen

func (vm *NetworkMgrVCUR) TriggerKeygen(ctx cosmos.Context, nas NodeAccounts) error

TriggerKeygen generate a record to instruct signer kick off keygen process

func (*NetworkMgrVCUR) UpdateNetwork

func (vm *NetworkMgrVCUR) UpdateNetwork(ctx cosmos.Context, constAccessor constants.ConstantValues, gasManager GasManager, eventMgr EventManager) error

UpdateNetwork Update the network data to reflect changing in this block

type NoOpHandler

type NoOpHandler struct {
	// contains filtered or unexported fields
}

NoOpHandler is to handle donate message

func NewNoOpHandler

func NewNoOpHandler(mgr Manager) NoOpHandler

NewNoOpHandler create a new instance of NoOpHandler

func (NoOpHandler) Run

func (h NoOpHandler) Run(ctx cosmos.Context, m cosmos.Msg) (*cosmos.Result, error)

Run is the main entry point to execute donate logic

type NoOpMemo

type NoOpMemo = mem.NoOpMemo

type Node

type Node = types.Node

type NodeAccount

type NodeAccount = types.NodeAccount

type NodeAccounts

type NodeAccounts = types.NodeAccounts

type NodeMimir

type NodeMimir = types.NodeMimir

type NodeMimirs

type NodeMimirs = types.NodeMimirs

type NodePauseChainHandler

type NodePauseChainHandler struct {
	// contains filtered or unexported fields
}

NodePauseChainHandler is to handle node pause chain messages

func NewNodePauseChainHandler

func NewNodePauseChainHandler(mgr Manager) NodePauseChainHandler

NewNodePauseChainHandler create new instance of NodePauseChainHandler

func (NodePauseChainHandler) Run

Run is the main entry point to execute node pause chain logic

type NodeStatus

type NodeStatus = types.NodeStatus

type ObservedNetworkFeeVoter

type ObservedNetworkFeeVoter = types.ObservedNetworkFeeVoter

type ObservedTx

type ObservedTx = types.ObservedTx

type ObservedTxInHandler

type ObservedTxInHandler struct {
	// contains filtered or unexported fields
}

ObservedTxInHandler to handle MsgObservedTxIn

func NewObservedTxInHandler

func NewObservedTxInHandler(mgr Manager) ObservedTxInHandler

NewObservedTxInHandler create a new instance of ObservedTxInHandler

func (ObservedTxInHandler) Run

Run is the main entry point of ObservedTxInHandler

type ObservedTxOutHandler

type ObservedTxOutHandler struct {
	// contains filtered or unexported fields
}

ObservedTxOutHandler process MsgObservedTxOut messages

func NewObservedTxOutHandler

func NewObservedTxOutHandler(mgr Manager) ObservedTxOutHandler

NewObservedTxOutHandler create a new instance of ObservedTxOutHandler

func (ObservedTxOutHandler) Run

Run is the main entry point for ObservedTxOutHandler

type ObservedTxVoter

type ObservedTxVoter = types.ObservedTxVoter

type ObservedTxVoters

type ObservedTxVoters = types.ObservedTxVoters

type ObservedTxs

type ObservedTxs = types.ObservedTxs

type ObserverManager

type ObserverManager interface {
	BeginBlock()
	EndBlock(ctx cosmos.Context, keeper keeper.Keeper)
	AppendObserver(chain common.Chain, addrs []cosmos.AccAddress)
	List() []cosmos.AccAddress
}

ObserverManager define the method to manage observes

func GetObserverManager

func GetObserverManager(version semver.Version) (ObserverManager, error)

GetObserverManager return an instance that implements ObserverManager interface when there is no version can match the given semver , it will return nil

type ObserverMgrVCUR

type ObserverMgrVCUR struct {
	// contains filtered or unexported fields
}

ObserverMgrVCUR implement a ObserverManager which will store the observers in memory before written to chain

func (*ObserverMgrVCUR) AppendObserver

func (om *ObserverMgrVCUR) AppendObserver(chain common.Chain, addrs []cosmos.AccAddress)

AppendObserver add the address

func (*ObserverMgrVCUR) BeginBlock

func (om *ObserverMgrVCUR) BeginBlock()

BeginBlock called when a new block get proposed

func (*ObserverMgrVCUR) EndBlock

func (om *ObserverMgrVCUR) EndBlock(ctx cosmos.Context, keeper keeper.Keeper)

EndBlock emit the observers

func (*ObserverMgrVCUR) List

func (om *ObserverMgrVCUR) List() []cosmos.AccAddress

List - gets a list of addresses that have been observed in all chains

type OrderBook

type OrderBook interface {
	EndBlock(ctx cosmos.Context, mgr Manager) error
}

OrderBook interface define the contract of Order Book

func GetOrderBook

func GetOrderBook(version semver.Version, keeper keeper.Keeper) (OrderBook, error)

GetOrderBook retrieve a OrderBook that is compatible with the given version

type OrderBookVCUR

type OrderBookVCUR struct {
	// contains filtered or unexported fields
}

OrderBookVCUR is going to manage the swaps queue

func (*OrderBookVCUR) AddOrderBookItem

func (ob *OrderBookVCUR) AddOrderBookItem(ctx cosmos.Context, msg MsgSwap) error

func (*OrderBookVCUR) EndBlock

func (ob *OrderBookVCUR) EndBlock(ctx cosmos.Context, mgr Manager) error

EndBlock trigger the real swap to be processed

func (*OrderBookVCUR) FetchQueue

func (ob *OrderBookVCUR) FetchQueue(ctx cosmos.Context, mgr Manager, pairs tradePairs, pools Pools) (orderItems, error)

FetchQueue - grabs all swap queue items from the kvstore and returns them

type OutAssetGas

type OutAssetGas struct {
	// contains filtered or unexported fields
}

type OutboundMemo

type OutboundMemo = mem.OutboundMemo

type OutboundTxHandler

type OutboundTxHandler struct {
	// contains filtered or unexported fields
}

func NewOutboundTxHandler

func NewOutboundTxHandler(mgr Manager) OutboundTxHandler

func (OutboundTxHandler) Run

type Pool

type Pool = types.Pool

type PoolAmt

type PoolAmt = types.PoolAmt

type PoolManager

type PoolManager interface {
	EndBlock(ctx cosmos.Context, mgr Manager) error
}

PoolManager interface define the contract of PoolManager

func GetPoolManager

func GetPoolManager(version semver.Version) (PoolManager, error)

GetPoolManager return an implementation of PoolManager

type PoolMgrVCUR

type PoolMgrVCUR struct{}

func (*PoolMgrVCUR) EndBlock

func (pm *PoolMgrVCUR) EndBlock(ctx cosmos.Context, mgr Manager) error

EndBlock cycle pools if required and if ragnarok is not in progress

type PoolMod

type PoolMod = types.PoolMod

type PoolMods

type PoolMods = types.PoolMods

type PoolStatus

type PoolStatus = types.PoolStatus

Keeper structs

type Pools

type Pools = types.Pools

type ProposeUpgradeHandler

type ProposeUpgradeHandler struct {
	// contains filtered or unexported fields
}

ProposeUpgradeHandler is to handle the ProposeUpgrade message

func NewProposeUpgradeHandler

func NewProposeUpgradeHandler(mgr Manager) ProposeUpgradeHandler

NewProposeUpgradeHandler create new instance of ProposeUpgradeHandler

func (ProposeUpgradeHandler) Run

Run is the main entry point to execute upgrade proposal logic

type ProtoInt64

type ProtoInt64 = types.ProtoInt64

type ProtoStrings

type ProtoStrings = types.ProtoStrings

Proto

type ProtocolOwnedLiquidity

type ProtocolOwnedLiquidity = types.ProtocolOwnedLiquidity

type RUNEPool

type RUNEPool = types.RUNEPool

type RUNEProvider

type RUNEProvider = types.RUNEProvider

type RagnarokHandler

type RagnarokHandler struct {
	// contains filtered or unexported fields
}

RagnarokHandler process MsgRagnarok

func NewRagnarokHandler

func NewRagnarokHandler(mgr Manager) RagnarokHandler

NewRagnarokHandler create a new instance of RagnarokHandler

func (RagnarokHandler) Run

Run is the main entry point of ragnarok handler

type RagnarokMemo

type RagnarokMemo = mem.RagnarokMemo

type RagnarokWithdrawPosition

type RagnarokWithdrawPosition = types.RagnarokWithdrawPosition

type RefundHandler

type RefundHandler struct {
	// contains filtered or unexported fields
}

RefundHandler a handle to process tx that had refund memo usually this type or tx is because Thorchain fail to process the tx, which result in a refund, signer honour the tx and refund customer accordingly

func NewRefundHandler

func NewRefundHandler(mgr Manager) RefundHandler

NewRefundHandler create a new refund handler

func (RefundHandler) Run

Run is the main entry point to process refund outbound message

type RefundMemo

type RefundMemo = mem.RefundMemo

type RejectUpgradeHandler

type RejectUpgradeHandler struct {
	// contains filtered or unexported fields
}

RejectUpgradeHandler is to handle the RejectUpgrade message

func NewRejectUpgradeHandler

func NewRejectUpgradeHandler(mgr Manager) RejectUpgradeHandler

NewRejectUpgradeHandler create new instance of RejectUpgradeHandler

func (RejectUpgradeHandler) Run

Run it the main entry point to execute Version logic

type ReserveContributor

type ReserveContributor = types.ReserveContributor

type ReserveContributorHandler

type ReserveContributorHandler struct {
	// contains filtered or unexported fields
}

ReserveContributorHandler is handler to process MsgReserveContributor

func NewReserveContributorHandler

func NewReserveContributorHandler(mgr Manager) ReserveContributorHandler

NewReserveContributorHandler create a new instance of ReserveContributorHandler

func (ReserveContributorHandler) Run

Run is the main entry point for ReserveContributorHandler

type ReserveContributors

type ReserveContributors = types.ReserveContributors

type ReserveMemo

type ReserveMemo = mem.ReserveMemo

type RouterUpgradeController

type RouterUpgradeController struct {
	// contains filtered or unexported fields
}

func NewRouterUpgradeController

func NewRouterUpgradeController(mgr Manager) *RouterUpgradeController

NewRouterUpgradeController create a new instance of RouterUpgradeController

func (*RouterUpgradeController) Process

func (r *RouterUpgradeController) Process(ctx cosmos.Context)

Process is the main entry of router upgrade controller refunds all USDT liquidity, and then upgrades contract all these steps are controlled by mimir

type RunePoolDepositHandler

type RunePoolDepositHandler struct {
	// contains filtered or unexported fields
}

RunePoolDepositHandler a handler to process deposits to RunePool

func NewRunePoolDepositHandler

func NewRunePoolDepositHandler(mgr Manager) RunePoolDepositHandler

NewRunePoolDepositHandler create new RunePoolDepositHandler

func (RunePoolDepositHandler) Run

Run execute the handler

type RunePoolDepositMemo

type RunePoolDepositMemo = mem.RunePoolDepositMemo

type RunePoolWithdrawHandler

type RunePoolWithdrawHandler struct {
	// contains filtered or unexported fields
}

RunePoolWithdrawHandler a handler to process withdrawals from RunePool

func NewRunePoolWithdrawHandler

func NewRunePoolWithdrawHandler(mgr Manager) RunePoolWithdrawHandler

NewRunePoolWithdrawHandler create new RunePoolWithdrawHandler

func (RunePoolWithdrawHandler) Run

Run execute the handler

type RunePoolWithdrawMemo

type RunePoolWithdrawMemo = mem.RunePoolWithdrawMemo

type SetNodeKeysHandler

type SetNodeKeysHandler struct {
	// contains filtered or unexported fields
}

SetNodeKeysHandler process MsgSetNodeKeys MsgSetNodeKeys is used by operators after the node account had been white list , to update the consensus pubkey and node account pubkey

func NewSetNodeKeysHandler

func NewSetNodeKeysHandler(mgr Manager) SetNodeKeysHandler

NewSetNodeKeysHandler create a new instance of SetNodeKeysHandler

func (SetNodeKeysHandler) Run

Run is the main entry point to process MsgSetNodeKeys

type Slasher

type Slasher interface {
	BeginBlock(ctx cosmos.Context, req abci.RequestBeginBlock, constAccessor constants.ConstantValues)
	LackSigning(ctx cosmos.Context, mgr Manager) error
	SlashVault(ctx cosmos.Context, vaultPK common.PubKey, coins common.Coins, mgr Manager) error
	IncSlashPoints(ctx cosmos.Context, point int64, addresses ...cosmos.AccAddress)
	DecSlashPoints(ctx cosmos.Context, point int64, addresses ...cosmos.AccAddress)
}

Slasher define all the method to perform slash

func GetSlasher

func GetSlasher(version semver.Version, keeper keeper.Keeper, eventMgr EventManager) (Slasher, error)

GetSlasher return an implementation of Slasher

type SlasherVCUR

type SlasherVCUR struct {
	// contains filtered or unexported fields
}

SlasherVCUR is VCUR implementation of slasher

func (*SlasherVCUR) BeginBlock

func (s *SlasherVCUR) BeginBlock(ctx cosmos.Context, req abci.RequestBeginBlock, constAccessor constants.ConstantValues)

BeginBlock called when a new block get proposed to detect whether there are duplicate vote

func (*SlasherVCUR) DecSlashPoints

func (s *SlasherVCUR) DecSlashPoints(ctx cosmos.Context, point int64, addresses ...cosmos.AccAddress)

DecSlashPoints will decrease the given account's slash points

func (*SlasherVCUR) HandleDoubleSign

func (s *SlasherVCUR) HandleDoubleSign(ctx cosmos.Context, addr crypto.Address, infractionHeight int64, constAccessor constants.ConstantValues, validatorAddresses []nodeAddressValidatorAddressPair) error

HandleDoubleSign - slashes a validator for signing two blocks at the same block height https://blog.cosmos.network/consensus-compare-casper-vs-tendermint-6df154ad56ae

func (*SlasherVCUR) HandleMissingSign

func (s *SlasherVCUR) HandleMissingSign(ctx cosmos.Context, addr crypto.Address, constAccessor constants.ConstantValues, validatorAddresses []nodeAddressValidatorAddressPair) error

HandleMissingSign - slashes a validator for not signing a block

func (*SlasherVCUR) IncSlashPoints

func (s *SlasherVCUR) IncSlashPoints(ctx cosmos.Context, point int64, addresses ...cosmos.AccAddress)

IncSlashPoints will increase the given account's slash points

func (*SlasherVCUR) LackSigning

func (s *SlasherVCUR) LackSigning(ctx cosmos.Context, mgr Manager) error

LackSigning slash account that fail to sign tx

func (*SlasherVCUR) SlashVault

func (s *SlasherVCUR) SlashVault(ctx cosmos.Context, vaultPK common.PubKey, coins common.Coins, mgr Manager) error

SlashVault thorchain keep monitoring the outbound tx from asgard pool usually the txout is triggered by thorchain itself by adding an item into the txout array, refer to TxOutItem for the detail, the TxOutItem contains a specific coin and amount. if somehow thorchain discover signer send out fund more than the amount specified in TxOutItem, it will slash the node account who does that by taking 1.5 * extra fund from node account's bond and subsidise the pool that actually lost it.

type SolvencyHandler

type SolvencyHandler struct {
	// contains filtered or unexported fields
}

SolvencyHandler is to process MsgSolvency message from bifrost Bifrost constantly monitor the account balance , and report to THORNode If it detect that wallet is short of fund , much less than vault, the network should automatically halt trading

func NewSolvencyHandler

func NewSolvencyHandler(mgr Manager) SolvencyHandler

NewSolvencyHandler create a new instance of solvency handler

func (SolvencyHandler) Run

Run is the main entry point to process MsgSolvency

type StoreManager

type StoreManager interface {
	Iterator(_ cosmos.Context) error
}

StoreManager define the method as the entry point for store upgrade

type StoreMgr

type StoreMgr struct {
	// contains filtered or unexported fields
}

StoreMgr implement StoreManager interface

func (*StoreMgr) Iterator

func (smgr *StoreMgr) Iterator(ctx cosmos.Context) error

Iterator implement StoreManager interface decide whether it need to upgrade store

type StreamingSwap

type StreamingSwap = types.StreamingSwap

type StreamingSwaps

type StreamingSwaps = types.StreamingSwaps

type SwapHandler

type SwapHandler struct {
	// contains filtered or unexported fields
}

SwapHandler is the handler to process swap request

func NewSwapHandler

func NewSwapHandler(mgr Manager) SwapHandler

NewSwapHandler create a new instance of swap handler

func (SwapHandler) Run

func (h SwapHandler) Run(ctx cosmos.Context, m cosmos.Msg) (*cosmos.Result, error)

Run is the main entry point of swap message

type SwapMemo

type SwapMemo = mem.SwapMemo

Memo

type SwapQueue

type SwapQueue interface {
	EndBlock(ctx cosmos.Context, mgr Manager) error
}

SwapQueue interface define the contract of Swap Queue

func GetSwapQueue

func GetSwapQueue(version semver.Version, keeper keeper.Keeper) (SwapQueue, error)

GetSwapQueue retrieve a SwapQueue that is compatible with the given version

type SwapQueueVCUR

type SwapQueueVCUR struct {
	// contains filtered or unexported fields
}

SwapQueueVCUR is going to manage the swaps queue

func (*SwapQueueVCUR) EndBlock

func (vm *SwapQueueVCUR) EndBlock(ctx cosmos.Context, mgr Manager) error

EndBlock trigger the real swap to be processed

func (*SwapQueueVCUR) FetchQueue

func (vm *SwapQueueVCUR) FetchQueue(ctx cosmos.Context) (swapItems, error)

FetchQueue - grabs all swap queue items from the kvstore and returns them

type Swapper

type Swapper interface {
	Swap(ctx cosmos.Context,
		keeper keeper.Keeper,
		tx common.Tx,
		target common.Asset,
		destination common.Address,
		swapTarget cosmos.Uint,
		dexAgg string,
		dexAggTargetAsset string,
		dexAggLimit *cosmos.Uint,
		swp StreamingSwap,
		synthVirtualDepthMult int64,
		mgr Manager,
	) (cosmos.Uint, []*EventSwap, error)
	CalcAssetEmission(X, x, Y cosmos.Uint) cosmos.Uint
	CalcLiquidityFee(X, x, Y cosmos.Uint) cosmos.Uint
	CalcSwapSlip(Xi, xi cosmos.Uint) cosmos.Uint
	GetSwapCalc(X, x, Y, slipBps, minSlipBps cosmos.Uint) (emitAssets, liquidityFee, slip cosmos.Uint)
}

Though Swapper is not a full manager, it is recorded here for versioning convenience.

func GetSwapper

func GetSwapper(version semver.Version) (Swapper, error)

Though Swapper is not a full manager, it is recorded here for versioning convenience. GetSwapper return an implementation of Swapper

type SwapperClout

type SwapperClout = types.SwapperClout

type SwapperV134

type SwapperV134 struct{}

func (*SwapperV134) CalcAssetEmission

func (s *SwapperV134) CalcAssetEmission(X, x, Y cosmos.Uint) cosmos.Uint

calculate the number of assets sent to the address (includes liquidity fee) nolint

func (*SwapperV134) CalcLiquidityFee

func (s *SwapperV134) CalcLiquidityFee(X, x, Y cosmos.Uint) cosmos.Uint

CalculateLiquidityFee the fee of the swap nolint

func (*SwapperV134) CalcMaxAssetEmission

func (s *SwapperV134) CalcMaxAssetEmission(X, x, Y, fee cosmos.Uint) cosmos.Uint

calculate the asset amount to be sent to address using a predefined fee (fee calculated using artificial floor) nolint

func (*SwapperV134) CalcMinLiquidityFee

func (s *SwapperV134) CalcMinLiquidityFee(X, x, Y, minSlipBps cosmos.Uint) cosmos.Uint

CalcMinLiquidityFee calculates the fee of the swap using min artificial slip floor nolint

func (*SwapperV134) CalcSwapSlip

func (s *SwapperV134) CalcSwapSlip(Xi, xi cosmos.Uint) cosmos.Uint

CalcSwapSlip - calculate the swap slip, expressed in basis points (10000) nolint

func (*SwapperV134) GetSwapCalc

func (s *SwapperV134) GetSwapCalc(X, x, Y, slipBps, minSlipBps cosmos.Uint) (emitAssets, liquidityFee, slip cosmos.Uint)

GetSwapCalc returns emission, liquidity fee and slip for a swap nolint

func (*SwapperV134) MinSlipBps

func (s *SwapperV134) MinSlipBps(
	ctx cosmos.Context,
	k keeper.Keeper,
	isSynth bool,
	isTradeAccount bool,
) cosmos.Uint

MinSlipBps returns artificial slip floor, expressed in basis points (10000)

func (*SwapperV134) Swap

func (s *SwapperV134) Swap(ctx cosmos.Context,
	keeper keeper.Keeper,
	tx common.Tx,
	target common.Asset,
	destination common.Address,
	swapTarget cosmos.Uint,
	dexAgg string,
	dexAggTargetAsset string,
	dexAggLimit *cosmos.Uint,
	swp StreamingSwap,
	synthVirtualDepthMult int64, mgr Manager,
) (cosmos.Uint, []*EventSwap, error)

type SwapperVCUR

type SwapperVCUR struct{}

func (*SwapperVCUR) CalcAssetEmission

func (s *SwapperVCUR) CalcAssetEmission(X, x, Y cosmos.Uint) cosmos.Uint

calculate the number of assets sent to the address (includes liquidity fee) nolint

func (*SwapperVCUR) CalcLiquidityFee

func (s *SwapperVCUR) CalcLiquidityFee(X, x, Y cosmos.Uint) cosmos.Uint

CalculateLiquidityFee the fee of the swap nolint

func (*SwapperVCUR) CalcMaxAssetEmission

func (s *SwapperVCUR) CalcMaxAssetEmission(X, x, Y, fee cosmos.Uint) cosmos.Uint

calculate the asset amount to be sent to address using a predefined fee (fee calculated using artificial floor) nolint

func (*SwapperVCUR) CalcMinLiquidityFee

func (s *SwapperVCUR) CalcMinLiquidityFee(X, x, Y, minSlipBps cosmos.Uint) cosmos.Uint

CalcMinLiquidityFee calculates the fee of the swap using min artificial slip floor nolint

func (*SwapperVCUR) CalcSwapSlip

func (s *SwapperVCUR) CalcSwapSlip(Xi, xi cosmos.Uint) cosmos.Uint

CalcSwapSlip - calculate the swap slip, expressed in basis points (10000) nolint

func (*SwapperVCUR) GetSwapCalc

func (s *SwapperVCUR) GetSwapCalc(X, x, Y, slipBps, minSlipBps cosmos.Uint) (emitAssets, liquidityFee, slip cosmos.Uint)

GetSwapCalc returns emission, liquidity fee and slip for a swap nolint

func (*SwapperVCUR) Swap

func (s *SwapperVCUR) Swap(ctx cosmos.Context,
	keeper keeper.Keeper,
	tx common.Tx,
	target common.Asset,
	destination common.Address,
	swapTarget cosmos.Uint,
	dexAgg string,
	dexAggTargetAsset string,
	dexAggLimit *cosmos.Uint,
	swp StreamingSwap,
	synthVirtualDepthMult int64, mgr Manager,
) (cosmos.Uint, []*EventSwap, error)

type THORName

type THORName = types.THORName

type THORNameAlias

type THORNameAlias = types.THORNameAlias

type TradeAccount

type TradeAccount = types.TradeAccount

type TradeAccountDepositHandler

type TradeAccountDepositHandler struct {
	// contains filtered or unexported fields
}

TradeAccountDepositHandler is handler to process MsgTradeAccountDeposit

func NewTradeAccountDepositHandler

func NewTradeAccountDepositHandler(mgr Manager) TradeAccountDepositHandler

NewTradeAccountDepositHandler create a new instance of TradeAccountDepositHandler

func (TradeAccountDepositHandler) Run

Run is the main entry point for TradeAccountDepositHandler

type TradeAccountDepositMemo

type TradeAccountDepositMemo = mem.TradeAccountDepositMemo

type TradeAccountManager

type TradeAccountManager interface {
	EndBlock(ctx cosmos.Context, keeper keeper.Keeper) error
	Deposit(_ cosmos.Context, _ common.Asset, amount cosmos.Uint, owner cosmos.AccAddress, assetAddr common.Address, _ common.TxID) (cosmos.Uint, error)
	Withdrawal(_ cosmos.Context, _ common.Asset, amount cosmos.Uint, owner cosmos.AccAddress, assetAddr common.Address, _ common.TxID) (cosmos.Uint, error)
	BalanceOf(_ cosmos.Context, _ common.Asset, owner cosmos.AccAddress) cosmos.Uint
}

func GetTradeAccountManager

func GetTradeAccountManager(version semver.Version, keeper keeper.Keeper, eventMgr EventManager) (TradeAccountManager, error)

type TradeAccountWithdrawalHandler

type TradeAccountWithdrawalHandler struct {
	// contains filtered or unexported fields
}

TradeAccountWithdrawalHandler is handler to process MsgTradeAccountWithdrawal

func NewTradeAccountWithdrawalHandler

func NewTradeAccountWithdrawalHandler(mgr Manager) TradeAccountWithdrawalHandler

NewTradeAccountWithdrawalHandler create a new instance of TradeAccountWithdrawalHandler

func (TradeAccountWithdrawalHandler) Run

Run is the main entry point for TradeAccountWithdrawalHandler

type TradeAccountWithdrawalMemo

type TradeAccountWithdrawalMemo = mem.TradeAccountWithdrawalMemo

type TradeMgrVCUR

type TradeMgrVCUR struct {
	// contains filtered or unexported fields
}

TradeMgrVCUR is VCUR implementation of slasher

func (*TradeMgrVCUR) BalanceOf

func (s *TradeMgrVCUR) BalanceOf(ctx cosmos.Context, asset common.Asset, addr cosmos.AccAddress) cosmos.Uint

func (*TradeMgrVCUR) Deposit

func (s *TradeMgrVCUR) Deposit(ctx cosmos.Context, asset common.Asset, amount cosmos.Uint, owner cosmos.AccAddress, assetAddr common.Address, txID common.TxID) (cosmos.Uint, error)

func (*TradeMgrVCUR) EndBlock

func (s *TradeMgrVCUR) EndBlock(ctx cosmos.Context, keeper keeper.Keeper) error

func (*TradeMgrVCUR) Withdrawal

func (s *TradeMgrVCUR) Withdrawal(ctx cosmos.Context, asset common.Asset, amount cosmos.Uint, owner cosmos.AccAddress, assetAddr common.Address, txID common.TxID) (cosmos.Uint, error)

type TradeUnit

type TradeUnit = types.TradeUnit

type TssHandler

type TssHandler = BaseHandler[*MsgTssPool]

type TssKeysignFailVoter

type TssKeysignFailVoter = types.TssKeysignFailVoter

type TssKeysignHandler

type TssKeysignHandler struct {
	// contains filtered or unexported fields
}

TssKeysignHandler is design to process MsgTssKeysignFail

func NewTssKeysignHandler

func NewTssKeysignHandler(mgr Manager) TssKeysignHandler

NewTssKeysignHandler create a new instance of TssKeysignHandler when a signer fail to join tss keysign , thorchain need to slash the node account

func (TssKeysignHandler) Run

Run is the main entry to process MsgTssKeysignFail

type TssVoter

type TssVoter = types.TssVoter

type TxOut

type TxOut = types.TxOut

type TxOutItem

type TxOutItem = types.TxOutItem

type TxOutStorageVCUR

type TxOutStorageVCUR struct {
	// contains filtered or unexported fields
}

TxOutStorageVCUR is going to manage all the outgoing tx

func (*TxOutStorageVCUR) CalcTxOutHeight

func (tos *TxOutStorageVCUR) CalcTxOutHeight(ctx cosmos.Context, version semver.Version, toi TxOutItem) (int64, cosmos.Uint, error)

func (*TxOutStorageVCUR) ClearOutboundItems

func (tos *TxOutStorageVCUR) ClearOutboundItems(ctx cosmos.Context)

ClearOutboundItems remove all the tx out items , mostly used for test

func (*TxOutStorageVCUR) DiscoverOutbounds

func (tos *TxOutStorageVCUR) DiscoverOutbounds(ctx cosmos.Context, transactionFeeAsset cosmos.Uint, maxGasAsset common.Coin, toi TxOutItem, vaults Vaults) ([]TxOutItem, cosmos.Uint)

func (*TxOutStorageVCUR) EndBlock

func (tos *TxOutStorageVCUR) EndBlock(ctx cosmos.Context, mgr Manager) error

func (*TxOutStorageVCUR) GetBlockOut

func (tos *TxOutStorageVCUR) GetBlockOut(ctx cosmos.Context) (*TxOut, error)

GetBlockOut read the TxOut from kv store

func (*TxOutStorageVCUR) GetOutboundItemByToAddress

func (tos *TxOutStorageVCUR) GetOutboundItemByToAddress(ctx cosmos.Context, to common.Address) []TxOutItem

GetOutboundItemByToAddress read all the outbound items filter by the given to address

func (*TxOutStorageVCUR) GetOutboundItems

func (tos *TxOutStorageVCUR) GetOutboundItems(ctx cosmos.Context) ([]TxOutItem, error)

GetOutboundItems read all the outbound item from kv store

func (*TxOutStorageVCUR) TryAddTxOutItem

func (tos *TxOutStorageVCUR) TryAddTxOutItem(ctx cosmos.Context, mgr Manager, toi TxOutItem, minOut cosmos.Uint) (bool, error)

When TryAddTxOutItem returns an error, there should be no state changes from it, including funds movements or fee events from prepareTxOutItem. So, use CacheContext to only commit state changes when cachedTryAddTxOutItem doesn't return an error.

func (*TxOutStorageVCUR) UnSafeAddTxOutItem

func (tos *TxOutStorageVCUR) UnSafeAddTxOutItem(ctx cosmos.Context, mgr Manager, toi TxOutItem, height int64) error

UnSafeAddTxOutItem - blindly adds a tx out, skipping vault selection, transaction fee deduction, etc

type TxOutStore

type TxOutStore interface {
	EndBlock(ctx cosmos.Context, mgr Manager) error
	GetBlockOut(ctx cosmos.Context) (*TxOut, error)
	ClearOutboundItems(ctx cosmos.Context)
	GetOutboundItems(ctx cosmos.Context) ([]TxOutItem, error)
	TryAddTxOutItem(ctx cosmos.Context, mgr Manager, toi TxOutItem, minOut cosmos.Uint) (bool, error)
	UnSafeAddTxOutItem(ctx cosmos.Context, mgr Manager, toi TxOutItem, height int64) error
	GetOutboundItemByToAddress(cosmos.Context, common.Address) []TxOutItem
	CalcTxOutHeight(cosmos.Context, semver.Version, TxOutItem) (int64, cosmos.Uint, error)
	DiscoverOutbounds(ctx cosmos.Context, transactionFeeAsset cosmos.Uint, maxGasAsset common.Coin, toi TxOutItem, vaults Vaults) ([]TxOutItem, cosmos.Uint)
}

TxOutStore define the method required for TxOutStore

func GetTxOutStore

func GetTxOutStore(version semver.Version, keeper keeper.Keeper, eventMgr EventManager, gasManager GasManager) (TxOutStore, error)

GetTxOutStore will return an implementation of the txout store that

type TypedHandler

type TypedHandler[M cosmos.Msg] interface {
	MsgHandler
	// contains filtered or unexported methods
}

type UnBondHandler

type UnBondHandler struct {
	// contains filtered or unexported fields
}

UnBondHandler a handler to process unbond request

func NewUnBondHandler

func NewUnBondHandler(mgr Manager) UnBondHandler

NewUnBondHandler create new UnBondHandler

func (UnBondHandler) Run

Run execute the handler

type UnbondMemo

type UnbondMemo = mem.UnbondMemo

type ValidatorManager

type ValidatorManager interface {
	BeginBlock(ctx cosmos.Context, mgr Manager, existingValidators []string) error
	EndBlock(ctx cosmos.Context, mgr Manager) []abci.ValidatorUpdate

	NodeAccountPreflightCheck(ctx cosmos.Context, na NodeAccount, constAccessor constants.ConstantValues) (NodeStatus, error)
	// contains filtered or unexported methods
}

ValidatorManager define the method to manage validators

func GetValidatorManager

func GetValidatorManager(version semver.Version, keeper keeper.Keeper, networkMgr NetworkManager, txOutStore TxOutStore, eventMgr EventManager) (ValidatorManager, error)

GetValidatorManager create a new instance of Validator Manager

type ValidatorMgrVCUR

type ValidatorMgrVCUR struct {
	// contains filtered or unexported fields
}

ValidatorMgrVCUR is to manage a list of validators , and rotate them

func (*ValidatorMgrVCUR) BeginBlock

func (vm *ValidatorMgrVCUR) BeginBlock(ctx cosmos.Context, mgr Manager, existingValidators []string) error

BeginBlock when block begin

func (*ValidatorMgrVCUR) EndBlock

func (vm *ValidatorMgrVCUR) EndBlock(ctx cosmos.Context, mgr Manager) []abci.ValidatorUpdate

EndBlock when block commit

func (*ValidatorMgrVCUR) NodeAccountPreflightCheck

func (vm *ValidatorMgrVCUR) NodeAccountPreflightCheck(ctx cosmos.Context, na NodeAccount, _ constants.ConstantValues) (NodeStatus, error)

NodeAccountPreflightCheck preflight check to find out what the node account's next status will be

type Vault

type Vault = types.Vault

type VaultStatus

type VaultStatus = types.VaultStatus

type Vaults

type Vaults = types.Vaults

type VersionHandler

type VersionHandler struct {
	// contains filtered or unexported fields
}

VersionHandler is to handle Version message

func NewVersionHandler

func NewVersionHandler(mgr Manager) VersionHandler

NewVersionHandler create new instance of VersionHandler

func (VersionHandler) Run

Run it the main entry point to execute Version logic

type WithdrawLiquidityHandler

type WithdrawLiquidityHandler struct {
	// contains filtered or unexported fields
}

WithdrawLiquidityHandler to process withdraw requests

func NewWithdrawLiquidityHandler

func NewWithdrawLiquidityHandler(mgr Manager) WithdrawLiquidityHandler

NewWithdrawLiquidityHandler create a new instance of WithdrawLiquidityHandler to process withdraw request

func (WithdrawLiquidityHandler) Run

Run is the main entry point of withdraw

type WithdrawLiquidityMemo

type WithdrawLiquidityMemo = mem.WithdrawLiquidityMemo

Source Files

Directories

Path Synopsis
client
cli
v1
Please put all the test related function to here
Please put all the test related function to here

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL