keeper

package
v7.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const CorkVoteThresholdStr = "0.67"

Variables

This section is empty.

Functions

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState

ExportGenesis writes the current store values to a genesis file, which can be imported again with InitGenesis

func HandleAddChainConfigurationProposal

func HandleAddChainConfigurationProposal(ctx sdk.Context, k Keeper, p types.AddChainConfigurationProposal) error

HandleAddChainConfigurationProposal is a handler for executing a passed chain configuration addition proposal

func HandleAddManagedCellarsProposal

func HandleAddManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.AddAxelarManagedCellarIDsProposal) error

HandleAddManagedCellarsProposal is a handler for executing a passed community cellar addition proposal

func HandleCancelAxelarProxyContractUpgradeProposal

func HandleCancelAxelarProxyContractUpgradeProposal(ctx sdk.Context, k Keeper, p types.CancelAxelarProxyContractUpgradeProposal) error

HandleCancelAxelarProxyContractUpgradeProposal is a handler for deleting axelar proxy contract upgrade data before the executable height threshold is reached.

func HandleCommunityPoolSpendProposal

func HandleCommunityPoolSpendProposal(ctx sdk.Context, k Keeper, p types.AxelarCommunityPoolSpendProposal) error

func HandleRemoveChainConfigurationProposal

func HandleRemoveChainConfigurationProposal(ctx sdk.Context, k Keeper, p types.RemoveChainConfigurationProposal) error

HandleRemoveChainConfigurationProposal is a handler for executing a passed chain configuration removal proposal

func HandleRemoveManagedCellarsProposal

func HandleRemoveManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.RemoveAxelarManagedCellarIDsProposal) error

HandleRemoveManagedCellarsProposal is a handler for executing a passed community cellar removal proposal

func HandleScheduledCorkProposal

func HandleScheduledCorkProposal(ctx sdk.Context, k Keeper, p types.AxelarScheduledCorkProposal) error

HandleScheduledCorkProposal is a handler for executing a passed scheduled cork proposal

func HandleUpgradeAxelarProxyContractProposal

func HandleUpgradeAxelarProxyContractProposal(ctx sdk.Context, k Keeper, p types.UpgradeAxelarProxyContractProposal) error

HandleUpgradeAxelarProxyContractProposal is a handler for executing a passed axelar proxy contract upgrade proposal

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, gs types.GenesisState)

InitGenesis initialize default parameters and the keeper's address to pubkey map

func NewAxelarSubscriptionID

func NewAxelarSubscriptionID(chainID uint64, address common.Address) string

Types

type Keeper

type Keeper struct {
	Ics4Wrapper types.ICS4Wrapper
	// contains filtered or unexported fields
}

Keeper of the oracle store

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace,
	accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper,
	transferKeeper types.TransferKeeper, distributionKeeper types.DistributionKeeper,
	wrapper types.ICS4Wrapper, gravityKeeper types.GravityKeeper, pubsubKeeper types.PubsubKeeper,
) Keeper

NewKeeper creates a new x/axelarcork Keeper instance

func (Keeper) BeginBlocker

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

BeginBlocker is called at the beginning of every block

func (Keeper) DecrementValidatorAxelarCorkCount

func (k Keeper) DecrementValidatorAxelarCorkCount(ctx sdk.Context, val sdk.ValAddress)

func (Keeper) DeleteAxelarCorkResult

func (k Keeper) DeleteAxelarCorkResult(ctx sdk.Context, chainID uint64, id []byte)

func (Keeper) DeleteAxelarProxyUpgradeData

func (k Keeper) DeleteAxelarProxyUpgradeData(ctx sdk.Context, chainID uint64)

DeleteAxelarProxyUpgradeData deletes the upgrade data for the given chainID

func (Keeper) DeleteChainConfigurationByID

func (k Keeper) DeleteChainConfigurationByID(ctx sdk.Context, chainID uint64)

func (Keeper) DeleteScheduledAxelarCork

func (k Keeper) DeleteScheduledAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, id []byte, val sdk.ValAddress, contract common.Address)

DeleteScheduledAxelarCork deletes the scheduled cork for a given validator CONTRACT: must provide the validator address here not the delegate address

func (Keeper) DeleteWinningAxelarCork

func (k Keeper) DeleteWinningAxelarCork(ctx sdk.Context, chainID uint64, c types.AxelarCork)

TODO (Collin): Need pruning logic. This method is unused.

func (Keeper) DeleteWinningAxelarCorkByBlockheight

func (k Keeper) DeleteWinningAxelarCorkByBlockheight(ctx sdk.Context, chainID uint64, blockHeight uint64, cork types.AxelarCork)

