ibccallbacks

package module
v0.0.0-...-9413b4e Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IBCMiddleware

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

IBCMiddleware implements the ICS26 callbacks for the ibc-callbacks middleware given the underlying application.

func NewIBCMiddleware

func NewIBCMiddleware(
	app porttypes.IBCModule, ics4Wrapper porttypes.ICS4Wrapper,
	contractKeeper types.ContractKeeper, maxCallbackGas uint64,
) IBCMiddleware

NewIBCMiddleware creates a new IBCMiddlware given the keeper and underlying application. The underlying application must implement the required callback interfaces.

func (IBCMiddleware) GetAppVersion

func (im IBCMiddleware) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)

GetAppVersion implements the ICS4Wrapper interface. Callbacks has no version, so the call is deferred to the underlying application.

func (*IBCMiddleware) GetICS4Wrapper

func (im *IBCMiddleware) GetICS4Wrapper() porttypes.ICS4Wrapper

GetICS4Wrapper returns the ICS4Wrapper.

func (IBCMiddleware) OnAcknowledgementPacket

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

OnAcknowledgementPacket implements source callbacks for acknowledgement packets. It defers to the underlying application and then calls the contract callback. If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are reverted via a panic.

func (IBCMiddleware) OnChanCloseConfirm

func (im IBCMiddleware) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error

OnChanCloseConfirm defers to the underlying application

func (IBCMiddleware) OnChanCloseInit

func (im IBCMiddleware) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error

OnChanCloseInit defers to the underlying application

func (IBCMiddleware) OnChanOpenAck

func (im IBCMiddleware) OnChanOpenAck(
	ctx sdk.Context,
	portID,
	channelID,
	counterpartyChannelID,
	counterpartyVersion string,
) error

OnChanOpenAck defers to the underlying application

func (IBCMiddleware) OnChanOpenConfirm

func (im IBCMiddleware) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error

OnChanOpenConfirm defers to the underlying application

func (IBCMiddleware) OnChanOpenInit

func (im IBCMiddleware) OnChanOpenInit(
	ctx sdk.Context,
	channelOrdering channeltypes.Order,
	connectionHops []string,
	portID,
	channelID string,
	channelCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	version string,
) (string, error)

OnChanOpenInit defers to the underlying application

func (IBCMiddleware) OnChanOpenTry

func (im IBCMiddleware) OnChanOpenTry(
	ctx sdk.Context,
	channelOrdering channeltypes.Order,
	connectionHops []string, portID,
	channelID string,
	channelCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	counterpartyVersion string,
) (string, error)

OnChanOpenTry defers to the underlying application

func (IBCMiddleware) OnChanUpgradeAck

func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counterpartyVersion string) error

OnChanUpgradeAck implements the IBCModule interface

func (IBCMiddleware) OnChanUpgradeInit

func (im IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string) (string, error)

OnChanUpgradeInit implements the IBCModule interface

func (IBCMiddleware) OnChanUpgradeOpen

func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string)

OnChanUpgradeOpen implements the IBCModule interface

func (IBCMiddleware) OnChanUpgradeTry

func (im IBCMiddleware) OnChanUpgradeTry(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, counterpartyVersion string) (string, error)

OnChanUpgradeTry implements the IBCModule interface

func (IBCMiddleware) OnRecvPacket

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

OnRecvPacket implements the ReceivePacket destination callbacks for the ibc-callbacks middleware during synchronous packet acknowledgement. It defers to the underlying application and then calls the contract callback. If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are reverted via a panic.

func (IBCMiddleware) OnTimeoutPacket

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

OnTimeoutPacket implements timeout source callbacks for the ibc-callbacks middleware. It defers to the underlying application and then calls the contract callback. If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are reverted via a panic.

func (IBCMiddleware) SendPacket

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

SendPacket implements source callbacks for sending packets. It defers to the underlying application and then calls the contract callback. If the contract callback returns an error, panics, or runs out of gas, then the packet send is rejected.

func (IBCMiddleware) UnmarshalPacketData

func (im IBCMiddleware) UnmarshalPacketData(bz []byte) (interface{}, error)

UnmarshalPacketData defers to the underlying app to unmarshal the packet data. This function implements the optional PacketDataUnmarshaler interface.

func (*IBCMiddleware) WithICS4Wrapper

func (im *IBCMiddleware) WithICS4Wrapper(wrapper porttypes.ICS4Wrapper)

WithICS4Wrapper sets the ICS4Wrapper. This function may be used after the middleware's creation to set the middleware which is above this module in the IBC application stack.

func (IBCMiddleware) WriteAcknowledgement

func (im IBCMiddleware) WriteAcknowledgement(
	ctx sdk.Context,
	chanCap *capabilitytypes.Capability,
	packet ibcexported.PacketI,
	ack ibcexported.Acknowledgement,
) error

WriteAcknowledgement implements the ReceivePacket destination callbacks for the ibc-callbacks middleware during asynchronous packet acknowledgement. It defers to the underlying application and then calls the contract callback. If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are reverted via a panic.

Directories

Path Synopsis
testing
simapp/params
Package params defines the simulation parameters in the simapp.
Package params defines the simulation parameters in the simapp.

Jump to

Keyboard shortcuts

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