keeper

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// setting WITHDRAW_STATUS_TOKENIZE as 0 causes the value to be omitted when (un)marshalling :/
	WITHDRAW_STATUS_TOKENIZE int32 = iota + 1
	WITHDRAW_STATUS_SEND     int32 = iota + 1
)

Variables

This section is empty.

Functions

func DistributeRewardsFromWithdrawAccount

func DistributeRewardsFromWithdrawAccount(k Keeper, ctx sdk.Context, args []byte, query queryTypes.Query) error

func GetReceiptKey

func GetReceiptKey(zone types.RegisteredZone, txhash string) string

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func SetValidatorsForZone

func SetValidatorsForZone(k Keeper, ctx sdk.Context, zoneInfo types.RegisteredZone, data []byte) error

Types

type Callback

type Callback func(Keeper, sdk.Context, []byte, types.Query) error

Callbacks wrapper struct for interchainstaking keeper

type Callbacks

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

func (Callbacks) AddCallback

func (c Callbacks) AddCallback(id string, fn interface{})

func (Callbacks) Call

func (c Callbacks) Call(ctx sdk.Context, id string, args []byte, query types.Query) error

// callback handler

func (c Callbacks) Call(id string, ctx sdk.Context, args proto.Message) error {
	return c.callbacks[id](c.k, ctx, args)
}

callback handler

func (Callbacks) Has

func (c Callbacks) Has(id string) bool

func (Callbacks) RemoveCallback

func (c Callbacks) RemoveCallback(id string)

type Hooks

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

Hooks wrapper struct for incentives keeper

func (Hooks) AfterEpochEnd

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)

func (Hooks) BeforeEpochStart

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)

epochs hooks

type Keeper

type Keeper struct {
	ICAControllerKeeper icacontrollerkeeper.Keeper
	ICQKeeper           interchainquerykeeper.Keeper
	AccountKeeper       authKeeper.AccountKeeper
	BankKeeper          bankkeeper.Keeper
	IBCKeeper           ibckeeper.Keeper
	// contains filtered or unexported fields
}

Keeper of this module maintains collections of registered zones.

func NewKeeper

func NewKeeper(cdc codec.Codec, storeKey sdk.StoreKey, accountKeeper authKeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, icacontrollerkeeper icacontrollerkeeper.Keeper, scopedKeeper capabilitykeeper.ScopedKeeper, icqKeeper interchainquerykeeper.Keeper, ibcKeeper ibckeeper.Keeper, ps paramtypes.Subspace) Keeper

NewKeeper returns a new instance of zones Keeper

func (Keeper) AddWithdrawalRecord

func (k Keeper) AddWithdrawalRecord(ctx sdk.Context, delegator string, validator string, recipient string, amount sdk.Coin)

func (Keeper) AfterEpochEnd

func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)

func (*Keeper) AggregateIntents

func (k *Keeper) AggregateIntents(ctx sdk.Context, zone types.RegisteredZone)

func (Keeper) AllIntents

func (k Keeper) AllIntents(ctx sdk.Context, zone types.RegisteredZone) []types.DelegatorIntent

AllIntents returns every intent in the store for the specified zone

func (Keeper) AllOrdinalizedIntents

func (k Keeper) AllOrdinalizedIntents(ctx sdk.Context, zone types.RegisteredZone) []types.DelegatorIntent

AllOrdinalizedIntents returns every intent in the store for the specified zone

func (Keeper) AllRegisteredZones

func (k Keeper) AllRegisteredZones(ctx sdk.Context) []types.RegisteredZone

AllRegisteredZonesInfos returns every zoneInfo in the store

func (Keeper) AllWithdrawalRecords

func (k Keeper) AllWithdrawalRecords(ctx sdk.Context, delegator string) []types.WithdrawalRecord

AllWithdrawalRecords returns every record in the store for the specified zone

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)

func (Keeper) BeginBlocker

func (k Keeper) BeginBlocker(ctx sdk.Context)

BeginBlocker of interchainstaking module

func (Keeper) CallbackHandler

func (k Keeper) CallbackHandler() Callbacks

func (*Keeper) ClaimCapability

