keeper

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ICACallbackID_Delegate           = "delegate"
	ICACallbackID_Claim              = "claim"
	ICACallbackID_Undelegate         = "undelegate"
	ICACallbackID_Redelegate         = "redelegate"
	ICACallbackID_TransferToNative   = "transfer_to_native"
	ICACallbackID_TransferFromNative = "transfer_from_native"
	ICACallbackID_SetWithdrawAddress = "set_withdraw_address"
	ICACallbackID_BankSend           = "bank_send"
)
View Source
const (
	ICQCallbackID_Balance = "balance"
)

Variables

This section is empty.

Functions

func BalanceCallback

func BalanceCallback(k Keeper, ctx sdk.Context, args []byte, query icqueriestypes.Query, status icqueriestypes.QueryResponseStatus) error

func BankSendCallback added in v1.5.0

func BankSendCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func ClaimCallback

func ClaimCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func DelegateCallback

func DelegateCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func NewQueryServerImpl

func NewQueryServerImpl(keeper Keeper) types.QueryServer

NewQueryServerImpl returns an implementation of the QueryServer interface for the provided Keeper.

func RedelegateCallback

func RedelegateCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func SetWithdrawAddressCallback

func SetWithdrawAddressCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func TransferFromNativeCallback

func TransferFromNativeCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func TransferToNativeCallback

func TransferToNativeCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func UndelegateCallback

