keeper

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeRoutingMessage added in v0.35.0

func EncodeRoutingMessage(sender sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error)

EncodeRoutingMessage encodes the message from the wasm contract into a sdk.Msg

func Migrate6to7 added in v0.35.0

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

Migrate6to7 returns the handler that performs in-place store migrations

func NewMessageRoute added in v0.35.0

func NewMessageRoute(nexus types.Nexus, account types.AccountKeeper, wasm types.WasmKeeper) exported.MessageRoute

NewMessageRoute creates a new message route

func NewMsgServerImpl

func NewMsgServerImpl(k types.Nexus, snapshotter types.Snapshotter, slashing types.SlashingKeeper, staking types.StakingKeeper, axelarnet types.AxelarnetKeeper) types.MsgServiceServer

NewMsgServerImpl returns an implementation of the nexus MsgServiceServer interface for the provided Keeper.

Types

type Keeper

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

Keeper represents a nexus keeper

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramSpace params.Subspace) Keeper

NewKeeper returns a new nexus keeper

func (Keeper) ActivateChain

func (k Keeper) ActivateChain(ctx sdk.Context, chain exported.Chain)

ActivateChain activates the given chain

func (Keeper) AddChainMaintainer

func (k Keeper) AddChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) error

AddChainMaintainer adds the given address to be one of the given chain's maintainers

func (Keeper) AddTransferFee added in v0.17.0

func (k Keeper) AddTransferFee(ctx sdk.Context, coin sdk.Coin)

AddTransferFee adds transfer fee

func (Keeper) ArchivePendingTransfer

func (k Keeper) ArchivePendingTransfer(ctx sdk.Context, transfer exported.CrossChainTransfer)

ArchivePendingTransfer marks the transfer for the given recipient as concluded and archived

func (Keeper) ComputeTransferFee added in v0.15.0

func (k Keeper) ComputeTransferFee(ctx sdk.Context, sourceChain exported.Chain, destinationChain exported.Chain, asset sdk.Coin) (sdk.Coin, error)

ComputeTransferFee computes the fee for a cross-chain transfer. If fee_info is not set for an asset on a chain, default of zero is used

transfer_fee = min(total_max_fee, max(total_min_fee, (total_fee_rate) * amount))

INVARIANT: source_chain.min_fee + destination_chain.min_fee <= transfer_fee <= source_chain.max_fee + destination_chain.max_fee

func (Keeper) DeactivateChain added in v0.12.0

func (k Keeper) DeactivateChain(ctx sdk.Context, chain exported.Chain)

DeactivateChain deactivates the given chain

func (Keeper) DequeueRouteMessage added in v0.35.0

func (k Keeper) DequeueRouteMessage(ctx sdk.Context) (msg exported.GeneralMessage, ok bool)

DequeueRouteMessage dequeues the next general message to be routed

func (Keeper) EnqueueForTransfer

func (k Keeper) EnqueueForTransfer(ctx sdk.Context, sender exported.CrossChainAddress, asset sdk.Coin) (exported.TransferID, error)

EnqueueForTransfer enqueues an asset transfer for the given deposit address

func (Keeper) EnqueueRouteMessage added in v0.35.0

func (k Keeper) EnqueueRouteMessage(ctx sdk.Context, id string) error

EnqueueRouteMessage enqueues the given general message to be routed

func (Keeper) EnqueueTransfer added in v0.17.0

func (k Keeper) EnqueueTransfer(ctx sdk.Context, senderChain exported.Chain, recipient exported.CrossChainAddress, asset sdk.Coin) (exported.TransferID, error)

EnqueueTransfer enqueues an asset transfer to the given recipient address

func (Keeper) ExportGenesis added in v0.9.0

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

ExportGenesis returns the reward module's genesis state.

func (Keeper) GenerateMessageID added in v0.32.0

func (k Keeper) GenerateMessageID(ctx sdk.Context) (string, []byte, uint64)

GenerateMessageID generates a unique general message ID, and returns the message ID, current transacation ID and a unique integer nonce The message ID is just a concatenation of the transaction ID and the nonce

func (Keeper) GetChain

func (k Keeper) GetChain(ctx sdk.Context, chainName exported.ChainName) (chain exported.Chain, ok bool)

GetChain retrieves the specification for a supported blockchain

func (Keeper) GetChainByNativeAsset added in v0.14.0

func (k Keeper) GetChainByNativeAsset(ctx sdk.Context, asset string) (chain exported.Chain, ok bool)

GetChainByNativeAsset gets a chain by the native asset

func (Keeper) GetChainMaintainerState added in v0.25.0