func (k *Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error

ClaimCapability claims the channel capability passed via the OnOpenChanInit callback

func (*Keeper) Delegate

func (k *Keeper) Delegate(ctx sdk.Context, zone types.RegisteredZone, account *types.ICAAccount) error

func (Keeper) DelegatorIntent

DelegatorIntent returns information about the delegation intent of the caller for the given zone.

func (Keeper) DeleteIntent

func (k Keeper) DeleteIntent(ctx sdk.Context, zone types.RegisteredZone, delegator string)

DeleteIntent deletes delegator intent

func (Keeper) DeleteReceipt

func (k Keeper) DeleteReceipt(ctx sdk.Context, key string)

DeleteReceipt delete receipt info

func (Keeper) DeleteRegisteredZone

func (k Keeper) DeleteRegisteredZone(ctx sdk.Context, chain_id string)

DeleteRegisteredZone delete zone info

func (Keeper) DeleteWithdrawalRecord

func (k Keeper) DeleteWithdrawalRecord(ctx sdk.Context, delegator string, validator string, recipient string)

DeleteWithdrawalRecord deletes withdrawal record

func (Keeper) DepositAccountFromAddress

DepositAccountFromAddress returns the deposit account address for the given zone.

func (Keeper) DetermineValidatorsForDelegation

func (k Keeper) DetermineValidatorsForDelegation(ctx sdk.Context, zone types.RegisteredZone, amount sdk.Coin) (map[string]sdk.Coin, error)

func (Keeper) GetChainID

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

func (*Keeper) GetCommissionRate

func (k *Keeper) GetCommissionRate(ctx sdk.Context) sdk.Dec

func (*Keeper) GetConnectionForPort

func (k *Keeper) GetConnectionForPort(ctx sdk.Context, port string) (string, error)

func (Keeper) GetICAForDelegateAccount

func (k Keeper) GetICAForDelegateAccount(ctx sdk.Context, address string) (*types.RegisteredZone, *types.ICAAccount)

func (Keeper) GetIntent

func (k Keeper) GetIntent(ctx sdk.Context, zone types.RegisteredZone, delegator string) (types.DelegatorIntent, bool)

GetIntent returns intent info by zone and delegator

func (*Keeper) GetParam

func (k *Keeper) GetParam(ctx sdk.Context, key []byte) uint64

func (Keeper) GetParams

func (k Keeper) GetParams(clientCtx sdk.Context) (params types.Params)

func (Keeper) GetReceipt

func (k Keeper) GetReceipt(ctx sdk.Context, key string) (types.Receipt, bool)

GetReceipt returns receipt

func (Keeper) GetRegisteredZoneInfo

func (k Keeper) GetRegisteredZoneInfo(ctx sdk.Context, chain_id string) (types.RegisteredZone, bool)

GetRegsiteredZoneInfo returns zone info by chain_id

func (*Keeper) GetValidatorForToken

func (k *Keeper) GetValidatorForToken(ctx sdk.Context, delegatorAddress string, amount sdk.Coin) (string, error)

func (Keeper) GetWithdrawalRecord

func (k Keeper) GetWithdrawalRecord(ctx sdk.Context, delegator string, validator string, recipient string) (types.WithdrawalRecord, bool)

GetWithdrawalRecord returns withdrawal record info by zone and delegator

func (Keeper) GetZoneForDelegateAccount

func (k Keeper) GetZoneForDelegateAccount(ctx sdk.Context, address string) *types.RegisteredZone

func (*Keeper) HandleAcknowledgement

func (k *Keeper) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte) error

func (*Keeper) HandleBeginRedelegate

func (k *Keeper) HandleBeginRedelegate(ctx sdk.Context, msg sdk.Msg, completion time.Time) error

func (*Keeper) HandleCompleteMultiSend

func (k *Keeper) HandleCompleteMultiSend(ctx sdk.Context, msg sdk.Msg) error

func (*Keeper) HandleCompleteSend

func (k *Keeper) HandleCompleteSend(ctx sdk.Context, msg sdk.Msg) error

TODO: rework to reflect changes to HandleWithdrawRewards:

  1. handle MsgSend from WithdrawalAccount to FeeAccount;
  2. handle MsgSend from WithdrawalAccount to Delegation Accounts;

func (*Keeper) HandleDelegate

func (k *Keeper) HandleDelegate(ctx sdk.Context, msg sdk.Msg) error

func (Keeper) HandleReceiptTransaction

func (k Keeper) HandleReceiptTransaction(ctx sdk.Context, tx *coretypes.ResultTx, zone types.RegisteredZone)

func (*Keeper) HandleRedeemTokens

func (k *Keeper) HandleRedeemTokens(ctx sdk.Context, msg sdk.Msg, amount sdk.Coin) error

func (*Keeper) HandleTimeout

func (k *Keeper) HandleTimeout(ctx sdk.Context, packet channeltypes.Packet) error

func (*Keeper) HandleTokenizedShares

