keeper

package
v0.0.0-...-7c30539 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

Keeper defines the IBC fungible transfer keeper

func NewKeeper

func NewKeeper(
	cdc codec.Marshaler, key sdk.StoreKey,
	channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper,
	authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, scopedKeeper capabilitykeeper.ScopedKeeper,
) Keeper

NewKeeper creates a new IBC transfer Keeper instance

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) ChanCloseInit

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

ChanCloseInit defines a wrapper function for the channel Keeper's function in order to expose it to the ICS20 trasfer handler.

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) GetPort

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

GetPort returns the portID for the transfer module. Used in ExportGenesis

func (Keeper) GetTransferAccount

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

GetTransferAccount returns the ICS20 - transfers ModuleAccount

func (Keeper) IsBound

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

IsBound checks if the transfer module is already bound to the desired port

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) OnRecvPacket

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

func (Keeper) OnTimeoutPacket

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

func (Keeper) PacketExecuted

func (k Keeper) PacketExecuted(ctx sdk.Context, packet channelexported.PacketI, acknowledgement []byte) error

PacketExecuted defines a wrapper function for the channel Keeper's function in order to expose it to the ICS20 transfer handler. Keeper retrieves channel capability and passes it into channel keeper for authentication

func (Keeper) SendTransfer

func (k Keeper) SendTransfer(
	ctx sdk.Context,
	sourcePort,
	sourceChannel string,
	amount sdk.Coins,
	sender sdk.AccAddress,
	receiver string,
	timeoutHeight,
	timeoutTimestamp uint64,
) error

SendTransfer handles transfer sending logic. There are 2 possible cases:

1. Sender chain is the source chain of the coins (i.e where they were minted): the coins are transferred to an escrow address (i.e locked) on the sender chain and then transferred to the destination chain (i.e not the source chain) via a packet with the corresponding fungible token data.

2. Coins are not native from the sender chain (i.e tokens sent where transferred over through IBC already): the coins are burned and then a packet is sent to the source chain of the tokens.

func (Keeper) SetPort

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

SetPort sets the portID for the transfer module. Used in InitGenesis

Jump to

Keyboard shortcuts

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