Documentation
¶
Index ¶
- type IBCMiddleware
- func (im *IBCMiddleware) GetWriteAckWrapper() api.WriteAcknowledgementWrapper
- func (im *IBCMiddleware) OnAcknowledgementPacket(ctx sdk.Context, sourceClient string, destinationClient string, ...) error
- func (im *IBCMiddleware) OnRecvPacket(ctx sdk.Context, sourceClient string, destinationClient string, ...) channeltypesv2.RecvPacketResult
- func (im *IBCMiddleware) OnSendPacket(ctx sdk.Context, sourceClient string, destinationClient string, ...) error
- func (im *IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, sourceClient string, destinationClient string, ...) error
- func (im *IBCMiddleware) WithWriteAckWrapper(writeAckWrapper api.WriteAcknowledgementWrapper)
- func (im *IBCMiddleware) WriteAcknowledgement(ctx sdk.Context, clientID string, sequence uint64, ...) error
- type RecvAcknowledgement
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 IBC v2 middleware interface with the underlying application.
func NewIBCMiddleware ¶
func NewIBCMiddleware( app api.IBCModule, writeAckWrapper api.WriteAcknowledgementWrapper, contractKeeper types.ContractKeeper, chanKeeperV2 types.ChannelKeeperV2, maxCallbackGas uint64, ) *IBCMiddleware
NewIBCMiddleware creates a new IBCMiddleware instance given the keeper and underlying application. The underlying application must implement the required callback interfaces.
func (*IBCMiddleware) GetWriteAckWrapper ¶
func (im *IBCMiddleware) GetWriteAckWrapper() api.WriteAcknowledgementWrapper
GetWriteAckWrapper returns the WriteAckWrapper
func (*IBCMiddleware) OnAcknowledgementPacket ¶
func (im *IBCMiddleware) OnAcknowledgementPacket( ctx sdk.Context, sourceClient string, destinationClient string, sequence uint64, acknowledgement []byte, payload channeltypesv2.Payload, 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) OnRecvPacket ¶
func (im *IBCMiddleware) OnRecvPacket( ctx sdk.Context, sourceClient string, destinationClient string, sequence uint64, payload channeltypesv2.Payload, relayer sdk.AccAddress, ) channeltypesv2.RecvPacketResult
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) OnSendPacket ¶
func (im *IBCMiddleware) OnSendPacket( ctx sdk.Context, sourceClient string, destinationClient string, sequence uint64, payload channeltypesv2.Payload, signer sdk.AccAddress, ) error
OnSendPacket 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) OnTimeoutPacket ¶
func (im *IBCMiddleware) OnTimeoutPacket( ctx sdk.Context, sourceClient string, destinationClient string, sequence uint64, payload channeltypesv2.Payload, 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. OnTimeoutPacket is executed when a packet has timed out on the receiving chain.
func (*IBCMiddleware) WithWriteAckWrapper ¶
func (im *IBCMiddleware) WithWriteAckWrapper(writeAckWrapper api.WriteAcknowledgementWrapper)
WithWriteAckWrapper sets the WriteAcknowledgementWrapper for the middleware.
func (*IBCMiddleware) WriteAcknowledgement ¶
func (im *IBCMiddleware) WriteAcknowledgement( ctx sdk.Context, clientID string, sequence uint64, ack channeltypesv2.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.
type RecvAcknowledgement ¶
type RecvAcknowledgement []byte
Create internal implementation of exported.Acknowledgement to pass the app acknowledgement bytes to contractKeeper IBCReceivePacketCallback interface
func (RecvAcknowledgement) Acknowledgement ¶
func (rack RecvAcknowledgement) Acknowledgement() []byte
RecvPacket passes the application acknowledgment directly to contract
func (RecvAcknowledgement) Success ¶
func (rack RecvAcknowledgement) Success() bool
RecvPacket only passes callback to contract if the acknowledgement is successful. Thus, we can just return true here.