func (k Keeper) GetChainMaintainerState(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) (exported.MaintainerState, bool)

GetChainMaintainerState returns the maintainer state of the given chain and address

func (Keeper) GetChainMaintainerStates added in v0.18.0

func (k Keeper) GetChainMaintainerStates(ctx sdk.Context, chain exported.Chain) []exported.MaintainerState

GetChainMaintainerStates returns the maintainer states of the given chain

func (Keeper) GetChainMaintainers

func (k Keeper) GetChainMaintainers(ctx sdk.Context, chain exported.Chain) []sdk.ValAddress

GetChainMaintainers returns the maintainers of the given chain

func (Keeper) GetChains

func (k Keeper) GetChains(ctx sdk.Context) (chains []exported.Chain)

GetChains retrieves the specification for all supported blockchains

func (Keeper) GetFeeInfo added in v0.15.0

func (k Keeper) GetFeeInfo(ctx sdk.Context, chain exported.Chain, asset string) exported.FeeInfo

GetFeeInfo retrieves the fee info for an asset on a chain, and returns zero fees if it doesn't exist

func (Keeper) GetMessage added in v0.32.0

func (k Keeper) GetMessage(ctx sdk.Context, id string) (m exported.GeneralMessage, found bool)

GetMessage returns the general message by ID

func (Keeper) GetParams

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

GetParams gets the nexus module's parameters

func (Keeper) GetProcessingMessages added in v0.33.0

func (k Keeper) GetProcessingMessages(ctx sdk.Context, chain exported.ChainName, limit int64) []exported.GeneralMessage

GetProcessingMessages returns up to #limit messages that are currently being processed

func (Keeper) GetRecipient

func (k Keeper) GetRecipient(ctx sdk.Context, depositAddress exported.CrossChainAddress) (exported.CrossChainAddress, bool)

GetRecipient retrieves the cross chain recipient associated to the specified sender

func (Keeper) GetTransferFees added in v0.11.1

func (k Keeper) GetTransferFees(ctx sdk.Context) sdk.Coins

GetTransferFees returns the accumulated transfer fees

func (Keeper) GetTransfersForChain

func (k Keeper) GetTransfersForChain(ctx sdk.Context, chain exported.Chain, state exported.TransferState) (transfers []exported.CrossChainTransfer)

GetTransfersForChain returns the current set of transfers with the given state for the given chain

func (Keeper) GetTransfersForChainPaginated added in v0.13.1

func (k Keeper) GetTransfersForChainPaginated(ctx sdk.Context, chain exported.Chain, state exported.TransferState, pageRequest *query.PageRequest) ([]exported.CrossChainTransfer, *query.PageResponse, error)

GetTransfersForChainPaginated returns the current set of transfers with the given state for the given chain with the given pagination properties

func (Keeper) InitGenesis added in v0.9.0

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

InitGenesis initializes the reward module's state from a given genesis state.

func (Keeper) IsAssetRegistered

func (k Keeper) IsAssetRegistered(ctx sdk.Context, chain exported.Chain, denom string) bool

IsAssetRegistered returns true if the specified asset is supported by the given chain

func (Keeper) IsChainActivated

func (k Keeper) IsChainActivated(ctx sdk.Context, chain exported.Chain) bool

IsChainActivated returns true if the given chain is activated; false otherwise

func (Keeper) IsChainMaintainer

func (k Keeper) IsChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) bool

IsChainMaintainer returns true if the given address is one of the given chain's maintainers; false otherwise

func (Keeper) LinkAddresses

func (k Keeper) LinkAddresses(ctx sdk.Context, depositAddress exported.CrossChainAddress, recipientAddress exported.CrossChainAddress) error

LinkAddresses links a sender address to a cross-chain recipient address

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) RateLimitTransfer added in v0.27.0

func (k Keeper) RateLimitTransfer(ctx sdk.Context, chain exported.ChainName, asset sdk.Coin, direction exported.TransferDirection) error

RateLimitTransfer applies a rate limit to transfers, and returns an error if the rate limit is exceeded

func (Keeper) RegisterAsset

func (k Keeper) RegisterAsset(ctx sdk.Context, chain exported.Chain, asset exported.Asset, limit sdk.Uint, window time.Duration) error

RegisterAsset indicates that the specified asset is supported by the given chain

func (Keeper) RegisterFee added in v0.15.0

func (k Keeper) RegisterFee(ctx sdk.Context, chain exported.Chain, feeInfo exported.FeeInfo) error

RegisterFee registers the fee info for an asset on a chain

func (Keeper) RemoveChainMaintainer