func UndelegateCallback(k Keeper, ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

Types

type DepositTWB

type DepositTWB struct {
	Address string
	Amount  sdkmath.Int
}

type DrawResult

type DrawResult struct {
	PrizeDraws     []PrizeDraw
	TotalWinCount  uint64
	TotalWinAmount sdkmath.Int
}

type Hooks added in v1.5.2

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

Hooks wrapper struct for incentives keeper

func (Hooks) AfterEpochEnd added in v1.5.2

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

func (Hooks) BeforeEpochStart added in v1.5.2

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

epochs hooks

type ICACallback

ICACallback wrapper struct for millions keeper

type ICACallbacks

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

func (ICACallbacks) AddICACallback

func (c ICACallbacks) AddICACallback(id string, fn interface{}) icacallbackstypes.ICACallbackHandler

func (ICACallbacks) CallICACallback

func (c ICACallbacks) CallICACallback(ctx sdk.Context, id string, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error

func (ICACallbacks) HasICACallback

func (c ICACallbacks) HasICACallback(id string) bool

func (ICACallbacks) RegisterICACallbacks

func (c ICACallbacks) RegisterICACallbacks() icacallbackstypes.ICACallbackHandler

type ICQCallback

ICQCallback wrapper struct for millions keeper

type ICQCallbacks

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

func (ICQCallbacks) AddICQCallback

func (c ICQCallbacks) AddICQCallback(id string, fn interface{}) icqueriestypes.QueryCallbacks

func (ICQCallbacks) CallICQCallback

func (c ICQCallbacks) CallICQCallback(ctx sdk.Context, id string, args []byte, query icqueriestypes.Query, status icqueriestypes.QueryResponseStatus) error

func (ICQCallbacks) HasICQCallback

func (c ICQCallbacks) HasICQCallback(id string) bool

func (ICQCallbacks) RegisterICQCallbacks

func (c ICQCallbacks) RegisterICQCallbacks() icqueriestypes.QueryCallbacks

type Keeper

type Keeper struct {
	AccountKeeper       account.AccountKeeper
	IBCKeeper           ibckeeper.Keeper
	IBCTransferKeeper   ibctransferkeeper.Keeper
	ICAControllerKeeper icacontrollerkeeper.Keeper
	ICACallbacksKeeper  icacallbackskeeper.Keeper
	ICQueriesKeeper     icquerieskeeper.Keeper
	BankKeeper          bankkeeper.Keeper
	DistributionKeeper  *distributionkeeper.Keeper
	StakingKeeper       *stakingkeeper.Keeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace,
	accountKeeper account.AccountKeeper, ibcKeeper ibckeeper.Keeper, ibcTransferKeeper ibctransferkeeper.Keeper, icaKeeper icacontrollerkeeper.Keeper, icaCallbacksKeeper icacallbackskeeper.Keeper,
	icqueriesKeeper icquerieskeeper.Keeper, bank bankkeeper.Keeper, distribution *distributionkeeper.Keeper, stakingKeeper *stakingkeeper.Keeper,
) *Keeper

NewKeeper Initialize the keeper with the base params

func (Keeper) AddDeposit

func (k Keeper) AddDeposit(ctx sdk.Context, deposit *types.Deposit)

AddDeposit adds a deposit to a pool and account A new depositID is generated if not provided - adds it to the pool {pool_id, deposit_id} - adds it to the account {address, pool_id, deposit_id} deposits

func (Keeper) AddEpochUnbonding added in v1.5.2

func (k Keeper) AddEpochUnbonding(ctx sdk.Context, withdrawal types.Withdrawal, isUndelegateRetry bool) error

AddEpochUnbonding adds an epoch unbonding record that serves to undelegate withdrawals via batches

func (Keeper) AddFailedIcaUndelegationsToEpochUnbonding added in v1.5.2

func (k Keeper) AddFailedIcaUndelegationsToEpochUnbonding(ctx sdk.Context) error

AddFailedIcaUndelegationsToEpochUnbonding add failed ica withdrawals to current epoch unbonding record

func (Keeper) AddPool

func (k Keeper) AddPool(ctx sdk.Context, pool *types.Pool)

AddPool Set a pool structure in the KVStore for a given pool ID

func (Keeper) AddPrize

func (k Keeper) AddPrize(ctx sdk.Context, prize types.Prize)

AddPrizes adds a prize to a pool and an account A new prizeID is generated if not provided - adds it to the pool {pool_id, draw_id, prize_id} - adds it to the account {winner_address, pool_id, draw_id} prizes

func (Keeper) AddWithdrawal

func (k Keeper) AddWithdrawal(ctx sdk.Context, withdrawal types.Withdrawal)

AddWithdrawal adds a withdrawDeposit to a pool and account - adds it to the pool {pool_id, withdrawal_id} - adds it to the account {depositor_address, pool_id, withdrawal_id} withdrawDeposits

func (Keeper) AddWithdrawalToNextAvailableEpoch added in v1.5.2

func (k Keeper) AddWithdrawalToNextAvailableEpoch(ctx sdk.Context, withdrawal types.Withdrawal) error

AddWithdrawalToNextAvailableEpoch adds a withdrawal to the next available epoch unbonding

func (Keeper) AfterEpochEnd added in v1.5.2

func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

func (Keeper) BeforeEpochStart added in v1.5.2

func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo epochstypes.EpochInfo)

BeforeEpochStart is a hook triggered every defined epoch Currently triggers the undelegation of epochUnbonding withdrawals

func (Keeper) BlockPoolUpdates

func (k Keeper) BlockPoolUpdates(ctx sdk.Context) (successCount, errorCount int)

BlockPoolUpdates runs all pool updates and draws Called in each BeginBlock

func (Keeper) BlockPrizeUpdates

func (k Keeper) BlockPrizeUpdates(ctx sdk.Context) (successCount, errorCount int)

BlockPrizeUpdates runs all prize updates (clawback) Called in each EndBlock

func (Keeper) BlockWithdrawalUpdates

func (k Keeper) BlockWithdrawalUpdates(ctx sdk.Context) (successCount, errorCount int)

BlockWithdrawalUpdates runs all matured withdrawals updates (transfer post unbonding) Called in each EndBlock

func (Keeper) BroadcastIBCTransfer added in v1.6.0

func (k Keeper) BroadcastIBCTransfer(ctx sdk.Context, pool types.Pool, amount sdk.Coin, timeoutNanos uint64, callbackID string, callbackArgs []byte) (uint64, error)

BroadcastIBCTransfer broadcasts and IBC transfer for the a given amount to the Pool remote zone ICA Deposit account from the Pool Local address Amount denom must be based on pool.Denom Also registers the requested callback This method should not and DOEST NOT update the pool state

func (Keeper) BroadcastICAMessages

func (k Keeper) BroadcastICAMessages(ctx sdk.Context, pool types.Pool, accountType string, msgs []sdk.Msg, timeoutNanos uint64, callbackID string, callbackArgs []byte) (uint64, error)

BroadcastICAMessages broadcasts ICA transaction containing the specified Messages Also registers the requested callback This method should not and DOEST NOT update the pool state

func (Keeper) BroadcastICQuery added in v1.6.0

func (k Keeper) BroadcastICQuery(ctx sdk.Context, pool types.Pool, callbackID string, extraID string, queryType string, queryData []byte, timeoutPolicy icqueriestypes.TimeoutPolicy, timeoutTimestamp time.Duration) error

BroadcastICQuery broadcasts an ICQ query Also registeres the requested callback This method should not and DOEST NOT update the pool state

func (Keeper) ClaimYieldOnRemoteZone added in v1.6.0

func (k Keeper) ClaimYieldOnRemoteZone(ctx sdk.Context, poolID uint64, drawID uint64) (*types.Draw, error)

ClaimYieldOnRemoteZone Claim staking rewards from the native chain validators - wait for the ICA callback to move to OnClaimYieldOnRemoteZoneCompleted - or go to OnClaimYieldOnRemoteZoneCompleted directly upon claim rewards success if local zone

func (Keeper) ClawBackPrize

func (k Keeper) ClawBackPrize(ctx sdk.Context, poolID uint64, drawID uint64, prizeID uint64) error

ClawBackPrize claw backs a prize by adding its amount to the clawback prize pool

func (Keeper) ClosePool added in v1.6.5

func (k Keeper) ClosePool(ctx sdk.Context, poolID uint64) error

ClosePool iterate through many stages to close a Pool based on its local state, deposits and withdrawals

Closing procedure steps: 1. Move pool into state Closing 2. Launch the final Draw 3. Launch the withdrawal of all the deposits 4. Wait for all withdrawals to complete

func (Keeper) ComputeDepositsTWB

func (k Keeper) ComputeDepositsTWB(ctx sdk.Context, depositStartAt time.Time, drawAt time.Time, deposits []types.Deposit) []DepositTWB

ComputeDepositsTWB takes deposits and computes the weight based on their deposit time and the draw duration It essentially computes the Time Weighted Balance of each deposit for the DrawPrizes phase

func (Keeper) ComputeRandomSeed added in v1.6.0

func (k Keeper) ComputeRandomSeed(ctx sdk.Context) int64

func (Keeper) DelegateDepositOnRemoteZone added in v1.6.0

func (k Keeper) DelegateDepositOnRemoteZone(ctx sdk.Context, poolID uint64, depositID uint64) error

DelegateDepositOnRemoteZone Delegates a deposit on the remote zone (put it to work) - wait for the ICA callback to move to OnDelegateDepositOnRemoteZoneCompleted - or go to OnDelegateDepositOnRemoteZoneCompleted directly if local zone

func (Keeper) DequeueEPCBQueue

func (k Keeper) DequeueEPCBQueue(ctx sdk.Context, endTime time.Time) (prizes []types.PrizeIDs)

DequeueEPCBQueue return all the Expired Prizes to Claw Back and remove them from the queue

func (Keeper) DequeueMaturedWithdrawalQueue

func (k Keeper) DequeueMaturedWithdrawalQueue(ctx sdk.Context, endTime time.Time) (withdrawalsIDs []types.WithdrawalIDs)

DequeueMaturedWithdrawalQueue return all the Matured Withdrawals that can be transfered and can be removed from the queue

func (Keeper) DistributePrizes

func (k Keeper) DistributePrizes(ctx sdk.Context, fc *feeManager, dRes DrawResult, draw types.Draw) error

DistributePrizes distributes the prizes if they have a winner

func (Keeper) DrawsIterator

func (k Keeper) DrawsIterator(ctx sdk.Context) sdk.Iterator

DrawsIterator Return a ready to use iterator for the draws store (all draws from all pools)

func (Keeper) EPCBQueueIterator

func (k Keeper) EPCBQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

EPCBQueueIterator returns an iterator for the EPCB queue up to the specified endTime

func (Keeper) EditDeposit added in v1.5.0

func (k Keeper) EditDeposit(ctx sdk.Context, poolID uint64, depositID uint64, winnerAddr sdk.AccAddress, isSponsor bool) error

EditDeposit edits a deposit winnerAddr and sponsor mode

func (Keeper) ExecuteDraw

func (k Keeper) ExecuteDraw(ctx sdk.Context, poolID uint64, drawID uint64) (*types.Draw, error)

ExecuteDraw completes the draw phases by effectively drawing prizes This is the last phase of a Draw WARNING: this method can eventually commit critical partial store updates if the caller does not return on error

func (Keeper) GetChainID

func (k Keeper) GetChainID(ctx sdk.Context, connectionID string) (string, error)

GetChainID Return the chain ID fetched from the ibc connection layer

func (Keeper) GetConnectionID

func (k Keeper) GetConnectionID(ctx sdk.Context, portId string) (string, error)

func (Keeper) GetEpochPoolUnbonding added in v1.5.2

func (k Keeper) GetEpochPoolUnbonding(ctx sdk.Context, epochID uint64, poolID uint64) (types.EpochUnbonding, error)

GetEpochPoolUnbonding gets an epoch unbonding by its epochNumber and poolID

func (Keeper) GetEpochTracker added in v1.5.2

func (k Keeper) GetEpochTracker(ctx sdk.Context, epochIdentifier string, trackerType string) (types.EpochTracker, error)

GetEpochTracker gets the internal epoch tracker

func (Keeper) GetEpochUnbondings added in v1.5.2

func (k Keeper) GetEpochUnbondings(ctx sdk.Context, epochID uint64) (epochUnbondings []types.EpochUnbonding)

GetEpochUnbondings lists the epoch unbondings by epochID

func (Keeper) GetNextDepositID

func (k Keeper) GetNextDepositID(ctx sdk.Context) uint64

GetNextDepositID gets the next deposit ID

func (Keeper) GetNextDepositIdAndIncrement

func (k Keeper) GetNextDepositIdAndIncrement(ctx sdk.Context) uint64

GetNextDepositIdAndIncrement gets the next deposit ID and store the incremented ID

func (Keeper) GetNextPoolID

func (k Keeper) GetNextPoolID(ctx sdk.Context) uint64

GetNextPoolID Return the next pool id to be used

func (Keeper) GetNextPoolIDAndIncrement

func (k Keeper) GetNextPoolIDAndIncrement(ctx sdk.Context) uint64

func (Keeper) GetNextPrizeID

func (k Keeper) GetNextPrizeID(ctx sdk.Context) uint64

GetNextPrizeID gets the next prize ID

func (Keeper) GetNextPrizeIdAndIncrement

func (k Keeper) GetNextPrizeIdAndIncrement(ctx sdk.Context) uint64

GetNextPrizeIdAndIncrement gets the next prize ID and store the incremented ID

func (Keeper) GetNextWithdrawalID

func (k Keeper) GetNextWithdrawalID(ctx sdk.Context) uint64

GetNextWithdrawalID gets the next withdrawal deposit ID

func (Keeper) GetNextWithdrawalIdAndIncrement

func (k Keeper) GetNextWithdrawalIdAndIncrement(ctx sdk.Context) uint64

GetNextWithdrawalIdAndIncrement gets the next withdrawal ID and store the incremented ID

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

func (Keeper) GetPool

func (k Keeper) GetPool(ctx sdk.Context, poolID uint64) (types.Pool, error)

GetPool Returns a pool instance for the given poolID

func (Keeper) GetPoolDeposit

func (k Keeper) GetPoolDeposit(ctx sdk.Context, poolID uint64, depositID uint64) (types.Deposit, error)

GetPoolDeposit returns a deposit by ID for a given poolID

func (Keeper) GetPoolDraw

func (k Keeper) GetPoolDraw(ctx sdk.Context, poolID uint64, drawID uint64) (types.Draw, error)

GetPoolDraw Returns a draw instance for the given poolID and drawID combination

func (Keeper) GetPoolDrawPrize

func (k Keeper) GetPoolDrawPrize(ctx sdk.Context, poolID uint64, drawID uint64, prizeID uint64) (types.Prize, error)

GetPoolDrawPrize returns a prize by poolID, drawID, prizeID

func (Keeper) GetPoolForChainID

func (k Keeper) GetPoolForChainID(ctx sdk.Context, chainID string) (types.Pool, bool)

func (Keeper) GetPoolForConnectionID

func (k Keeper) GetPoolForConnectionID(ctx sdk.Context, connectionID string) (types.Pool, bool)

func (Keeper) GetPoolForControllerPortID

func (k Keeper) GetPoolForControllerPortID(ctx sdk.Context, controllerPortID string) (types.Pool, bool)

func (Keeper) GetPoolRunner added in v1.6.0

func (k Keeper) GetPoolRunner(poolType types.PoolType) (PoolRunner, error)

GetPoolRunner returns the Pool Runner for the specified Pool Type returns an error if no runner registered for this Pool Type

func (Keeper) GetPoolWithdrawal

func (k Keeper) GetPoolWithdrawal(ctx sdk.Context, poolID uint64, withdrawalID uint64) (types.Withdrawal, error)

GetPoolWithdrawal returns a withdrawal by poolID, withdrawalID

func (Keeper) GetPrizeIDsEPCBQueue

func (k Keeper) GetPrizeIDsEPCBQueue(ctx sdk.Context, timestamp time.Time) (col types.PrizeIDsCollection)

GetPrizeIDsEPCBQueue gets a prize IDs collection for the expiring timestamp

func (Keeper) GetUnbondingCompletionTime added in v1.5.2

func (k Keeper) GetUnbondingCompletionTime(ctx sdk.Context, msgResponses [][]byte) (*time.Time, error)

Get the latest completion time across each MsgUndelegate in the ICA transaction

func (Keeper) GetWithdrawalIDsMaturedQueue

func (k Keeper) GetWithdrawalIDsMaturedQueue(ctx sdk.Context, timestamp time.Time) (col types.WithdrawalIDsCollection)

GetWithdrawalIDsMaturedQueue gets a withdrawal IDs collection for the matured unbonding timestamp

func (Keeper) HasPool

func (k Keeper) HasPool(ctx sdk.Context, poolID uint64) bool

HasPool Returns a boolean that indicates if the given poolID exists in the KVStore or not

func (Keeper) HasPoolDraw

func (k Keeper) HasPoolDraw(ctx sdk.Context, poolID uint64, drawID uint64) bool

HasPoolDraw Returns a boolean that indicates if the given poolID and drawID combination exists in the KVStore or not

func (Keeper) Hooks added in v1.5.2

func (k Keeper) Hooks() Hooks

func (Keeper) ICACallbackHandler

func (k Keeper) ICACallbackHandler() ICACallbacks

func (Keeper) ICQCallbackHandler

func (k Keeper) ICQCallbackHandler() ICQCallbacks

func (Keeper) IterateDraws

func (k Keeper) IterateDraws(ctx sdk.Context, cb func(draw types.Draw) bool)

IterateDraws Iterate over the draws store (all draws from all pools), and for each entry call the callback

func (Keeper) IteratePoolDraws

func (k Keeper) IteratePoolDraws(ctx sdk.Context, poolID uint64, cb func(draw types.Draw) bool)

IteratePoolDraws Iterates over a pool draws store, and for each entry call the callback

func (Keeper) IteratePools

func (k Keeper) IteratePools(ctx sdk.Context, callback func(pool types.Pool) (stop bool))

IteratePools Iterate over the pools, and for each entry call the callback

func (Keeper) LaunchNewDraw

func (k Keeper) LaunchNewDraw(ctx sdk.Context, poolID uint64) (*types.Draw, error)

LaunchNewDraw initiates a new draw and triggers the ICA get reward phase See UpdateDrawAtStateICAOp for next phase

func (Keeper) ListAccountDeposits

func (k Keeper) ListAccountDeposits(ctx sdk.Context, addr sdk.Address) (deposits []types.Deposit)

ListAccountDeposits return deposits all the deposits for an address Warning: expensive operation

func (Keeper) ListAccountPoolDeposits

func (k Keeper) ListAccountPoolDeposits(ctx sdk.Context, addr sdk.Address, poolID uint64) (deposits []types.Deposit)

ListAccountPoolDeposits return all the deposits for and address and a poolID Warning: expensive operation

func (Keeper) ListAccountPoolPrizes

func (k Keeper) ListAccountPoolPrizes(ctx sdk.Context, addr sdk.Address, poolID uint64) (prizes []types.Prize)

ListAccountPoolPrizes return all the prizes for an account and a pool Warning: expensive operation

func (Keeper) ListAccountPoolWithdrawals

func (k Keeper) ListAccountPoolWithdrawals(ctx sdk.Context, addr sdk.Address, poolID uint64) (withdrawals []types.Withdrawal)

ListAccountPoolWithdrawals return all the withdrawals for and address and a poolID Warning: expensive operation

func (Keeper) ListAccountPrizes

func (k Keeper) ListAccountPrizes(ctx sdk.Context, addr sdk.Address) (prizes []types.Prize)

ListAccountPrizes return all the prizes for an account Warning: expensive operation

func (Keeper) ListAccountWithdrawals

func (k Keeper) ListAccountWithdrawals(ctx sdk.Context, addr sdk.Address) (withdrawals []types.Withdrawal)

ListAccountWithdrawals return all the withdraw deposits account Warning: expensive operation

func (Keeper) ListDeposits

func (k Keeper) ListDeposits(ctx sdk.Context) (deposits []types.Deposit)

ListDeposits return all the deposits for and address Warning: expensive operation

func (Keeper) ListDraws

func (k Keeper) ListDraws(ctx sdk.Context) (draws []types.Draw)

ListDraws return the full draws list (all draws from all pools) expensive operation that should only be used by Genesis like features

func (Keeper) ListEpochTrackers added in v1.5.2

func (k Keeper) ListEpochTrackers(ctx sdk.Context) (list []types.EpochTracker)

func (Keeper) ListEpochUnbondings added in v1.6.3

func (k Keeper) ListEpochUnbondings(ctx sdk.Context) (list []types.EpochUnbonding)

func (Keeper) ListPoolDeposits

func (k Keeper) ListPoolDeposits(ctx sdk.Context, poolID uint64) (deposits []types.Deposit)

ListPoolDeposits returns all deposits for a given poolID Warning: expensive operation

func (Keeper) ListPoolDrawPrizes

func (k Keeper) ListPoolDrawPrizes(ctx sdk.Context, poolID uint64, drawID uint64) (prizes []types.Prize)

ListPoolDrawPrizes return all the prizes for a pool draw Warning: expensive operation

func (Keeper) ListPoolDraws

func (k Keeper) ListPoolDraws(ctx sdk.Context, poolID uint64) (draws []types.Draw)

ListPoolDraws return the full pool draws list expensive operation that should only be used by Genesis like features and unittests

func (Keeper) ListPoolPrizes

func (k Keeper) ListPoolPrizes(ctx sdk.Context, poolID uint64) (prizes []types.Prize)

ListPoolPrizes return all the prizes for a pool Warning: expensive operation

func (Keeper) ListPoolWithdrawals

func (k Keeper) ListPoolWithdrawals(ctx sdk.Context, poolID uint64) (withdrawals []types.Withdrawal)

ListPoolWithdrawals returns all withdrawals for a given poolID Warning: expensive operation

func (Keeper) ListPools

func (k Keeper) ListPools(ctx sdk.Context) (pools []types.Pool)

ListPools Return the pools

func (Keeper) ListPoolsToDraw

func (k Keeper) ListPoolsToDraw(ctx sdk.Context) (pools []types.Pool)

ListPoolsToDraw Returns the pools which should be launching a Draw

func (Keeper) ListPrizes

func (k Keeper) ListPrizes(ctx sdk.Context) (prizes []types.Prize)

ListPrizes return all the prizes for an address Warning: expensive operation

func (Keeper) ListWithdrawals

func (k Keeper) ListWithdrawals(ctx sdk.Context) (withdrawals []types.Withdrawal)

ListWithdrawals return all the withdrawals Warning: expensive operation

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger Return a keeper logger instance

func (Keeper) MarshalBankSendCallbackArgs added in v1.5.0

func (k Keeper) MarshalBankSendCallbackArgs(ctx sdk.Context, bankSendCallback types.BankSendCallback) ([]byte, error)

MarshalSendBankTransferFromNativeCallbackArgs Marshal SendBankTransferFromNativeCallback arguments

func (Keeper) MarshalClaimCallbackArgs

func (k Keeper) MarshalClaimCallbackArgs(ctx sdk.Context, claimCallback types.ClaimRewardsCallback) ([]byte, error)

MarshalClaimCallbackArgs Marshal claim ClaimCallback arguments

func (Keeper) MarshalDelegateCallbackArgs

func (k Keeper) MarshalDelegateCallbackArgs(ctx sdk.Context, delegateCallback types.DelegateCallback) ([]byte, error)

MarshalDelegateCallbackArgs Marshal delegate DelegateCallback arguments

func (Keeper) MarshalRedelegateCallbackArgs

func (k Keeper) MarshalRedelegateCallbackArgs(ctx sdk.Context, redelegateCallback types.RedelegateCallback) ([]byte, error)

MarshalRedelegateCallbackArgs Marshal delegate RedelegateCallback arguments

func (Keeper) MarshalSetWithdrawAddressCallbackArgs

func (k Keeper) MarshalSetWithdrawAddressCallbackArgs(ctx sdk.Context, setWithdrawAddrCallback types.SetWithdrawAddressCallback) ([]byte, error)

MarshalSetWithdrawAddressCallbackArgs Marshal delegate RedelegateCallback arguments

func (Keeper) MarshalTransferFromNativeCallbackArgs

func (k Keeper) MarshalTransferFromNativeCallbackArgs(ctx sdk.Context, transferCallback types.TransferFromNativeCallback) ([]byte, error)

MarshalTransferFromNativeCallbackArgs Marshal TransferFromNativeCallback arguments

func (Keeper) MarshalTransferToNativeCallbackArgs

func (k Keeper) MarshalTransferToNativeCallbackArgs(ctx sdk.Context, transferCallback types.TransferToNativeCallback) ([]byte, error)

MarshalTransferToNativeCallbackArgs Marshal TransferToNativeCallback arguments

func (Keeper) MarshalUndelegateCallbackArgs

func (k Keeper) MarshalUndelegateCallbackArgs(ctx sdk.Context, undelegateCallback types.UndelegateCallback) ([]byte, error)

MarshalUndelegateCallbackArgs Marshal delegate UndelegateCallback arguments

func (Keeper) MaturedWithdrawalQueueIterator

func (k Keeper) MaturedWithdrawalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

MaturedWithdrawalQueueIterator returns an iterator for the Withdrawal Matured queue up to the specified endTime

func (Keeper) MustGetPoolRunner added in v1.6.0

func (k Keeper) MustGetPoolRunner(poolType types.PoolType) PoolRunner

MustGetPoolRunner runs GetPoolRunner and panic in case of error

func (Keeper) NewFeeManager added in v1.6.4

func (k Keeper) NewFeeManager(ctx sdk.Context, pool types.Pool) *feeManager

func (Keeper) OnClaimYieldOnRemoteZoneCompleted added in v1.6.0

func (k Keeper) OnClaimYieldOnRemoteZoneCompleted(ctx sdk.Context, poolID uint64, drawID uint64, isError bool) (*types.Draw, error)

OnClaimYieldOnRemoteZoneCompleted Acknowledge the ICA claim rewards from the native chain validators response and trigger an ICQ if success

func (Keeper) OnDelegateDepositOnRemoteZoneCompleted added in v1.6.0

func (k Keeper) OnDelegateDepositOnRemoteZoneCompleted(ctx sdk.Context, poolID uint64, depositID uint64, splits []*types.SplitDelegation, isError bool) error

OnDelegateDepositOnRemoteZoneCompleted Acknowledge the ICA operation to delegate a deposit on the remote zone (deposit has been put to work)

func (Keeper) OnExecuteDrawCompleted added in v1.5.0

func (k Keeper) OnExecuteDrawCompleted(ctx sdk.Context, pool *types.Pool, draw *types.Draw, err error) (*types.Draw, error)

OnExecuteDrawCompleted wrappers for draw state update upon drawing phase completion returns the error specified in parameters and does not produce any internal error

func (Keeper) OnQueryFreshPrizePoolCoinsOnRemoteZoneCompleted added in v1.6.0

func (k Keeper) OnQueryFreshPrizePoolCoinsOnRemoteZoneCompleted(ctx sdk.Context, poolID uint64, drawID uint64, coins sdk.Coins, isError bool) (*types.Draw, error)

OnQueryFreshPrizePoolCoinsOnRemoteZoneCompleted Acknowledge the ICQ query rewards from the remote zone and moves to next step

func (Keeper) OnRedelegateToActiveValidatorsOnRemoteZoneCompleted added in v1.6.0

func (k Keeper) OnRedelegateToActiveValidatorsOnRemoteZoneCompleted(ctx sdk.Context, poolID uint64, valSrcAddr string, splits []*types.SplitDelegation, isError bool) error

OnRedelegateToActiveValidatorsOnRemoteZoneCompleted Acknowledged a redelegation of an inactive validator's bondedAmount

func (Keeper) OnSetupPoolICACompleted

func (k Keeper) OnSetupPoolICACompleted(ctx sdk.Context, poolID uint64, icaType string, icaAddress string) (*types.Pool, error)

OnPoolICASetupCompleted Acknowledge the ICA account creation on the native chain then moves to SetupPoolWithdrawalAddress once all ICA accounts have been created

func (Keeper) OnSetupPoolWithdrawalAddressCompleted

func (k Keeper) OnSetupPoolWithdrawalAddressCompleted(ctx sdk.Context, poolID uint64) (*types.Pool, error)

OnSetupPoolWithdrawalAddressCompleted Acknowledge the withdrawal address configuration on the native chain then sets the pool to status ready in case of success

func (Keeper) OnTransferDepositToRemoteZoneCompleted added in v1.6.0

func (k Keeper) OnTransferDepositToRemoteZoneCompleted(ctx sdk.Context, poolID uint64, depositID uint64, isError bool) error

OnTransferDepositToRemoteZoneCompleted Acknowledge the IBC transfer to a remote zone response then moves to DelegateDepositOnRemoteZone in case of success

func (Keeper) OnTransferFreshPrizePoolCoinsToLocalZoneCompleted added in v1.6.0

func (k Keeper) OnTransferFreshPrizePoolCoinsToLocalZoneCompleted(ctx sdk.Context, poolID uint64, drawID uint64, isError bool) (*types.Draw, error)

OnTransferFreshPrizePoolCoinsToLocalZoneCompleted Acknowledge the transfer of the claimed rewards finalises the Draw if success

func (Keeper) OnTransferWithdrawalToRecipientCompleted added in v1.6.0

func (k Keeper) OnTransferWithdrawalToRecipientCompleted(ctx sdk.Context, poolID uint64, withdrawalID uint64, isError bool) error

OnTransferWithdrawalToRecipientCompleted Acknowledge the withdrawal IBC transfer - To the local chain response if it's a transfer to local chain - To the native chain if it's BankSend for a native pool with a native destination address

func (Keeper) OnUndelegateWithdrawalsOnRemoteZoneCompleted added in v1.5.2

func (k Keeper) OnUndelegateWithdrawalsOnRemoteZoneCompleted(ctx sdk.Context, poolID uint64, withdrawalIDs []uint64, unbondingEndsAt *time.Time, isError bool) error

OnUndelegateWithdrawalsOnRemoteZoneCompleted aknowledged the undelegate callback If error occurs send the withdrawal to a new epoch unbonding

func (Keeper) PoolDrawsIterator

func (k Keeper) PoolDrawsIterator(ctx sdk.Context, poolID uint64) sdk.Iterator

PoolDrawsIterator Return a ready to use iterator for a pool draws store

func (Keeper) PoolsIterator

func (k Keeper) PoolsIterator(ctx sdk.Context) sdk.Iterator

PoolsIterator Return a ready to use iterator for the pools store

func (Keeper) QueryFreshPrizePoolCoinsOnRemoteZone added in v1.6.0

func (k Keeper) QueryFreshPrizePoolCoinsOnRemoteZone(ctx sdk.Context, poolID uint64, drawID uint64) (*types.Draw, error)

QueryFreshPrizePoolCoinsOnRemoteZone query the available rewards on the remote zone - wait for the ICQ callback to move to OnQueryFreshPrizePoolCoinsOnRemoteZoneCompleted - or go to OnQueryFreshPrizePoolCoinsOnRemoteZoneCompleted directly upon query rewards success if local zone

func (Keeper) RebalanceValidatorsBondings added in v1.5.0

func (k Keeper) RebalanceValidatorsBondings(ctx sdk.Context, poolID uint64) error

RebalanceValidatorsBondings allows rebalancing of validators bonded assets Current implementation: - Initiate an even redelegate distribution from inactive bonded validators to active validators

func (Keeper) RedelegateToActiveValidatorsOnRemoteZone added in v1.6.0

func (k Keeper) RedelegateToActiveValidatorsOnRemoteZone(ctx sdk.Context, poolID uint64, valSrcAddr string) error

RedelegateToActiveValidatorsOnRemoteZone redistribute evenly the bondedAmount from the bonded inactive to the active valitator set of the pool

func (Keeper) RegisterPool

func (k Keeper) RegisterPool(
	ctx sdk.Context,
	poolType types.PoolType,
	denom, nativeDenom, chainId, connectionId, transferChannelId string,
	vals []string,
	bech32Acc, bech32Val string,
	minDepositAmount math.Int,
	UnbondingDuration time.Duration,
	maxUnbondingEntries math.Int,
	drawSchedule types.DrawSchedule,
	prizeStrategy types.PrizeStrategy,
	fees []types.FeeTaker,
) (uint64, error)

RegisterPool Register a given pool from the transaction message

func (*Keeper) RegisterPoolRunners added in v1.6.0

func (k *Keeper) RegisterPoolRunners()

RegisterPoolRunners register all know Pool Runners

func (Keeper) RemoveDeposit

func (k Keeper) RemoveDeposit(ctx sdk.Context, deposit *types.Deposit)

RemoveDeposit removes a deposit from a pool - removes it from the {pool_id, deposit_id} - removes it from the {address, pool_id, deposit_id} deposits

func (Keeper) RemoveEpochUnbonding added in v1.5.2

func (k Keeper) RemoveEpochUnbonding(ctx sdk.Context, epochUnbonding types.EpochUnbonding) error

RemoveEpochUnbonding removes an epoch unbonding after each epoch

func (Keeper) RemovePrize

func (k Keeper) RemovePrize(ctx sdk.Context, prize types.Prize) error

RemovePrize removes a prize from the store

func (Keeper) RemoveWithdrawal

func (k Keeper) RemoveWithdrawal(ctx sdk.Context, withdrawal types.Withdrawal) error

RemoveWithdrawal removes a successful withdrawal for a given account and pool

func (Keeper) RunDrawPrizes

func (k Keeper) RunDrawPrizes(ctx sdk.Context, prizePool sdk.Coin, prizeStrat types.PrizeStrategy, deposits []DepositTWB, randSeed int64) (result DrawResult, err error)

RunDrawPrizes computes available prizes and draws the prizes and their potential winners based on the specified prize strategy this method does not store nor send anything, it only computes the DrawResult

func (Keeper) RunDrawPrizesWithUniques added in v1.5.0

func (k Keeper) RunDrawPrizesWithUniques(ctx sdk.Context, prizePool sdk.Coin, prizeStrat types.PrizeStrategy, deposits []DepositTWB, randSeed int64) (result DrawResult, err error)

RunDrawPrizesWithUniques computes available prizes and draws the prizes and their potential winners based on the specified prize strategy this method does not store nor send anything, it only computes the DrawResult this is a variant of RunDrawPrizes which takes into account unique prize batches (i.e: the kind of prize which prevent a winner to win other prizes)

func (Keeper) SetEpochPoolUnbonding added in v1.5.2

func (k Keeper) SetEpochPoolUnbonding(ctx sdk.Context, epochUnbonding types.EpochUnbonding)

SetEpochPoolUnbonding sets an epoch unbonding by its epochNumber and poolID

func (Keeper) SetEpochTracker added in v1.5.2

func (k Keeper) SetEpochTracker(ctx sdk.Context, epochTracker types.EpochTracker, trackerType string)

SetEpochTracker sets the internal epoch tracker

func (Keeper) SetEpochUnbonding added in v1.6.3

func (k Keeper) SetEpochUnbonding(ctx sdk.Context, epochUnbonding types.EpochUnbonding)

SetEpochUnbonding sets the internal epoch unbondings

func (Keeper) SetNextDepositID

func (k Keeper) SetNextDepositID(ctx sdk.Context, depositId uint64)

SetNextDepositID sets next deposit ID

func (Keeper) SetNextPoolID

func (k Keeper) SetNextPoolID(ctx sdk.Context, poolId uint64)

SetNextPoolID sets next pool ID

func (Keeper) SetNextPrizeID

func (k Keeper) SetNextPrizeID(ctx sdk.Context, prizeID uint64)

SetNextPrizeID sets next prize ID

func (Keeper) SetNextWithdrawalID

func (k Keeper) SetNextWithdrawalID(ctx sdk.Context, withdrawalID uint64)

SetNextWithdrawalID sets next withdrawal ID

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

func (Keeper) SetPoolDraw

func (k Keeper) SetPoolDraw(ctx sdk.Context, draw types.Draw)

SetPoolDraw Sets a draw result in the KVStore for a given poolID and drawID

func (Keeper) SetupPoolICA

func (k Keeper) SetupPoolICA(ctx sdk.Context, poolID uint64) (*types.Pool, error)

SetupPoolICA registers the ICA account on the native chain - waits for the ICA callback to move to OnSetupPoolICACompleted - or go to OnSetupPoolICACompleted directly if local zone

func (Keeper) SetupPoolWithdrawalAddress

func (k Keeper) SetupPoolWithdrawalAddress(ctx sdk.Context, poolID uint64) (*types.Pool, error)

SetupPoolWithdrawalAddress sets the PrizePoolAddress as the Staking withdrawal address for the DepositAddress - waits for the ICA callback to move to OnSetupPoolWithdrawalAddressCompleted - or go to OnSetupPoolWithdrawalAddressCompleted directly upon setting up the withdrawal address if local zone

func (Keeper) TransferDepositToRemoteZone added in v1.6.0

func (k Keeper) TransferDepositToRemoteZone(ctx sdk.Context, poolID uint64, depositID uint64) error

TransferDepositToRemoteZone Transfer a deposit to a remote zone - wait for the ICA callback to move to OnTransferDepositToRemoteZoneCompleted - or go to OnTransferDepositToRemoteZoneCompleted directly if local zone (no-op)

func (Keeper) TransferFreshPrizePoolCoinsToLocalZone added in v1.6.0

func (k Keeper) TransferFreshPrizePoolCoinsToLocalZone(ctx sdk.Context, poolID uint64, drawID uint64) (*types.Draw, error)

TransferFreshPrizePoolCoinsToLocalZone Transfer the claimed rewards to the local chain - wait for the ICA callback to move to OnTransferFreshPrizePoolCoinsToLocalZoneCompleted - or go to OnTransferFreshPrizePoolCoinsToLocalZoneCompleted directly if local zone

func (Keeper) TransferWithdrawalToRecipient added in v1.6.0

func (k Keeper) TransferWithdrawalToRecipient(ctx sdk.Context, poolID uint64, withdrawalID uint64) error

TransferWithdrawalToRecipient transfers a withdrawal to its destination address - If local zone and local toAddress: BankSend with instant call to OnTransferWithdrawalToRecipientCompleted - If remote zone and remote toAddress: ICA BankSend and wait for ICA callback - If remote zone and local toAddress: IBC Transfer and wait for ICA callback

func (Keeper) UndelegateWithdrawalsOnRemoteZone added in v1.5.2

func (k Keeper) UndelegateWithdrawalsOnRemoteZone(ctx sdk.Context, epochUnbonding types.EpochUnbonding) error

UndelegateWithdrawalsOnRemoteZone Undelegates an epoch unbonding containing withdrawalIDs from the native chain validators - go to OnUndelegateWithdrawalsOnRemoteZoneCompleted directly upon undelegate success if local zone - or wait for the ICA callback to move to OnUndelegateWithdrawalsOnRemoteZoneCompleted

func (Keeper) UnmarshalBankSendCallbackArgs added in v1.5.0

func (k Keeper) UnmarshalBankSendCallbackArgs(ctx sdk.Context, bankSendCallback []byte) (*types.BankSendCallback, error)

UnmarshalSendBankTransferFromNativeCallbackArgs Unmarshal SendBankTransferFromNativeCallback arguments

func (Keeper) UnmarshalClaimCallbackArgs

func (k Keeper) UnmarshalClaimCallbackArgs(ctx sdk.Context, claimCallback []byte) (*types.ClaimRewardsCallback, error)

UnmarshalClaimCallbackArgs Marshal claim callback arguments into a ClaimCallback struct

func (Keeper) UnmarshalDelegateCallbackArgs

func (k Keeper) UnmarshalDelegateCallbackArgs(ctx sdk.Context, delegateCallback []byte) (*types.DelegateCallback, error)

UnmarshalDelegateCallbackArgs Marshal delegate callback arguments into a DelegateCallback struct

func (Keeper) UnmarshalRedelegateCallbackArgs

func (k Keeper) UnmarshalRedelegateCallbackArgs(ctx sdk.Context, redelegateCallback []byte) (*types.RedelegateCallback, error)

UnmarshalRedelegateCallbackArgs Marshal delegate callback arguments into a RedelegateCallback struct

func (Keeper) UnmarshalSetWithdrawAddressCallbackArgs

func (k Keeper) UnmarshalSetWithdrawAddressCallbackArgs(ctx sdk.Context, setWithdrawAddrCallback []byte) (*types.SetWithdrawAddressCallback, error)

UnmarshalSetWithdrawAddressCallbackArgs Marshal delegate callback arguments into a RedelegateCallback struct

func (Keeper) UnmarshalTransferFromNativeCallbackArgs

func (k Keeper) UnmarshalTransferFromNativeCallbackArgs(ctx sdk.Context, transferCallback []byte) (*types.TransferFromNativeCallback, error)

UnmarshalTransferFromNativeCallbackArgs Marshal callback arguments into a TransferFromNativeCallback struct

func (Keeper) UnmarshalTransferToNativeCallbackArgs

func (k Keeper) UnmarshalTransferToNativeCallbackArgs(ctx sdk.Context, transferCallback []byte) (*types.TransferToNativeCallback, error)

UnmarshalTransferToNativeCallbackArgs Marshal callback arguments into a TransferToNativeCallback struct

func (Keeper) UnmarshalUndelegateCallbackArgs

func (k Keeper) UnmarshalUndelegateCallbackArgs(ctx sdk.Context, undelegateCallback []byte) (*types.UndelegateCallback, error)

UnmarshalUndelegateCallbackArgs Marshal delegate callback arguments into a UndelegateCallback struct

func (Keeper) UnsafeAddPendingWithdrawalsToNewEpochUnbonding added in v1.6.2

func (k Keeper) UnsafeAddPendingWithdrawalsToNewEpochUnbonding(ctx sdk.Context) error

UnsafeAddPendingWithdrawalsToEpochUnbonding raw updates pending withdrawal's epochUnbonding Unsafe and should only be used for store migration

func (Keeper) UnsafeSetUnpersistedDeposits added in v1.6.4

func (k Keeper) UnsafeSetUnpersistedDeposits(ctx sdk.Context) int

func (Keeper) UnsafeSetUnpersistedWithdrawals added in v1.6.4

func (k Keeper) UnsafeSetUnpersistedWithdrawals(ctx sdk.Context) int

func (Keeper) UnsafeUpdatePoolFeeTakers added in v1.6.4

func (k Keeper) UnsafeUpdatePoolFeeTakers(ctx sdk.Context, poolID uint64, feeTakers []types.FeeTaker) (types.Pool, error)

UnsafeUpdatePoolFeeTakers raw updates the fee takers entries Unsafe and should only be used for store migration

func (Keeper) UnsafeUpdatePoolPortIds added in v1.5.0

func (k Keeper) UnsafeUpdatePoolPortIds(ctx sdk.Context, poolID uint64, icaDepositPortId, icaPrizePoolPortId string) (types.Pool, error)

UnsafeUpdatePoolPortIds This method raw update the provided pool port ids. It's heavily unsafe and could break the ICA implementation. It should only be used by store migrations.

func (Keeper) UnsafeUpdatePoolUnbondingFrequencyAndType added in v1.6.1

func (k Keeper) UnsafeUpdatePoolUnbondingFrequencyAndType(ctx sdk.Context, poolID uint64, UnbondingDuration time.Duration, maxUnbondingEntries math.Int, poolType types.PoolType) (types.Pool, error)

UnsafeUpdatePoolUnbondingFrequencyAndType raw updates the UnbondingDuration, mexUnbonding and pool type entries Unsafe and should only be used for store migration

func (Keeper) UpdateDepositStatus

func (k Keeper) UpdateDepositStatus(ctx sdk.Context, poolID uint64, depositID uint64, status types.DepositState, isError bool)

UpdateDepositStatus Update a given deposit status by its ID

func (Keeper) UpdateEpochTracker added in v1.5.2

func (k Keeper) UpdateEpochTracker(ctx sdk.Context, epochInfo epochstypes.EpochInfo, trackerType string) (eTracker types.EpochTracker, err error)

UpdateEpochTracker updates the internal epoch tracker

func (Keeper) UpdateEpochUnbonding added in v1.5.2

func (k Keeper) UpdateEpochUnbonding(ctx sdk.Context, epochPoolUnbonding types.EpochUnbonding, withdrawal types.Withdrawal) error

UpdateEpochUnbonding allows essentially to sum-up the withdrawals as well as metadata

func (Keeper) UpdatePool

func (k Keeper) UpdatePool(
	ctx sdk.Context,
	poolID uint64,
	vals []string,
	minDepositAmount *math.Int,
	UnbondingDuration *time.Duration,
	maxUnbondingEntries *math.Int,
	drawSchedule *types.DrawSchedule,
	prizeStrategy *types.PrizeStrategy,
	state types.PoolState,
	feeTakers []types.FeeTaker,
) error

UpdatePool Update the updatable properties of a pool from the transaction message

func (Keeper) UpdateWithdrawalStatus

func (k Keeper) UpdateWithdrawalStatus(ctx sdk.Context, poolID uint64, withdrawalID uint64, status types.WithdrawalState, unbondingEndsAt *time.Time, isError bool)

UpdateWithdrawalStatus Update a given withdrawal status by its ID

type PoolRunner added in v1.6.0

type PoolRunner interface {
	String() string
	Logger(ctx sdk.Context) log.Logger
	// OnUpdatePool triggered upon pool update proposal
	OnUpdatePool(ctx sdk.Context, pool types.Pool) error
	// SendDepositToPool sends the deposit amount to a local Pool owned address
	SendDepositToPool(ctx sdk.Context, pool types.Pool, deposit types.Deposit) error
	// TransferDepositToRemoteZone transfers the deposit amount from a local Pool owned address to a remote Pool owned address
	TransferDepositToRemoteZone(ctx sdk.Context, pool types.Pool, deposit types.Deposit) error
	// DelegateDepositOnRemoteZone launches an ICA action on the remote Pool owned address (such as delegate coins for native staking Pools)
	DelegateDepositOnRemoteZone(ctx sdk.Context, pool types.Pool, deposit types.Deposit) ([]*types.SplitDelegation, error)
	// UndelegateWithdrawalOnRemoteZone launches and ICA action on the remote Pool owned address (such as undelegate coins for native staking Pools)
	UndelegateWithdrawalsOnRemoteZone(ctx sdk.Context, epochUnbonding types.EpochUnbonding) ([]*types.SplitDelegation, *time.Time, error)
	// RedelegateToActiveValidatorsOnRemoteZone launches an ICA action on the remote pool to redelegate the bonded tokens from inactive to active validators
	RedelegateToActiveValidatorsOnRemoteZone(ctx sdk.Context, pool types.Pool, validator types.PoolValidator, splits []*types.SplitDelegation) error
	// TransferWithdrawalToRecipient transfers the withdrawal amount from a remove Pool owned address to a user owned address
	TransferWithdrawalToRecipient(ctx sdk.Context, pool types.Pool, withdrawal types.Withdrawal) error
	// ClaimYieldOnRemoteZone launches an ICA action on the remote Pool owned address (such as claim rewards for native staking Pools)
	ClaimYieldOnRemoteZone(ctx sdk.Context, pool types.Pool, draw types.Draw) error
	// QueryFreshPrizePoolCoinsOnRemoteZone launches an ICA action on the remote Pool owned address (such as query balance for native staking Pools)
	QueryFreshPrizePoolCoinsOnRemoteZone(ctx sdk.Context, pool types.Pool, draw types.Draw) error
	// TransferFreshPrizePoolCoinsToLocalZone launches an IBC transfer (via ICA) from a remote Pool owned address to a local Pool owned address
	TransferFreshPrizePoolCoinsToLocalZone(ctx sdk.Context, pool types.Pool, draw types.Draw) error
}

PoolRunner interface to implement for all Pool Runners runners are responsible for all coins operations (local, ICA, IBC) runners are NOT responsible and should never update any entity state

type PoolRunnerBase added in v1.6.0

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

PoolRunnerBase common base implementation for Pool Runners

func (*PoolRunnerBase) Logger added in v1.6.0

func (runner *PoolRunnerBase) Logger(ctx sdk.Context) log.Logger

func (*PoolRunnerBase) SendDepositToPool added in v1.6.0

func (runner *PoolRunnerBase) SendDepositToPool(ctx sdk.Context, pool types.Pool, deposit types.Deposit) error

func (*PoolRunnerBase) String added in v1.6.0

func (runner *PoolRunnerBase) String() string

func (*PoolRunnerBase) TransferDepositToRemoteZone added in v1.6.0

func (runner *PoolRunnerBase) TransferDepositToRemoteZone(ctx sdk.Context, pool types.Pool, deposit types.Deposit) error

func (*PoolRunnerBase) TransferFreshPrizePoolCoinsToLocalZone added in v1.6.0

func (runner *PoolRunnerBase) TransferFreshPrizePoolCoinsToLocalZone(ctx sdk.Context, pool types.Pool, draw types.Draw) error

func (*PoolRunnerBase) TransferWithdrawalToRecipient added in v1.6.0

func (runner *PoolRunnerBase) TransferWithdrawalToRecipient(ctx sdk.Context, pool types.Pool, withdrawal types.Withdrawal) error

type PoolRunnerStaking added in v1.6.0

type PoolRunnerStaking struct {
	PoolRunnerBase
}

func (*PoolRunnerStaking) ClaimYieldOnRemoteZone added in v1.6.0

func (runner *PoolRunnerStaking) ClaimYieldOnRemoteZone(ctx sdk.Context, pool types.Pool, draw types.Draw) error

func (*PoolRunnerStaking) DelegateDepositOnRemoteZone added in v1.6.0

func (runner *PoolRunnerStaking) DelegateDepositOnRemoteZone(ctx sdk.Context, pool types.Pool, deposit types.Deposit) ([]*types.SplitDelegation, error)

func (*PoolRunnerStaking) OnUpdatePool added in v1.6.0

func (runner *PoolRunnerStaking) OnUpdatePool(ctx sdk.Context, pool types.Pool) error

func (*PoolRunnerStaking) QueryFreshPrizePoolCoinsOnRemoteZone added in v1.6.0

func (runner *PoolRunnerStaking) QueryFreshPrizePoolCoinsOnRemoteZone(ctx sdk.Context, pool types.Pool, draw types.Draw) error

func (*PoolRunnerStaking) RedelegateToActiveValidatorsOnRemoteZone added in v1.6.0

func (runner *PoolRunnerStaking) RedelegateToActiveValidatorsOnRemoteZone(ctx sdk.Context, pool types.Pool, inactiveVal types.PoolValidator, splits []*types.SplitDelegation) error

func (*PoolRunnerStaking) String added in v1.6.0

func (runner *PoolRunnerStaking) String() string

func (*PoolRunnerStaking) UndelegateWithdrawalsOnRemoteZone added in v1.6.0

func (runner *PoolRunnerStaking) UndelegateWithdrawalsOnRemoteZone(ctx sdk.Context, epochUnbonding types.EpochUnbonding) ([]*types.SplitDelegation, *time.Time, error)

type PrizeDraw

type PrizeDraw struct {
	Amount sdkmath.Int
	Winner *DepositTWB
}

Jump to

Keyboard shortcuts

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