Documentation ¶
Index ¶
- func BuildWasmExecMsg(msgType string, packet exported.PacketI) ([]byte, error)
- func CheckAndUpdateRateLimits(ctx sdk.Context, contractKeeper *wasmkeeper.PermissionedKeeper, ...) error
- func UndoSendRateLimit(ctx sdk.Context, contractKeeper *wasmkeeper.PermissionedKeeper, ...) error
- func ValidateReceiverAddress(packet exported.PacketI) error
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (b AppModuleBasic) GetQueryCmd() *cobra.Command
- func (b AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) Name() string
- func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func (b AppModuleBasic) RegisterRESTRoutes(ctx client.Context, r *mux.Router)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
- type IBCModule
- func (im *IBCModule) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (im *IBCModule) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, ...) error
- func (im *IBCModule) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error
- func (im *IBCModule) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error
- func (im *IBCModule) OnChanOpenAck(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, ...) error
- func (im *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 (im *IBCModule) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) exported.Acknowledgement
- func (im *IBCModule) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error
- func (im *IBCModule) RevertSentPacket(ctx sdk.Context, packet exported.PacketI) error
- func (im *IBCModule) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI) error
- func (im *IBCModule) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ...) error
- type ICS4Wrapper
- func (i *ICS4Wrapper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (i *ICS4Wrapper) GetParams(ctx sdk.Context) (contract string)
- func (i *ICS4Wrapper) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI) error
- func (i *ICS4Wrapper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ...) error
- type PacketMsg
- type RecvPacketMsg
- type SendPacketMsg
- type UndoPacketMsg
- type UndoSendMsg
- type UnwrappedPacket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildWasmExecMsg ¶
func CheckAndUpdateRateLimits ¶
func CheckAndUpdateRateLimits(ctx sdk.Context, contractKeeper *wasmkeeper.PermissionedKeeper, msgType, contract string, packet exported.PacketI, ) error
func UndoSendRateLimit ¶
func UndoSendRateLimit(ctx sdk.Context, contractKeeper *wasmkeeper.PermissionedKeeper, contract string, packet exported.PacketI, ) error
func ValidateReceiverAddress ¶
Types ¶
type AppModuleBasic ¶
type AppModuleBasic struct{}
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
func (AppModuleBasic) GetQueryCmd ¶
func (b AppModuleBasic) GetQueryCmd() *cobra.Command
func (AppModuleBasic) GetTxCmd ¶
func (b AppModuleBasic) GetTxCmd() *cobra.Command
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
func (AppModuleBasic) RegisterInterfaces ¶
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers interfaces and implementations of the ibc-rate-limit module.
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
func (AppModuleBasic) RegisterRESTRoutes ¶
func (b AppModuleBasic) RegisterRESTRoutes(ctx client.Context, r *mux.Router)
--------------------------------------- Interfaces.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the ibc-rate-limit module.
type IBCModule ¶
type IBCModule struct {
// contains filtered or unexported fields
}
func NewIBCModule ¶
func NewIBCModule(app porttypes.IBCModule, ics4 *ICS4Wrapper) IBCModule
func (*IBCModule) GetAppVersion ¶
func (*IBCModule) OnAcknowledgementPacket ¶
func (im *IBCModule) OnAcknowledgementPacket( ctx sdk.Context, 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 (im *IBCModule) OnChanOpenAck( ctx sdk.Context, portID, channelID string, counterpartyChannelID 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, channelCap *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, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string, ) (string, error)
OnChanOpenTry implements the IBCModule interface
func (*IBCModule) OnRecvPacket ¶
func (im *IBCModule) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ) exported.Acknowledgement
OnRecvPacket implements the IBCModule interface
func (*IBCModule) OnTimeoutPacket ¶
func (im *IBCModule) OnTimeoutPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ) error
OnTimeoutPacket implements the IBCModule interface
func (*IBCModule) RevertSentPacket ¶
RevertSentPacket Notifies the contract that a sent packet wasn't properly received
func (*IBCModule) SendPacket ¶
func (im *IBCModule) SendPacket( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ) error
SendPacket implements the ICS4 Wrapper interface
func (*IBCModule) WriteAcknowledgement ¶
func (im *IBCModule) WriteAcknowledgement( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement, ) error
WriteAcknowledgement implements the ICS4 Wrapper interface
type ICS4Wrapper ¶
type ICS4Wrapper struct { ContractKeeper *wasmkeeper.PermissionedKeeper // contains filtered or unexported fields }
func NewICS4Middleware ¶
func NewICS4Middleware( channel porttypes.ICS4Wrapper, accountKeeper *authkeeper.AccountKeeper, contractKeeper *wasmkeeper.PermissionedKeeper, bankKeeper *bankkeeper.BaseKeeper, paramSpace paramtypes.Subspace, ) ICS4Wrapper
func (*ICS4Wrapper) GetAppVersion ¶
func (*ICS4Wrapper) SendPacket ¶
func (i *ICS4Wrapper) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI) error
SendPacket implements the ICS4 interface and is called when sending packets. This method retrieves the contract from the middleware's parameters and checks if the limits have been exceeded for the current transfer, in which case it returns an error preventing the IBC send from taking place. If the contract param is not configured, or the contract doesn't have a configuration for the (channel+denom) being used, transfers are not prevented and handled by the wrapped IBC app
func (*ICS4Wrapper) WriteAcknowledgement ¶
func (i *ICS4Wrapper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement) error
type PacketMsg ¶
type PacketMsg struct {
Packet UnwrappedPacket `json:"packet"`
}
type RecvPacketMsg ¶
type RecvPacketMsg struct {
RecvPacket PacketMsg `json:"recv_packet"`
}
type SendPacketMsg ¶
type SendPacketMsg struct {
SendPacket PacketMsg `json:"send_packet"`
}
type UndoPacketMsg ¶
type UndoPacketMsg struct {
Packet UnwrappedPacket `json:"packet"`
}
type UndoSendMsg ¶
type UndoSendMsg struct {
UndoSend UndoPacketMsg `json:"undo_send"`
}
type UnwrappedPacket ¶
type UnwrappedPacket struct { Sequence uint64 `json:"sequence"` SourcePort string `json:"source_port"` SourceChannel string `json:"source_channel"` DestinationPort string `json:"destination_port"` DestinationChannel string `json:"destination_channel"` Data transfertypes.FungibleTokenPacketData `json:"data"` TimeoutHeight clienttypes.Height `json:"timeout_height"` TimeoutTimestamp uint64 `json:"timeout_timestamp,omitempty"` }