Documentation ¶
Index ¶
- func AllInvariants(k *Keeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
- func TotalEscrowPerDenomInvariants(k *Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
- func (k Keeper) BindPort(ctx sdk.Context, portID string) error
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
- func (k Keeper) Denom(c context.Context, req *types.QueryDenomRequest) (*types.QueryDenomResponse, error)
- func (k Keeper) DenomHash(c context.Context, req *types.QueryDenomHashRequest) (*types.QueryDenomHashResponse, error)
- func (k Keeper) Denoms(c context.Context, req *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
- func (k Keeper) EscrowAddress(c context.Context, req *types.QueryEscrowAddressRequest) (*types.QueryEscrowAddressResponse, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllDenoms(ctx sdk.Context) types.Denoms
- func (k Keeper) GetAllTotalEscrowed(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetDenom(ctx sdk.Context, denomHash cmtbytes.HexBytes) (types.Denom, bool)
- func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPort(ctx sdk.Context) string
- func (k Keeper) GetTotalEscrowForDenom(ctx sdk.Context, denom string) sdk.Coin
- func (k Keeper) HasDenom(ctx sdk.Context, denomHash cmtbytes.HexBytes) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)
- func (k Keeper) IterateDenoms(ctx sdk.Context, cb func(denom types.Denom) bool)
- func (k Keeper) IterateTokensInEscrow(ctx sdk.Context, storeprefix []byte, cb func(denomEscrow sdk.Coin) bool)
- func (Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SetDenom(ctx sdk.Context, denom types.Denom)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPort(ctx sdk.Context, portID string)
- func (k Keeper) SetTotalEscrowForDenom(ctx sdk.Context, coin sdk.Coin)
- func (k Keeper) TotalEscrowForDenom(c context.Context, req *types.QueryTotalEscrowForDenomRequest) (*types.QueryTotalEscrowForDenomResponse, error)
- func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error)
- func (k Keeper) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
- func (k *Keeper) WithICS4Wrapper(wrapper porttypes.ICS4Wrapper)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the transfer module.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
RegisterInvariants registers all transfer invariants
func TotalEscrowPerDenomInvariants ¶
TotalEscrowPerDenomInvariants checks that the total amount escrowed for each denom is not smaller than the amount stored in the state entry.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the IBC fungible transfer keeper
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, legacySubspace types.ParamSubspace, ics4Wrapper porttypes.ICS4Wrapper, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, scopedKeeper exported.ScopedKeeper, authority string, ) Keeper
NewKeeper creates a new IBC transfer 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 ¶
BindPort defines a wrapper function for the port 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) Denom ¶
func (k Keeper) Denom(c context.Context, req *types.QueryDenomRequest) (*types.QueryDenomResponse, error)
Denom implements the Query/Denom gRPC method
func (Keeper) DenomHash ¶
func (k Keeper) DenomHash(c context.Context, req *types.QueryDenomHashRequest) (*types.QueryDenomHashResponse, error)
DenomHash implements the Query/DenomHash gRPC method
func (Keeper) Denoms ¶
func (k Keeper) Denoms(c context.Context, req *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error)
Denoms implements the Query/Denoms gRPC method
func (Keeper) EscrowAddress ¶
func (k Keeper) EscrowAddress(c context.Context, req *types.QueryEscrowAddressRequest) (*types.QueryEscrowAddressResponse, error)
EscrowAddress implements the EscrowAddress gRPC method
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis exports ibc-transfer module's portID and denom trace info into its genesis state.
func (Keeper) GetAllDenoms ¶
GetAllDenoms returns all the denominations.
func (Keeper) GetAllTotalEscrowed ¶
GetAllTotalEscrowed returns the escrow information for all the denominations.
func (Keeper) GetAuthority ¶
GetAuthority returns the transfer module's authority.
func (Keeper) GetICS4Wrapper ¶
func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper
GetICS4Wrapper returns the ICS4Wrapper.
func (Keeper) GetTotalEscrowForDenom ¶
GetTotalEscrowForDenom gets the total amount of source chain tokens that are in escrow, keyed by the denomination.
NOTE: if there is no value stored in state for the provided denom then a new Coin is returned for the denom with an initial value of zero. This accommodates callers to simply call `Add()` on the returned Coin as an empty Coin literal (e.g. sdk.Coin{}) will trigger a panic due to the absence of a denom.
func (Keeper) HasDenom ¶
HasDenom checks if a the key with the given denomination hash exists on the store.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)
InitGenesis initializes the ibc-transfer state and binds to PortID.
func (Keeper) IterateDenoms ¶
IterateDenoms iterates over the denominations in the store and performs a callback function.
func (Keeper) IterateTokensInEscrow ¶
func (k Keeper) IterateTokensInEscrow(ctx sdk.Context, storeprefix []byte, cb func(denomEscrow sdk.Coin) bool)
IterateTokensInEscrow iterates over the denomination escrows in the store and performs a callback function. Denominations for which an invalid value (i.e. not integer) is stored, will be skipped.
func (Keeper) OnAcknowledgementPacket ¶
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketDataV2, ack channeltypes.Acknowledgement) error
OnAcknowledgementPacket responds to the success or failure of a packet acknowledgment written on the receiving chain.
If no forwarding occurs and the acknowledgement was a success then nothing occurs. Otherwise, if the acknowledgement failed, then the sender is refunded their tokens.
If forwarding is used and the acknowledgement was a success, a successful acknowledgement is written for the forwarded packet. Otherwise, if the acknowledgement failed, after refunding the sender, the tokens of the forwarded packet that were received are in turn either refunded or burned.
func (Keeper) OnRecvPacket ¶
func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketDataV2) error
OnRecvPacket processes a cross chain fungible token transfer.
If the sender chain is the source of minted tokens then vouchers will be minted and sent to the receiving address. Otherwise if the sender chain is sending back tokens this chain originally transferred to it, the tokens are unescrowed and sent to the receiving address.
In the case of packet forwarding, the packet is sent on the next hop as specified in the packet's ForwardingPacketData.
func (Keeper) OnTimeoutPacket ¶
func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketDataV2) error
OnTimeoutPacket processes a transfer packet timeout.
If no forwarding occurs, it refunds the tokens to the sender.
If forwarding is used and the chain acted as a middle hop on a multihop transfer, after refunding the tokens to the sender, the tokens of the forwarded packet that were received are in turn either refunded or burned.
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements the Query/Params gRPC method
func (Keeper) SetDenom ¶
SetDenom sets a new {denom hash -> denom } pair to the store. This allows for reverse lookup of the denom given the hash.
func (Keeper) SetTotalEscrowForDenom ¶
SetTotalEscrowForDenom stores the total amount of source chain tokens that are in escrow. Amount is stored in state if and only if it is not equal to zero. The function will panic if the amount is negative.
func (Keeper) TotalEscrowForDenom ¶
func (k Keeper) TotalEscrowForDenom(c context.Context, req *types.QueryTotalEscrowForDenomRequest) (*types.QueryTotalEscrowForDenomResponse, error)
TotalEscrowForDenom implements the TotalEscrowForDenom gRPC method.
func (Keeper) Transfer ¶
func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error)
Transfer defines an rpc handler method for MsgTransfer.
func (Keeper) UpdateParams ¶
func (k Keeper) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
UpdateParams defines an rpc handler method for MsgUpdateParams. Updates the ibc-transfer module's parameters.
func (*Keeper) WithICS4Wrapper ¶
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.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func (Migrator) MigrateDenomMetadata ¶
MigrateDenomMetadata sets token metadata for all the IBC denom traces
func (Migrator) MigrateDenomTraceToDenom ¶
MigrateDenomTraceToDenom migrates storage from using DenomTrace to Denom.
func (Migrator) MigrateParams ¶
MigrateParams migrates the transfer module's parameters from the x/params to self store.