func (Keeper) EndBlocker

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

func (Keeper) GetAppVersion

func (k Keeper) GetAppVersion(ctx sdk.Context, portID string, channelID string) (string, bool)

func (Keeper) GetApprovedScheduledAxelarCorks

func (k Keeper) GetApprovedScheduledAxelarCorks(ctx sdk.Context, chainID uint64) (approvedCorks []types.AxelarCork)

func (Keeper) GetAxelarContractCallNonce

func (k Keeper) GetAxelarContractCallNonce(ctx sdk.Context, chainID uint64, address string) uint64

GetAxelarContractCallNonce returns the nonce for the given chainID and address, returning a zero if not found

func (Keeper) GetAxelarCorkResult

func (k Keeper) GetAxelarCorkResult(ctx sdk.Context, chainID uint64, id []byte) (types.AxelarCorkResult, bool)

func (Keeper) GetAxelarCorkResults

func (k Keeper) GetAxelarCorkResults(ctx sdk.Context, chainID uint64) []*types.AxelarCorkResult

GetAxelarCorkResults returns AxelarCorkResults

func (Keeper) GetAxelarProxyUpgradeData

func (k Keeper) GetAxelarProxyUpgradeData(ctx sdk.Context, chainID uint64) (types.AxelarUpgradeData, bool)

GetAxelarProxyUpgradeData returns the upgrade data for the given chainID, returning an empty payload if not found

func (Keeper) GetCellarIDs

func (k Keeper) GetCellarIDs(ctx sdk.Context, chainID uint64) (cellars []common.Address)

func (Keeper) GetChainConfigurationByID

func (k Keeper) GetChainConfigurationByID(ctx sdk.Context, chainID uint64) (types.ChainConfiguration, bool)

func (Keeper) GetChainConfigurationByName

func (k Keeper) GetChainConfigurationByName(ctx sdk.Context, chainName string) (types.ChainConfiguration, bool)

func (Keeper) GetParamSet

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

GetParamSet returns the vote period from the parameters

func (Keeper) GetScheduledAxelarCork

func (k Keeper) GetScheduledAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, id []byte, val sdk.ValAddress, contract common.Address) (types.AxelarCork, bool)

GetScheduledAxelarCork gets the scheduled cork for a given validator CONTRACT: must provide the validator address here not the delegate address

func (Keeper) GetScheduledAxelarCorks

func (k Keeper) GetScheduledAxelarCorks(ctx sdk.Context, chainID uint64) []*types.ScheduledAxelarCork

func (Keeper) GetScheduledAxelarCorksByBlockHeight

func (k Keeper) GetScheduledAxelarCorksByBlockHeight(ctx sdk.Context, chainID uint64, height uint64) []*types.ScheduledAxelarCork

func (Keeper) GetScheduledAxelarCorksByID

func (k Keeper) GetScheduledAxelarCorksByID(ctx sdk.Context, chainID uint64, queriedID []byte) []*types.ScheduledAxelarCork

func (Keeper) GetScheduledBlockHeights

func (k Keeper) GetScheduledBlockHeights(ctx sdk.Context, chainID uint64) []uint64

func (Keeper) GetSenderAccount

func (k Keeper) GetSenderAccount(ctx sdk.Context) authtypes.ModuleAccountI

func (Keeper) GetValidatorAxelarCorkCount

func (k Keeper) GetValidatorAxelarCorkCount(ctx sdk.Context, val sdk.ValAddress) (count uint64)

func (Keeper) GetWinningAxelarCork

func (k Keeper) GetWinningAxelarCork(ctx sdk.Context, chainID uint64, contractAddr common.Address) (uint64, types.AxelarCork, bool)

func (Keeper) HasCellarID

func (k Keeper) HasCellarID(ctx sdk.Context, chainID uint64, address common.Address) (found bool)

func (Keeper) IncrementAxelarContractCallNonce

func (k Keeper) IncrementAxelarContractCallNonce(ctx sdk.Context, chainID uint64, address string) uint64

IncrementAxelarContractCallNonce increments the nonce for the given chainID and address

func (Keeper) IncrementValidatorAxelarCorkCount

func (k Keeper) IncrementValidatorAxelarCorkCount(ctx sdk.Context, val sdk.ValAddress)

func (Keeper) IterateAxelarContractCallNonces

func (k Keeper) IterateAxelarContractCallNonces(ctx sdk.Context, cb func(chainID uint64, address common.Address, nonce uint64) (stop bool))

IterateAxelarContractCallNonces iterates over all axelar contract call nonces