func (k *Keeper) HandleTokenizedShares(ctx sdk.Context, msg sdk.Msg, amount sdk.Coin) error

func (*Keeper) HandleUpdatedWithdrawAddress

func (k *Keeper) HandleUpdatedWithdrawAddress(ctx sdk.Context, msg sdk.Msg) error

func (*Keeper) HandleWithdrawRewards

func (k *Keeper) HandleWithdrawRewards(ctx sdk.Context, msg sdk.Msg, amount sdk.Coins) error

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

func (Keeper) IterateIntents

func (k Keeper) IterateIntents(ctx sdk.Context, zone types.RegisteredZone, fn func(index int64, intent types.DelegatorIntent) (stop bool))

IterateIntents iterate through intents for a given zone

func (Keeper) IterateReceipts

func (k Keeper) IterateReceipts(ctx sdk.Context, fn func(index int64, receiptInfo types.Receipt) (stop bool))

IterateQueries iterate through receipts

func (Keeper) IterateRegisteredZones

func (k Keeper) IterateRegisteredZones(ctx sdk.Context, fn func(index int64, zoneInfo types.RegisteredZone) (stop bool))

IterateRegisteredZones iterate through zones

func (Keeper) IterateWithdrawalRecords

func (k Keeper) IterateWithdrawalRecords(ctx sdk.Context, delegator string, fn func(index int64, record types.WithdrawalRecord) (stop bool))

IterateWithdrawalRecords iterate through records for a given zone

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (*Keeper) MintQAsset

func (k *Keeper) MintQAsset(ctx sdk.Context, sender sdk.AccAddress, zone types.RegisteredZone, inCoins sdk.Coins) error

func (Keeper) NewReceipt

func (k Keeper) NewReceipt(ctx sdk.Context, zone types.RegisteredZone, sender string, txhash string, amount sdk.Coins) *types.Receipt

func (Keeper) RegisteredZoneInfos

RegisteredZoneInfos returns information about registered zones.

func (Keeper) SetAccountBalance

func (k Keeper) SetAccountBalance(ctx sdk.Context, zone types.RegisteredZone, address string, queryResult []byte) error

func (*Keeper) SetConnectionForPort

func (k *Keeper) SetConnectionForPort(ctx sdk.Context, connectionId string, port string) error

func (Keeper) SetIntent

func (k Keeper) SetIntent(ctx sdk.Context, zone types.RegisteredZone, intent types.DelegatorIntent)

SetIntent store the delegator intent

func (Keeper) SetParams

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

SetParams sets the distribution parameters to the param space.

func (Keeper) SetReceipt

func (k Keeper) SetReceipt(ctx sdk.Context, receipt types.Receipt)

SetReceipt set receipt info

func (Keeper) SetRegisteredZone

func (k Keeper) SetRegisteredZone(ctx sdk.Context, zone types.RegisteredZone)

SetRegisteredZone set zone info

func (Keeper) SetWithdrawalRecord

func (k Keeper) SetWithdrawalRecord(ctx sdk.Context, record *types.WithdrawalRecord)

SetWithdrawalRecord store the withdrawal record

func (*Keeper) SubmitTx

func (k *Keeper) SubmitTx(ctx sdk.Context, msgs []sdk.Msg, account *types.ICAAccount) error

func (*Keeper) TransferToDelegate

func (k *Keeper) TransferToDelegate(ctx sdk.Context, zone types.RegisteredZone, inAmount sdk.Coins) error

func (*Keeper) TransferToDelegateMulti

func (k *Keeper) TransferToDelegateMulti(ctx sdk.Context, zone types.RegisteredZone, inAmount sdk.Coins) error

func (*Keeper) UpdateDelegationRecordForAddress

func (k *Keeper) UpdateDelegationRecordForAddress(ctx sdk.Context, delegatorAddress string, validatorAddress string, amount sdk.Coin) error

func (*Keeper) UpdateDelegationRecordsForAddress

func (k *Keeper) UpdateDelegationRecordsForAddress(ctx sdk.Context, zone types.RegisteredZone, delegatorAddress string, args []byte) error

func (*Keeper) UpdateIntent

func (k *Keeper) UpdateIntent(ctx sdk.Context, sender sdk.AccAddress, zone types.RegisteredZone, inAmount sdk.Coins)

func (*Keeper) WithdrawDelegationRewardsForResponse

func (k *Keeper) WithdrawDelegationRewardsForResponse(ctx sdk.Context, zone types.RegisteredZone, delegator string, response []byte) error

Jump to

Keyboard shortcuts

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