keeper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

func SerializeCosmosTx

func SerializeCosmosTx(cdc codec.BinaryMarshaler, registry codectypes.InterfaceRegistry) func(data interface{}) ([]byte, error)

Types

type Keeper

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

Keeper defines the IBC transfer keeper

func NewKeeper

func NewKeeper(
	cdc codec.BinaryMarshaler, key sdk.StoreKey,
	txEncoders map[string]types.TxEncoder, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper,
	accountKeeper types.AccountKeeper, scopedKeeper capabilitykeeper.ScopedKeeper, router types.Router,
) Keeper

NewKeeper creates a new IBC account Keeper instance

func (Keeper) AddTxEncoder

func (k Keeper) AddTxEncoder(typ string, txEncoder types.TxEncoder) error

func (Keeper) AuthenticateTx

func (k Keeper) AuthenticateTx(ctx sdk.Context, msgs []sdk.Msg, identifier string) error

AuthenticateTx verifies that the messages have the right permission. It will check that the message's signers are the IBC account created by the right chain.

func (Keeper) BindPort

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

BindPort defines a wrapper function for the ort Keeper's function in order to expose it to module's InitGenesis function

func (Keeper) ClaimCapability

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

ClaimCapability allows the transfer module that can claim a capability that IBC module passes to it

func (Keeper) ComputeVirtualTxHash

func (k Keeper) ComputeVirtualTxHash(txBytes []byte, seq uint64) []byte

Compute the virtual tx hash that is used only internally.

func (Keeper) DeserializeTx

func (k Keeper) DeserializeTx(_ sdk.Context, txBytes []byte) ([]sdk.Msg, error)

func (Keeper) GenerateAddress

func (k Keeper) GenerateAddress(identifier string, salt []byte) []byte

Determine account's address that will be created.

func (Keeper) GetIBCAccount

func (k Keeper) GetIBCAccount(ctx sdk.Context, addr sdk.AccAddress) (types.IBCAccount, error)

func (Keeper) GetPort

func (k Keeper) GetPort(ctx sdk.Context) string

GetPort returns the portID for the ibc account module. Used in ExportGenesis

func (Keeper) GetTxEncoder

func (k Keeper) GetTxEncoder(typ string) (types.TxEncoder, bool)

func (Keeper) IBCAccount

IBCAccount implements the Query/IBCAccount gRPC method

func (Keeper) IBCAccountFromData

IBCAccountFromData implements the Query/IBCAccount gRPC method

func (Keeper) IsBound

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

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

func (Keeper) Logger

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

func (Keeper) OnAcknowledgementPacket

func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, data types.IBCAccountPacketData, ack types.IBCAccountPacketAcknowledgement) error

func (Keeper) OnChanOpenInit

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

func (Keeper) OnChanOpenTry

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

func (Keeper) OnRecvPacket

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

func (Keeper) OnTimeoutPacket

func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, data types.IBCAccountPacketData) error

func (Keeper) TryRegisterIBCAccount

func (k Keeper) TryRegisterIBCAccount(ctx sdk.Context, sourcePort, sourceChannel string, salt []byte, timeoutHeight clienttypes.Height, timeoutTimestamp uint64) error

TryRegisterIBCAccount try to register IBC account to source channel. If no source channel exists or doesn't have capability, it will return error. Salt is used to generate deterministic address.

func (Keeper) TryRunTx

func (k Keeper) TryRunTx(ctx sdk.Context, sourcePort, sourceChannel, typ string, data interface{}, timeoutHeight clienttypes.Height, timeoutTimestamp uint64) ([]byte, error)

TryRunTx try to send messages to source channel.

Jump to

Keyboard shortcuts

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