func (Keeper) IterateAxelarCorkResults

func (k Keeper) IterateAxelarCorkResults(ctx sdk.Context, chainID uint64, cb func(id []byte, blockHeight uint64, approved bool, approvalPercentage string, corkResult types.AxelarCorkResult) (stop bool))

IterateCorksResult iterates over all cork results by chain ID

func (Keeper) IterateAxelarProxyUpgradeData

func (k Keeper) IterateAxelarProxyUpgradeData(ctx sdk.Context, cb func(chainID uint64, upgradeData types.AxelarUpgradeData) (stop bool))

IterateAxelarProxyUpgradeData iterates over all axelar proxy upgrade data

func (Keeper) IterateChainConfigurations

func (k Keeper) IterateChainConfigurations(ctx sdk.Context, handler func(config types.ChainConfiguration) (stop bool))

func (Keeper) IterateScheduledAxelarCorks

func (k Keeper) IterateScheduledAxelarCorks(ctx sdk.Context, chainID uint64, cb func(val sdk.ValAddress, blockHeight uint64, id []byte, cel common.Address, cork types.AxelarCork) (stop bool))

IterateScheduledAxelarCorks iterates over all scheduled corks by chain ID

func (Keeper) IterateScheduledAxelarCorksByBlockHeight

func (k Keeper) IterateScheduledAxelarCorksByBlockHeight(ctx sdk.Context, chainID uint64, blockHeight uint64, cb func(val sdk.ValAddress, blockHeight uint64, id []byte, cel common.Address, cork types.AxelarCork) (stop bool))

func (Keeper) IterateScheduledAxelarCorksByPrefix

func (k Keeper) IterateScheduledAxelarCorksByPrefix(ctx sdk.Context, prefix []byte, cb func(val sdk.ValAddress, blockHeight uint64, id []byte, cel common.Address, cork types.AxelarCork) (stop bool))

func (Keeper) IterateWinningAxelarCorks

func (k Keeper) IterateWinningAxelarCorks(ctx sdk.Context, chainID uint64, cb func(contract common.Address, blockHeight uint64, cork types.AxelarCork) (stop bool))

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) QueryParams

QueryParams implements QueryServer

func (Keeper) RelayProxyUpgrade

RelayProxyUpgrade prepares the payload for IBC transfer if the current blockheight meets the payload's execution threshold, and then deletes the upgrade data.

func (Keeper) ScheduleCork

ScheduleCork implements types.MsgServer

func (Keeper) SendPacket

func (k Keeper) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) (sequence uint64, err error)

func (Keeper) SetAxelarContractCallNonce

func (k Keeper) SetAxelarContractCallNonce(ctx sdk.Context, chainID uint64, address string, nonce uint64)

SetAxelarContractCallNonce sets the nonce for the given chainID and address

func (Keeper) SetAxelarCorkResult

func (k Keeper) SetAxelarCorkResult(ctx sdk.Context, chainID uint64, id []byte, corkResult types.AxelarCorkResult)

func (Keeper) SetAxelarProxyUpgradeData

func (k Keeper) SetAxelarProxyUpgradeData(ctx sdk.Context, chainID uint64, upgradeData types.AxelarUpgradeData)

SetAxelarProxyUpgradeData sets the upgrade data for the given chainID

func (Keeper) SetCellarIDs

func (k Keeper) SetCellarIDs(ctx sdk.Context, chainID uint64, c types.CellarIDSet)

func (Keeper) SetChainConfiguration

func (k Keeper) SetChainConfiguration(ctx sdk.Context, chainID uint64, config types.ChainConfiguration)

func (Keeper) SetParams

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

SetParams sets the parameters in the store

func (Keeper) SetScheduledAxelarCork

func (k Keeper) SetScheduledAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, val sdk.ValAddress, cork types.AxelarCork) []byte

func (*Keeper) SetTransferKeeper

func (k *Keeper) SetTransferKeeper(transferKeeper types.TransferKeeper)

SetTransferKeeper sets the transferKeeper

func (Keeper) SetValidatorAxelarCorkCount

func (k Keeper) SetValidatorAxelarCorkCount(ctx sdk.Context, val sdk.ValAddress, count uint64)

func (Keeper) SetWinningAxelarCork

func (k Keeper) SetWinningAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, cork types.AxelarCork)

func (Keeper) ValidateAxelarPacket

func (k Keeper) ValidateAxelarPacket(ctx sdk.Context, sourceChannel string, data []byte) error

func (Keeper) WriteAcknowledgement

func (k Keeper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement) error

Jump to

Keyboard shortcuts

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