func (k Keeper) RemoveChainMaintainer(ctx sdk.Context, chain exported.Chain, address sdk.ValAddress) error

RemoveChainMaintainer removes the given address from the given chain's maintainers

func (Keeper) RouteMessage added in v0.35.0

func (k Keeper) RouteMessage(ctx sdk.Context, id string, routingCtx ...exported.RoutingContext) error

RouteMessage routes the given general message to the corresponding module and set the message status to processing

func (*Keeper) SetAddressValidators added in v0.35.0

func (k *Keeper) SetAddressValidators(validators *types.AddressValidators)

SetAddressValidators sets the nexus address validator. It will panic if called more than once

func (Keeper) SetChain

func (k Keeper) SetChain(ctx sdk.Context, chain exported.Chain)

SetChain sets the specification for a supported chain

func (Keeper) SetChainMaintainerState added in v0.25.0

func (k Keeper) SetChainMaintainerState(ctx sdk.Context, maintainerState exported.MaintainerState) error

SetChainMaintainerState sets the given chain's maintainer state

func (Keeper) SetMessageExecuted added in v0.32.0

func (k Keeper) SetMessageExecuted(ctx sdk.Context, id string) error

SetMessageExecuted sets the general message as executed

func (Keeper) SetMessageFailed added in v0.32.0

func (k Keeper) SetMessageFailed(ctx sdk.Context, id string) error

SetMessageFailed sets the general message as failed

func (*Keeper) SetMessageRouter added in v0.35.0

func (k *Keeper) SetMessageRouter(router types.MessageRouter)

func (Keeper) SetNewMessage added in v0.31.0

func (k Keeper) SetNewMessage(ctx sdk.Context, msg exported.GeneralMessage) error

SetNewMessage sets the given general messsage as approved

func (Keeper) SetParams

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

SetParams sets the nexus module's parameters

func (Keeper) SetRateLimit added in v0.27.0

func (k Keeper) SetRateLimit(ctx sdk.Context, chainName exported.ChainName, limit sdk.Coin, window time.Duration) error

SetRateLimit sets a rate limit for the given chain and asset. If max uint256 is provided as a limit, it's treated as a rate limit being infinite/not being set.

func (Keeper) SubTransferFee added in v0.11.1

func (k Keeper) SubTransferFee(ctx sdk.Context, coin sdk.Coin)

SubTransferFee subtracts coin from transfer fee

func (Keeper) ValidateAddress added in v0.32.0

func (k Keeper) ValidateAddress(ctx sdk.Context, address exported.CrossChainAddress) error

ValidateAddress validates the given cross chain address

type Messenger added in v0.35.0

type Messenger struct {
	types.Nexus
}

func NewMessenger added in v0.35.0

func NewMessenger(nexus types.Nexus) Messenger

NewMessenger returns a new Messenger

func (Messenger) DispatchMsg added in v0.35.0

func (m Messenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, _ string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error)

DispatchMsg decodes the messages from the cosmowasm gateway and routes them to the nexus module if possible

type Querier added in v0.18.0

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

Querier implements the grpc queries for the nexus module

func NewGRPCQuerier added in v0.18.0

func NewGRPCQuerier(k Keeper, a types.AxelarnetKeeper) Querier

NewGRPCQuerier creates a new nexus Querier

func (Querier) Assets added in v0.18.0

Assets returns the registered assets of a chain

func (Querier) ChainMaintainers added in v0.26.3

ChainMaintainers returns the chain maintainers for a given chain

func (Querier) ChainState added in v0.18.0

ChainState returns the chain state in the network

func (Querier) Chains added in v0.18.0

Chains returns the chains registered on the network

func (Querier) ChainsByAsset added in v0.18.0

ChainsByAsset returns all chains that an asset is registered on

func (Querier) FeeInfo added in v0.18.0

FeeInfo returns the fee info for an asset on a specific chain

func (Querier) LatestDepositAddress added in v0.18.0

LatestDepositAddress returns the deposit address for the provided recipient

func (Querier) Message added in v0.32.0

Message queries the general message for a given message ID

func (Querier) Params added in v0.34.0

Params returns the reward module params

func (Querier) RecipientAddress added in v0.19.4

RecipientAddress returns the recipient address for a given deposit address

func (Querier) TransferFee added in v0.18.0

TransferFee returns the transfer fee for a cross chain transfer

func (Querier) TransferRateLimit added in v0.27.0

TransferRateLimit queries the transfer rate limit for a given chain and asset

func (Querier) TransfersForChain added in v0.18.0

TransfersForChain returns the transfers for a given chain

Jump to

Keyboard shortcuts

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