Documentation ¶
Index ¶
- func ExecConvForIncomingCoins(ctx sdk.Context, incomingCoins sdk.Coin, finalCoins sdk.Coin, ...) error
- func ExecConvForRefundCoins(ctx sdk.Context, incomingCoins sdk.Coin, finalCoins sdk.Coin, ...) error
- func GetConvForIncomingCoins(ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, ...) (sdk.Coin, sdk.Coin)
- func GetConvForRefundCoins(ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, ...) (sdk.Coin, sdk.Coin)
- func GetMintedDenomFromPacket(packet channeltypes.Packet, data transfertypes.FungibleTokenPacketData) string
- func IncreasePrecision(dec sdk.Dec, po int64) sdk.Dec
- func IsRecvPacketAllowed(ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, ...) bool
- func IsRecvPacketReturning(packet channeltypes.Packet, data transfertypes.FungibleTokenPacketData) bool
- func IsWhitelisted(ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, denom string) bool
- func OnAcknowledgementMaybeConvert(ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, ...) (*sdk.Result, error)
- func OnRecvPacketEnforceWhitelist(ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, ...) (*sdk.Result, []byte, error)
- func OnRecvPacketMaybeConvert(ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, ...) (*sdk.Result, []byte, error)
- func OnTimeoutMaybeConvert(ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, ...) (*sdk.Result, error)
- func ShouldConvertIncomingCoins(ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, ...) bool
- func ShouldConvertRefundCoins(ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, ...) bool
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context, codec codec.JSONMarshaler) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, codec codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate
- func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier
- func (am AppModule) Name() string
- func (am AppModule) OnAcknowledgementPacket(ctx sdk.Context, packet types.Packet, acknowledgement []byte) (*sdk.Result, error)
- func (am AppModule) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error
- func (am AppModule) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error
- func (am AppModule) OnChanOpenAck(ctx sdk.Context, portID, channelID string, counterpartyVersion string) error
- func (am AppModule) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error
- func (am AppModule) OnChanOpenInit(ctx sdk.Context, order types.Order, connectionHops []string, portID string, ...) error
- func (am AppModule) OnChanOpenTry(ctx sdk.Context, order types.Order, connectionHops []string, ...) error
- func (am AppModule) OnRecvPacket(ctx sdk.Context, packet types.Packet) (*sdk.Result, []byte, error)
- func (am AppModule) OnTimeoutPacket(ctx sdk.Context, packet types.Packet) (*sdk.Result, error)
- func (am AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) RegisterServices(cfg module.Configurator)
- func (am AppModule) Route() sdk.Route
- type AppModuleBasic
- func (am AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage
- func (am AppModuleBasic) GetQueryCmd() *cobra.Command
- func (am AppModuleBasic) GetTxCmd() *cobra.Command
- func (am AppModuleBasic) Name() string
- func (am AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (am AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func (am AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func (am AppModuleBasic) RegisterRESTRoutes(ctx client.Context, rtr *mux.Router)
- func (am AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxEncodingConfig, bz json.RawMessage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecConvForIncomingCoins ¶
func ExecConvForIncomingCoins( ctx sdk.Context, incomingCoins sdk.Coin, finalCoins sdk.Coin, bankKeeper sdktransfertypes.BankKeeper, packet channeltypes.Packet, data sdktransfertypes.FungibleTokenPacketData, ) error
func ExecConvForRefundCoins ¶
func ExecConvForRefundCoins( ctx sdk.Context, incomingCoins sdk.Coin, finalCoins sdk.Coin, bankKeeper sdktransfertypes.BankKeeper, packet channeltypes.Packet, data sdktransfertypes.FungibleTokenPacketData, ) error
func GetConvForIncomingCoins ¶
func GetConvForIncomingCoins( ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, packet channeltypes.Packet, data sdktransfertypes.FungibleTokenPacketData, ) (sdk.Coin, sdk.Coin)
GetConvForIncomingCoins returns 1) the coins that are being received via IBC, which need to be deducted from that denom when converting to final denom, and 2) the coins that need to be added to the final denom.
func GetConvForRefundCoins ¶
func GetConvForRefundCoins( ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, packet channeltypes.Packet, data sdktransfertypes.FungibleTokenPacketData, ) (sdk.Coin, sdk.Coin)
GetConvForRefundCoins returns 1) the coins that are being received via IBC, which need to be deducted from that denom when converting to final denom, and 2) the coins that need to be added to the final denom.
func GetMintedDenomFromPacket ¶
func GetMintedDenomFromPacket(packet channeltypes.Packet, data transfertypes.FungibleTokenPacketData) string
func IsRecvPacketAllowed ¶
func IsRecvPacketAllowed(ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, packet channeltypes.Packet, data transfertypes.FungibleTokenPacketData) bool
func IsRecvPacketReturning ¶
func IsRecvPacketReturning(packet channeltypes.Packet, data transfertypes.FungibleTokenPacketData) bool
IsRecvPacketReturning() indicates if a token is returning to sifchain, i.e the sender is not the source of the token.
func IsWhitelisted ¶
func OnAcknowledgementMaybeConvert ¶
func OnAcknowledgementMaybeConvert( ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, whitelistKeeper tokenregistrytypes.Keeper, bankKeeper sdktransfertypes.BankKeeper, packet channeltypes.Packet, acknowledgement []byte, ) (*sdk.Result, error)
OnAcknowledgementMaybeConvert() runs on acknowledgement from receiving chain, of an outgoing send. I.e: Receiving ack from recipient chain of our send. Case A: Recipient acknowledges our send, do nothing. Case B: Recipient acknowledges error of our send, refund sender their coins.
func OnRecvPacketEnforceWhitelist ¶
func OnRecvPacketEnforceWhitelist( ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, whitelistKeeper tokenregistrytypes.Keeper, bankKeeper transfertypes.BankKeeper, packet channeltypes.Packet, ) (*sdk.Result, []byte, error)
func OnRecvPacketMaybeConvert ¶
func OnRecvPacketMaybeConvert( ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, whitelistKeeper tokenregistrytypes.Keeper, bankKeeper transfertypes.BankKeeper, packet channeltypes.Packet, ) (*sdk.Result, []byte, error)
OnRecvPacketMaybeConvert will receive a transfer (after whitelisting is checked), and if the receive was successful, it will be converted into the unit_denom of the denom minted by the IBC transfer module.
func OnTimeoutMaybeConvert ¶
func OnTimeoutMaybeConvert( ctx sdk.Context, sdkTransferKeeper sctransfertypes.SDKTransferKeeper, whitelistKeeper tokenregistrytypes.Keeper, bankKeeper transfertypes.BankKeeper, packet channeltypes.Packet, ) (*sdk.Result, error)
OnTimeoutPacket() refunds the sender since the original packet sent was never received and has been timed out.
sdkkeeper.refundPacketToken will unescrow and send back the tokens back to sender if the sending chain was the source chain. Otherwise, the sent tokens were burnt in the original send so new tokens are minted and sent to the sending address.
OnTimeoutMaybeConvert() potentially does a conversion from the denom that was sent out, back to the original unit_denom.
func ShouldConvertIncomingCoins ¶
func ShouldConvertIncomingCoins( ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, packet channeltypes.Packet, data sdktransfertypes.FungibleTokenPacketData, ) bool
ShouldConvertIncomingCoins() is called after the SDK has accepted incoming coins, or after the coins have "come back in" when a send is refunded.
func ShouldConvertRefundCoins ¶
func ShouldConvertRefundCoins( ctx sdk.Context, whitelistKeeper tokenregistrytypes.Keeper, packet channeltypes.Packet, data sdktransfertypes.FungibleTokenPacketData, ) bool
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the ibctransfer module.
func NewAppModule ¶
func NewAppModule(sdkTransferKeeper sdktransferkeeper.Keeper, whitelistKeeper tokenregistrytypes.Keeper, bankKeeper bankkeeper.Keeper, cdc codec.BinaryMarshaler) AppModule
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock returns the begin blocker for the dispensation module.
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the dispensation module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context, codec codec.JSONMarshaler) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the dispensation module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, codec codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the dispensation module. It returns no validator updates
func (AppModule) LegacyQuerierHandler ¶
func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier
IBC does not support a legacy querier
func (AppModule) OnAcknowledgementPacket ¶
func (AppModule) OnChanCloseConfirm ¶
func (AppModule) OnChanCloseInit ¶
func (AppModule) OnChanOpenAck ¶
func (AppModule) OnChanOpenConfirm ¶
func (AppModule) OnChanOpenInit ¶
func (am AppModule) OnChanOpenInit(ctx sdk.Context, order types.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty types.Counterparty, version string) error
func (AppModule) OnChanOpenTry ¶
func (am AppModule) OnChanOpenTry(ctx sdk.Context, order types.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty types.Counterparty, version, counterpartyVersion string) error
func (AppModule) OnRecvPacket ¶
func (AppModule) OnTimeoutPacket ¶
func (AppModule) QuerierRoute ¶
QuerierRoute returns the dispensation module's querier route name.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants registers the dispensation module invariants.
func (AppModule) RegisterServices ¶
func (am AppModule) RegisterServices(cfg module.Configurator)
type AppModuleBasic ¶
type AppModuleBasic struct {
// contains filtered or unexported fields
}
AppModuleBasic defines the basic application module.
func (AppModuleBasic) DefaultGenesis ¶
func (am AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the module.
func (AppModuleBasic) GetQueryCmd ¶
func (am AppModuleBasic) GetQueryCmd() *cobra.Command
GetQueryCmd returns no root query command for the module.
func (AppModuleBasic) GetTxCmd ¶
func (am AppModuleBasic) GetTxCmd() *cobra.Command
GetTxCmd returns the root tx command for the module.
func (AppModuleBasic) Name ¶
func (am AppModuleBasic) Name() string
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (am AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
func (AppModuleBasic) RegisterInterfaces ¶
func (am AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)
RegisterInterfaces registers the module's interface types
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (am AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
func (AppModuleBasic) RegisterRESTRoutes ¶
func (am AppModuleBasic) RegisterRESTRoutes(ctx client.Context, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the module.
func (AppModuleBasic) ValidateGenesis ¶
func (am AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxEncodingConfig, bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the module.