uics20

package
v6.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICS20Module

type ICS20Module struct {
	porttypes.IBCModule
	// contains filtered or unexported fields
}

ICS20Module implements ibcporttypes.IBCModule for ICS20 transfer middleware. It overwrites OnAcknowledgementPacket and OnTimeoutPacket to revert quota update on acknowledgement error or timeout.

func NewICS20Module

NewICS20Module is an IBCMiddlware constructor. `app` must be an ICS20 app.

func (ICS20Module) OnAcknowledgementPacket

func (im ICS20Module) OnAcknowledgementPacket(
	ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress,
) error

OnAcknowledgementPacket is called on the packet sender chain, once the receiver acknowledged the packet reception.

func (ICS20Module) OnRecvPacket

func (im ICS20Module) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress,
) exported.Acknowledgement

OnRecvPacket is called when a receiver chain receives a packet from SendPacket.

  1. record IBC quota
  2. Try to unpack and prepare memo. If memo has a correct structure, and fallback addr is defined but malformed, we cancel the transfer (otherwise would not be able to use it correctly).
  3. If memo has a correct structure, but memo.messages can't be unpack or don't pass validation, then we continue with the transfer and overwrite the original receiver to fallback_addr if it's defined.
  4. Execute the downstream middleware and the transfer app.
  5. Execute hooks. If hook execution fails, and the fallback_addr is defined, then we revert the transfer (and all related state changes and events) and use send the tokens to the `fallback_addr` instead.

func (ICS20Module) OnTimeoutPacket

func (im ICS20Module) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error

OnTimeoutPacket implements types.Middleware

type ICS4

type ICS4 struct {
	porttypes.ICS4Wrapper
	// contains filtered or unexported fields
}

ICS4 implements porttypes.ICS4Wrapper (middleware to send packets and acknowledgements) and overwrites SendPacket to check IBC quota.

func NewICS4

func NewICS4(parent porttypes.ICS4Wrapper, kb quota.KeeperBuilder) ICS4

func (ICS4) SendPacket

func (q ICS4) SendPacket(
	ctx sdk.Context,
	chanCap *capabilitytypes.Capability,
	sourcePort string,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
	data []byte,
) (uint64, error)

SendPacket implements types.Middleware

type MemoHandler added in v6.4.0

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

Jump to

Keyboard shortcuts

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