Documentation ¶
Overview ¶
Package transfer implements the packet data structure, state machine handling logic, and encoding details for the transfer of fungible tokens over an IBC channel between two modules on separate chains. This implementation is based off the ICS 20 specification (https://github.com/cosmos/ibc/blob/main/spec/app/ics-020-fungible-token-transfer)
Index ¶
- func ValidateTransferChannelParams(ctx sdk.Context, transferkeeper keeper.Keeper, order channeltypes.Order, ...) error
- type AppModule
- func (AppModule) ConsensusVersion() uint64
- func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage
- func (AppModule) GenerateGenesisState(simState *module.SimulationState)
- func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage)
- func (AppModule) IsAppModule()
- func (AppModule) IsOnePerModuleType()
- func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) RegisterServices(cfg module.Configurator)
- func (AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry)
- func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (AppModuleBasic) GetQueryCmd() *cobra.Command
- func (AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
- type IBCModule
- func (im IBCModule) OnAcknowledgementPacket(ctx sdk.Context, channelVersion string, packet channeltypes.Packet, ...) error
- func (IBCModule) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error
- func (IBCModule) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error
- func (IBCModule) OnChanOpenAck(ctx sdk.Context, portID, channelID string, _ string, ...) error
- func (IBCModule) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error
- func (im IBCModule) OnChanOpenInit(ctx sdk.Context, order channeltypes.Order, connectionHops []string, ...) (string, error)
- func (im IBCModule) OnChanOpenTry(ctx sdk.Context, order channeltypes.Order, connectionHops []string, ...) (string, error)
- func (IBCModule) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counterpartyVersion string) error
- func (im IBCModule) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, ...) (string, error)
- func (IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, ...)
- func (im IBCModule) OnChanUpgradeTry(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, ...) (string, error)
- func (im IBCModule) OnRecvPacket(ctx sdk.Context, channelVersion string, packet channeltypes.Packet, ...) ibcexported.Acknowledgement
- func (im IBCModule) OnTimeoutPacket(ctx sdk.Context, channelVersion string, packet channeltypes.Packet, ...) error
- func (im IBCModule) UnmarshalPacketData(ctx sdk.Context, portID string, channelID string, bz []byte) (interface{}, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateTransferChannelParams ¶
func ValidateTransferChannelParams( ctx sdk.Context, transferkeeper keeper.Keeper, order channeltypes.Order, portID string, channelID string, ) error
ValidateTransferChannelParams does validation of a newly created transfer channel. A transfer channel must be UNORDERED, use the correct port (by default 'transfer'), and use the current supported version. Only 2^32 channels are allowed to be created.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule represents the AppModule for this module
func NewAppModule ¶
NewAppModule creates a new 20-transfer module
func (AppModule) ConsensusVersion ¶
ConsensusVersion implements AppModule/ConsensusVersion defining the current version of transfer.
func (AppModule) ExportGenesis ¶
ExportGenesis returns the exported genesis state as raw bytes for the ibc-transfer module.
func (AppModule) GenerateGenesisState ¶
func (AppModule) GenerateGenesisState(simState *module.SimulationState)
GenerateGenesisState creates a randomized GenState of the transfer module.
func (AppModule) InitGenesis ¶
InitGenesis performs genesis initialization for the ibc-transfer module. It returns no validator updates.
func (AppModule) IsAppModule ¶
func (AppModule) IsAppModule()
IsAppModule implements the appmodule.AppModule interface.
func (AppModule) IsOnePerModuleType ¶
func (AppModule) IsOnePerModuleType()
IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) ProposalMsgs ¶
func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg
ProposalMsgs returns msgs used for governance proposals for simulations.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants implements the AppModule interface
func (AppModule) RegisterServices ¶
func (am AppModule) RegisterServices(cfg module.Configurator)
RegisterServices registers module services.
func (AppModule) RegisterStoreDecoder ¶
func (AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry)
RegisterStoreDecoder registers a decoder for transfer module's types
func (AppModule) WeightedOperations ¶
func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation
WeightedOperations returns the all the transfer module operations with their respective weights.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic is the IBC Transfer AppModuleBasic
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the ibc transfer module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd() *cobra.Command
GetQueryCmd implements AppModuleBasic interface
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd() *cobra.Command
GetTxCmd implements AppModuleBasic interface
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name implements AppModuleBasic interface
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc-transfer module.
func (AppModuleBasic) RegisterInterfaces ¶
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers module concrete types into protobuf Any.
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec implements AppModuleBasic interface
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the ibc transfer module.
type IBCModule ¶
type IBCModule struct {
// contains filtered or unexported fields
}
IBCModule implements the ICS26 interface for transfer given the transfer keeper.
func NewIBCModule ¶
NewIBCModule creates a new IBCModule given the keeper
func (IBCModule) OnAcknowledgementPacket ¶
func (im IBCModule) OnAcknowledgementPacket( ctx sdk.Context, channelVersion string, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress, ) error
OnAcknowledgementPacket implements the IBCModule interface
func (IBCModule) OnChanCloseConfirm ¶
OnChanCloseConfirm implements the IBCModule interface
func (IBCModule) OnChanCloseInit ¶
OnChanCloseInit implements the IBCModule interface
func (IBCModule) OnChanOpenAck ¶
func (IBCModule) OnChanOpenAck( ctx sdk.Context, portID, channelID string, _ string, counterpartyVersion string, ) error
OnChanOpenAck implements the IBCModule interface
func (IBCModule) OnChanOpenConfirm ¶
OnChanOpenConfirm implements the IBCModule interface
func (IBCModule) OnChanOpenInit ¶
func (im IBCModule) OnChanOpenInit( ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, chanCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string, ) (string, error)
OnChanOpenInit implements the IBCModule interface
func (IBCModule) OnChanOpenTry ¶
func (im IBCModule) OnChanOpenTry( ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, chanCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string, ) (string, error)
OnChanOpenTry implements the IBCModule interface.
func (IBCModule) OnChanUpgradeAck ¶
func (IBCModule) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counterpartyVersion string) error
OnChanUpgradeAck implements the IBCModule interface
func (IBCModule) OnChanUpgradeInit ¶
func (im IBCModule) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string) (string, error)
OnChanUpgradeInit implements the IBCModule interface
func (IBCModule) OnChanUpgradeOpen ¶
func (IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string)
OnChanUpgradeOpen implements the IBCModule interface
func (IBCModule) OnChanUpgradeTry ¶
func (im IBCModule) OnChanUpgradeTry(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, counterpartyVersion string) (string, error)
OnChanUpgradeTry implements the IBCModule interface
func (IBCModule) OnRecvPacket ¶
func (im IBCModule) OnRecvPacket( ctx sdk.Context, channelVersion string, packet channeltypes.Packet, relayer sdk.AccAddress, ) ibcexported.Acknowledgement
OnRecvPacket implements the IBCModule interface. A successful acknowledgement is returned if the packet data is successfully decoded and the receive application logic returns without error. A nil acknowledgement may be returned when using the packet forwarding feature. This signals to core IBC that the acknowledgement will be written asynchronously.
func (IBCModule) OnTimeoutPacket ¶
func (im IBCModule) OnTimeoutPacket( ctx sdk.Context, channelVersion string, packet channeltypes.Packet, relayer sdk.AccAddress, ) error
OnTimeoutPacket implements the IBCModule interface
func (IBCModule) UnmarshalPacketData ¶
func (im IBCModule) UnmarshalPacketData(ctx sdk.Context, portID string, channelID string, bz []byte) (interface{}, string, error)
UnmarshalPacketData attempts to unmarshal the provided packet data bytes into a FungibleTokenPacketData. This function implements the optional PacketDataUnmarshaler interface required for ADR 008 support.
Directories ¶
Path | Synopsis |
---|---|
client
|
|
internal
|
|
NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov controlled execution of MsgUpdateParams messages.
|
NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov controlled execution of MsgUpdateParams messages. |