keeper

package
v7.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 31 Imported by: 241

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitAcknowledgementEvent

func EmitAcknowledgementEvent(ctx sdk.Context, packet exported.PacketI, ack exported.Acknowledgement, err error)

EmitAcknowledgementEvent emits an event signalling a successful or failed acknowledgement and including the error details if any.

func EmitHostDisabledEvent added in v7.4.1

func EmitHostDisabledEvent(ctx sdk.Context, packet channeltypes.Packet)

EmitHostDisabledEvent emits an event signalling that the host submodule is disabled.

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper Keeper) genesistypes.HostGenesisState

ExportGenesis returns the interchain accounts host exported genesis

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, state genesistypes.HostGenesisState)

InitGenesis initializes the interchain accounts host application state from a provided genesis state

func NewMsgServerImpl added in v7.5.0

func NewMsgServerImpl(keeper *Keeper) types.MsgServer

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

Types

type Keeper

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

Keeper defines the IBC interchain accounts host keeper

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace,
	ics4Wrapper porttypes.ICS4Wrapper, channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper,
	accountKeeper icatypes.AccountKeeper, scopedKeeper exported.ScopedKeeper, msgRouter icatypes.MessageRouter,
) Keeper

NewKeeper creates a new interchain accounts host Keeper instance

func (Keeper) AuthenticateCapability

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

AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function

func (Keeper) BindPort

func (k Keeper) BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability

BindPort stores the provided portID and binds to it, returning the associated capability

func (Keeper) ClaimCapability

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

ClaimCapability wraps the scopedKeeper's ClaimCapability function

func (Keeper) GetActiveChannelID

func (k Keeper) GetActiveChannelID(ctx sdk.Context, connectionID, portID string) (string, bool)

GetActiveChannelID retrieves the active channelID from the store keyed by the provided connectionID and portID

func (Keeper) GetAllActiveChannels

func (k Keeper) GetAllActiveChannels(ctx sdk.Context) []genesistypes.ActiveChannel

GetAllActiveChannels returns a list of all active interchain accounts host channels and their associated connection and port identifiers

func (Keeper) GetAllInterchainAccounts

func (k Keeper) GetAllInterchainAccounts(ctx sdk.Context) []genesistypes.RegisteredInterchainAccount

GetAllInterchainAccounts returns a list of all registered interchain account addresses and their associated connection and controller port identifiers

func (Keeper) GetAllowMessages

func (k Keeper) GetAllowMessages(ctx sdk.Context) []string

GetAllowMessages retrieves the host enabled msg types from the paramstore

func (Keeper) GetAppVersion

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

GetAppVersion calls the ICS4Wrapper GetAppVersion function.

func (Keeper) GetInterchainAccountAddress

func (k Keeper) GetInterchainAccountAddress(ctx sdk.Context, connectionID, portID string) (string, bool)

GetInterchainAccountAddress retrieves the InterchainAccount address from the store associated with the provided connectionID and portID

func (Keeper) GetOpenActiveChannel

func (k Keeper) GetOpenActiveChannel(ctx sdk.Context, connectionID, portID string) (string, bool)

GetOpenActiveChannel retrieves the active channelID from the store, keyed by the provided connectionID and portID & checks if the channel in question is in state OPEN

func (Keeper) GetParams

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

GetParams returns the total set of the host submodule parameters.

func (Keeper) IsActiveChannel

func (k Keeper) IsActiveChannel(ctx sdk.Context, connectionID, portID string) bool

IsActiveChannel returns true if there exists an active channel for the provided connectionID and portID, otherwise false

func (Keeper) IsBound

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

IsBound checks if the interchain account host module is already bound to the desired port

func (Keeper) IsHostEnabled

func (k Keeper) IsHostEnabled(ctx sdk.Context) bool

IsHostEnabled retrieves the host enabled boolean from the paramstore. True is returned if the host submodule is enabled.

func (Keeper) Logger

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

Logger returns the application logger, scoped to the associated module

func (Keeper) OnChanCloseConfirm

func (k Keeper) OnChanCloseConfirm(
	ctx sdk.Context,
	portID,
	channelID string,
) error

OnChanCloseConfirm removes the active channel stored in state

func (Keeper) OnChanOpenConfirm

func (k Keeper) OnChanOpenConfirm(
	ctx sdk.Context,
	portID,
	channelID string,
) error

OnChanOpenConfirm completes the handshake process by setting the active channel in state on the host chain

func (Keeper) OnChanOpenTry

func (k Keeper) OnChanOpenTry(
	ctx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID,
	channelID string,
	chanCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	counterpartyVersion string,
) (string, error)

OnChanOpenTry performs basic validation of the ICA channel and registers a new interchain account (if it doesn't exist). The version returned will include the registered interchain account address.

func (Keeper) OnRecvPacket

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

OnRecvPacket handles a given interchain accounts packet on a destination host chain. If the transaction is successfully executed, the transaction response bytes will be returned.

func (Keeper) Params

Params implements the Query/Params gRPC method

func (Keeper) SetActiveChannelID

func (k Keeper) SetActiveChannelID(ctx sdk.Context, connectionID, portID, channelID string)

SetActiveChannelID stores the active channelID, keyed by the provided connectionID and portID

func (Keeper) SetInterchainAccountAddress

func (k Keeper) SetInterchainAccountAddress(ctx sdk.Context, connectionID, portID, address string)

SetInterchainAccountAddress stores the InterchainAccount address, keyed by the associated connectionID and portID

func (Keeper) SetParams

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

SetParams sets the total set of the host submodule parameters.

func (*Keeper) WithICS4Wrapper added in v7.3.0

func (k *Keeper) WithICS4Wrapper(wrapper porttypes.ICS4Wrapper)

WithICS4Wrapper sets the ICS4Wrapper. This function may be used after the keepers creation to set the middleware which is above this module in the IBC application stack.

func (*Keeper) WithQueryRouter added in v7.5.0

func (k *Keeper) WithQueryRouter(queryRouter icatypes.QueryRouter)

WithQueryRouter sets the QueryRouter. This function may be used after the keeper's creation to set the query router to which queries in the ICA packet data will be routed to if they are module_safe_query. Panics if the queryRouter is nil.

Jump to

Keyboard shortcuts

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