Documentation ¶
Index ¶
- func EmitChannelUpgradeAckEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, ...)
- func EmitChannelUpgradeCancelEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, ...)
- func EmitChannelUpgradeConfirmEvent(ctx sdk.Context, portID, channelID string, channel types.Channel)
- func EmitChannelUpgradeInitEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, ...)
- func EmitChannelUpgradeOpenEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel)
- func EmitChannelUpgradeTimeoutEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, ...)
- func EmitChannelUpgradeTryEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, ...)
- func EmitErrorReceiptEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, ...)
- func NewQueryServer(k *Keeper) types.QueryServer
- type Keeper
- func (k *Keeper) AcknowledgePacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet, ...) (string, error)
- func (k *Keeper) ChanCloseConfirm(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability, ...) error
- func (k *Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
- func (k *Keeper) ChanOpenAck(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability, ...) error
- func (k *Keeper) ChanOpenConfirm(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability, ...) error
- func (k *Keeper) ChanOpenInit(ctx sdk.Context, order types.Order, connectionHops []string, portID string, ...) (string, *capabilitytypes.Capability, error)
- func (k *Keeper) ChanOpenTry(ctx sdk.Context, order types.Order, connectionHops []string, portID string, ...) (string, *capabilitytypes.Capability, error)
- func (k *Keeper) ChanUpgradeAck(ctx sdk.Context, portID, channelID string, counterpartyUpgrade types.Upgrade, ...) error
- func (k *Keeper) ChanUpgradeCancel(ctx sdk.Context, portID, channelID string, errorReceipt types.ErrorReceipt, ...) error
- func (k *Keeper) ChanUpgradeConfirm(ctx sdk.Context, portID, channelID string, ...) error
- func (k *Keeper) ChanUpgradeInit(ctx sdk.Context, portID string, channelID string, ...) (types.Upgrade, error)
- func (k *Keeper) ChanUpgradeOpen(ctx sdk.Context, portID, channelID string, ...) error
- func (k *Keeper) ChanUpgradeTimeout(ctx sdk.Context, portID, channelID string, counterpartyChannel types.Channel, ...) error
- func (k *Keeper) ChanUpgradeTry(ctx sdk.Context, portID, channelID string, proposedConnectionHops []string, ...) (types.Channel, types.Upgrade, error)
- func (k *Keeper) GenerateChannelIdentifier(ctx sdk.Context) string
- func (k *Keeper) GetAllChannels(ctx sdk.Context) (channels []types.IdentifiedChannel)
- func (k *Keeper) GetAllChannelsWithPortPrefix(ctx sdk.Context, portPrefix string) []types.IdentifiedChannel
- func (k *Keeper) GetAllPacketAckSeqs(ctx sdk.Context) (seqs []types.PacketSequence)
- func (k *Keeper) GetAllPacketAcks(ctx sdk.Context) (acks []types.PacketState)
- func (k *Keeper) GetAllPacketCommitments(ctx sdk.Context) (commitments []types.PacketState)
- func (k *Keeper) GetAllPacketCommitmentsAtChannel(ctx sdk.Context, portID, channelID string) (commitments []types.PacketState)
- func (k *Keeper) GetAllPacketReceipts(ctx sdk.Context) (receipts []types.PacketState)
- func (k *Keeper) GetAllPacketRecvSeqs(ctx sdk.Context) (seqs []types.PacketSequence)
- func (k *Keeper) GetAllPacketSendSeqs(ctx sdk.Context) (seqs []types.PacketSequence)
- func (k *Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (k *Keeper) GetChannel(ctx sdk.Context, portID, channelID string) (types.Channel, bool)
- func (k *Keeper) GetChannelClientState(ctx sdk.Context, portID, channelID string) (string, exported.ClientState, error)
- func (k *Keeper) GetChannelConnection(ctx sdk.Context, portID, channelID string) (string, connectiontypes.ConnectionEnd, error)
- func (k *Keeper) GetConnection(ctx sdk.Context, connectionID string) (connectiontypes.ConnectionEnd, error)
- func (k *Keeper) GetCounterpartyUpgrade(ctx sdk.Context, portID, channelID string) (types.Upgrade, bool)
- func (k *Keeper) GetNextChannelSequence(ctx sdk.Context) uint64
- func (k *Keeper) GetNextSequenceAck(ctx sdk.Context, portID, channelID string) (uint64, bool)
- func (k *Keeper) GetNextSequenceRecv(ctx sdk.Context, portID, channelID string) (uint64, bool)
- func (k *Keeper) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
- func (k *Keeper) GetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64) ([]byte, bool)
- func (k *Keeper) GetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) []byte
- func (k *Keeper) GetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) (string, bool)
- func (k *Keeper) GetParams(ctx sdk.Context) types.Params
- func (k *Keeper) GetPruningSequenceStart(ctx sdk.Context, portID, channelID string) (uint64, bool)
- func (k *Keeper) GetRecvStartSequence(ctx sdk.Context, portID, channelID string) (uint64, bool)
- func (k *Keeper) GetUpgrade(ctx sdk.Context, portID, channelID string) (types.Upgrade, bool)
- func (k *Keeper) GetUpgradeErrorReceipt(ctx sdk.Context, portID, channelID string) (types.ErrorReceipt, bool)
- func (k *Keeper) HasChannel(ctx sdk.Context, portID, channelID string) bool
- func (k *Keeper) HasInflightPackets(ctx sdk.Context, portID, channelID string) bool
- func (k *Keeper) HasPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64) bool
- func (k *Keeper) HasPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) bool
- func (k *Keeper) HasPruningSequenceStart(ctx sdk.Context, portID, channelID string) bool
- func (k *Keeper) IterateChannels(ctx sdk.Context, cb func(types.IdentifiedChannel) bool)
- func (k *Keeper) IteratePacketAcknowledgement(ctx sdk.Context, ...)
- func (k *Keeper) IteratePacketCommitment(ctx sdk.Context, ...)
- func (k *Keeper) IteratePacketCommitmentAtChannel(ctx sdk.Context, portID, channelID string, ...)
- func (k *Keeper) IteratePacketReceipt(ctx sdk.Context, ...)
- func (Keeper) IteratePacketSequence(ctx sdk.Context, iterator db.Iterator, ...)
- func (Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) LookupModuleByChannel(ctx sdk.Context, portID, channelID string) (string, *capabilitytypes.Capability, error)
- func (k *Keeper) MustAbortUpgrade(ctx sdk.Context, portID, channelID string, err error)
- func (k *Keeper) PruneAcknowledgements(ctx sdk.Context, portID, channelID string, limit uint64) (uint64, uint64, error)
- func (k *Keeper) RecvPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet, ...) (string, error)
- func (k *Keeper) RecvPacketReCheckTx(ctx sdk.Context, packet types.Packet) error
- func (k *Keeper) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, ...) (uint64, error)
- func (k *Keeper) SetChannel(ctx sdk.Context, portID, channelID string, channel types.Channel)
- func (k *Keeper) SetCounterpartyUpgrade(ctx sdk.Context, portID, channelID string, upgrade types.Upgrade)
- func (k *Keeper) SetNextChannelSequence(ctx sdk.Context, sequence uint64)
- func (k *Keeper) SetNextSequenceAck(ctx sdk.Context, portID, channelID string, sequence uint64)
- func (k *Keeper) SetNextSequenceRecv(ctx sdk.Context, portID, channelID string, sequence uint64)
- func (k *Keeper) SetNextSequenceSend(ctx sdk.Context, portID, channelID string, sequence uint64)
- func (k *Keeper) SetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64, ackHash []byte)
- func (k *Keeper) SetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64, ...)
- func (k *Keeper) SetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetPruningSequenceStart(ctx sdk.Context, portID, channelID string, sequence uint64)
- func (k *Keeper) SetUpgrade(ctx sdk.Context, portID, channelID string, upgrade types.Upgrade)
- func (k *Keeper) TimeoutExecuted(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet) error
- func (k *Keeper) TimeoutOnClose(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet, ...) (string, error)
- func (k *Keeper) TimeoutPacket(ctx sdk.Context, packet types.Packet, proof []byte, ...) (string, error)
- func (k *Keeper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ...) error
- func (k *Keeper) WriteErrorReceipt(ctx sdk.Context, portID, channelID string, upgradeError *types.UpgradeError)
- func (k *Keeper) WriteOpenAckChannel(ctx sdk.Context, ...)
- func (k *Keeper) WriteOpenConfirmChannel(ctx sdk.Context, portID, channelID string)
- func (k *Keeper) WriteOpenInitChannel(ctx sdk.Context, portID, channelID string, order types.Order, ...)
- func (k *Keeper) WriteOpenTryChannel(ctx sdk.Context, portID, channelID string, order types.Order, ...)
- func (k *Keeper) WriteUpgradeAckChannel(ctx sdk.Context, portID, channelID string, counterpartyUpgrade types.Upgrade) (types.Channel, types.Upgrade)
- func (k *Keeper) WriteUpgradeCancelChannel(ctx sdk.Context, portID, channelID string, sequence uint64)
- func (k *Keeper) WriteUpgradeConfirmChannel(ctx sdk.Context, portID, channelID string, counterpartyUpgrade types.Upgrade) types.Channel
- func (k *Keeper) WriteUpgradeInitChannel(ctx sdk.Context, portID, channelID string, upgrade types.Upgrade, ...) (types.Channel, types.Upgrade)
- func (k *Keeper) WriteUpgradeOpenChannel(ctx sdk.Context, portID, channelID string) types.Channel
- func (k *Keeper) WriteUpgradeTimeoutChannel(ctx sdk.Context, portID, channelID string) (types.Channel, types.Upgrade)
- func (k *Keeper) WriteUpgradeTryChannel(ctx sdk.Context, portID, channelID string, upgrade types.Upgrade, ...) (types.Channel, types.Upgrade)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitChannelUpgradeAckEvent ¶
func EmitChannelUpgradeAckEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, upgrade types.Upgrade)
EmitChannelUpgradeAckEvent emits a channel upgrade ack event
func EmitChannelUpgradeCancelEvent ¶
func EmitChannelUpgradeCancelEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, upgrade types.Upgrade)
EmitChannelUpgradeCancelEvent emits an upgraded cancelled event.
func EmitChannelUpgradeConfirmEvent ¶
func EmitChannelUpgradeConfirmEvent(ctx sdk.Context, portID, channelID string, channel types.Channel)
EmitChannelUpgradeConfirmEvent emits a channel upgrade confirm event
func EmitChannelUpgradeInitEvent ¶
func EmitChannelUpgradeInitEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, upgrade types.Upgrade)
EmitChannelUpgradeInitEvent emits a channel upgrade init event
func EmitChannelUpgradeOpenEvent ¶
func EmitChannelUpgradeOpenEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel)
EmitChannelUpgradeOpenEvent emits a channel upgrade open event
func EmitChannelUpgradeTimeoutEvent ¶
func EmitChannelUpgradeTimeoutEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, upgrade types.Upgrade)
EmitChannelUpgradeTimeoutEvent emits an upgrade timeout event.
func EmitChannelUpgradeTryEvent ¶
func EmitChannelUpgradeTryEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, upgrade types.Upgrade)
EmitChannelUpgradeTryEvent emits a channel upgrade try event
func EmitErrorReceiptEvent ¶
func EmitErrorReceiptEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, err error)
EmitErrorReceiptEvent emits an error receipt event
func NewQueryServer ¶
func NewQueryServer(k *Keeper) types.QueryServer
NewQueryServer returns a new 04-channel types.QueryServer implementation.
Types ¶
type Keeper ¶
type Keeper struct { // implements gRPC QueryServer interface types.QueryServer // contains filtered or unexported fields }
Keeper defines the IBC channel keeper
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, clientKeeper types.ClientKeeper, connectionKeeper types.ConnectionKeeper, portKeeper types.PortKeeper, scopedKeeper exported.ScopedKeeper, ) *Keeper
NewKeeper creates a new IBC channel Keeper instance
func (*Keeper) AcknowledgePacket ¶
func (k *Keeper) AcknowledgePacket( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet, acknowledgement []byte, proof []byte, proofHeight exported.Height, ) (string, error)
AcknowledgePacket is called by a module to process the acknowledgement of a packet previously sent by the calling module on a channel to a counterparty module on the counterparty chain. Its intended usage is within the ante handler. AcknowledgePacket will clean up the packet commitment, which is no longer necessary since the packet has been received and acted upon. It will also increment NextSequenceAck in case of ORDERED channels.
func (*Keeper) ChanCloseConfirm ¶
func (k *Keeper) ChanCloseConfirm( ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability, initProof []byte, proofHeight exported.Height, counterpartyUpgradeSequence uint64, ) error
ChanCloseConfirm is called by the counterparty module to close their end of the channel, since the other end has been closed.
func (*Keeper) ChanCloseInit ¶
func (k *Keeper) ChanCloseInit( ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability, ) error
Closing Handshake
This section defines the set of functions required to close a channel handshake as defined in https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#closing-handshake
ChanCloseInit is called by either module to close their end of the channel. Once closed, channels cannot be reopened.
func (*Keeper) ChanOpenAck ¶
func (k *Keeper) ChanOpenAck( ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability, counterpartyVersion, counterpartyChannelID string, tryProof []byte, proofHeight exported.Height, ) error
ChanOpenAck is called by the handshake-originating module to acknowledge the acceptance of the initial request by the counterparty module on the other chain.
func (*Keeper) ChanOpenConfirm ¶
func (k *Keeper) ChanOpenConfirm( ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability, ackProof []byte, proofHeight exported.Height, ) error
ChanOpenConfirm is called by the handshake-accepting module to confirm the acknowledgement of the handshake-originating module on the other chain and finish the channel opening handshake.
func (*Keeper) ChanOpenInit ¶
func (k *Keeper) ChanOpenInit( ctx sdk.Context, order types.Order, connectionHops []string, portID string, portCap *capabilitytypes.Capability, counterparty types.Counterparty, version string, ) (string, *capabilitytypes.Capability, error)
ChanOpenInit is called by a module to initiate a channel opening handshake with a module on another chain. The counterparty channel identifier is validated to be empty in msg validation.
func (*Keeper) ChanOpenTry ¶
func (k *Keeper) ChanOpenTry( ctx sdk.Context, order types.Order, connectionHops []string, portID string, portCap *capabilitytypes.Capability, counterparty types.Counterparty, counterpartyVersion string, initProof []byte, proofHeight exported.Height, ) (string, *capabilitytypes.Capability, error)
ChanOpenTry is called by a module to accept the first step of a channel opening handshake initiated by a module on another chain.
func (*Keeper) ChanUpgradeAck ¶
func (k *Keeper) ChanUpgradeAck( ctx sdk.Context, portID, channelID string, counterpartyUpgrade types.Upgrade, channelProof, upgradeProof []byte, proofHeight clienttypes.Height, ) error
ChanUpgradeAck is called by a module to accept the ACKUPGRADE handshake step of the channel upgrade protocol. This method should only be called by the IBC core msg server. This method will verify that the counterparty has called the ChanUpgradeTry handler. and that its own upgrade is compatible with the selected counterparty version. NOTE: the channel may be in either the OPEN or FLUSHING state. The channel may be in OPEN if we are in the happy path.
A -> Init (OPEN), B -> Try (FLUSHING), A -> Ack (begins in OPEN)
The channel may be in FLUSHING if we are in a crossing hellos situation.
A -> Init (OPEN), B -> Init (OPEN) -> A -> Try (FLUSHING), B -> Try (FLUSHING), A -> Ack (begins in FLUSHING)
func (*Keeper) ChanUpgradeCancel ¶
func (k *Keeper) ChanUpgradeCancel(ctx sdk.Context, portID, channelID string, errorReceipt types.ErrorReceipt, errorReceiptProof []byte, proofHeight clienttypes.Height) error
ChanUpgradeCancel is called by the msg server to prove that an error receipt was written on the counterparty which constitutes a valid situation where the upgrade should be cancelled. An error is returned if sufficient evidence for cancelling the upgrade has not been provided.
func (*Keeper) ChanUpgradeConfirm ¶
func (k *Keeper) ChanUpgradeConfirm( ctx sdk.Context, portID, channelID string, counterpartyChannelState types.State, counterpartyUpgrade types.Upgrade, channelProof, upgradeProof []byte, proofHeight clienttypes.Height, ) error
ChanUpgradeConfirm is called on the chain which is on FLUSHING after chanUpgradeAck is called on the counterparty. This will inform the TRY chain of the timeout set on ACK by the counterparty. If the timeout has already exceeded, we will write an error receipt and restore.
func (*Keeper) ChanUpgradeInit ¶
func (k *Keeper) ChanUpgradeInit( ctx sdk.Context, portID string, channelID string, upgradeFields types.UpgradeFields, ) (types.Upgrade, error)
ChanUpgradeInit is called by a module to initiate a channel upgrade handshake with a module on another chain.
func (*Keeper) ChanUpgradeOpen ¶
func (k *Keeper) ChanUpgradeOpen( ctx sdk.Context, portID, channelID string, counterpartyChannelState types.State, counterpartyUpgradeSequence uint64, channelProof []byte, proofHeight clienttypes.Height, ) error
ChanUpgradeOpen is called by a module to complete the channel upgrade handshake and move the channel back to an OPEN state. This method should only be called after both channels have flushed any in-flight packets. This method should only be called directly by the core IBC message server.
func (*Keeper) ChanUpgradeTimeout ¶
func (k *Keeper) ChanUpgradeTimeout( ctx sdk.Context, portID, channelID string, counterpartyChannel types.Channel, counterpartyChannelProof []byte, proofHeight exported.Height, ) error
ChanUpgradeTimeout times out an outstanding upgrade. This should be used by the initialising chain when the counterparty chain has not responded to an upgrade proposal within the specified timeout period.
func (*Keeper) ChanUpgradeTry ¶
func (k *Keeper) ChanUpgradeTry( ctx sdk.Context, portID, channelID string, proposedConnectionHops []string, counterpartyUpgradeFields types.UpgradeFields, counterpartyUpgradeSequence uint64, channelProof, upgradeProof []byte, proofHeight clienttypes.Height, ) (types.Channel, types.Upgrade, error)
ChanUpgradeTry is called by a module to accept the first step of a channel upgrade handshake initiated by a module on another chain. If this function is successful, the proposed upgrade will be returned. If the upgrade fails, the upgrade sequence will still be incremented but an error will be returned.
func (*Keeper) GenerateChannelIdentifier ¶
GenerateChannelIdentifier returns the next channel identifier.
func (*Keeper) GetAllChannels ¶
func (k *Keeper) GetAllChannels(ctx sdk.Context) (channels []types.IdentifiedChannel)
GetAllChannels returns all stored Channel objects.
func (*Keeper) GetAllChannelsWithPortPrefix ¶
func (k *Keeper) GetAllChannelsWithPortPrefix(ctx sdk.Context, portPrefix string) []types.IdentifiedChannel
GetAllChannelsWithPortPrefix returns all channels with the specified port prefix. If an empty prefix is provided all channels will be returned.
func (*Keeper) GetAllPacketAckSeqs ¶
func (k *Keeper) GetAllPacketAckSeqs(ctx sdk.Context) (seqs []types.PacketSequence)
GetAllPacketAckSeqs returns all stored next acknowledgements sequences.
func (*Keeper) GetAllPacketAcks ¶
func (k *Keeper) GetAllPacketAcks(ctx sdk.Context) (acks []types.PacketState)
GetAllPacketAcks returns all stored PacketAcknowledgements objects.
func (*Keeper) GetAllPacketCommitments ¶
func (k *Keeper) GetAllPacketCommitments(ctx sdk.Context) (commitments []types.PacketState)
GetAllPacketCommitments returns all stored PacketCommitments objects.
func (*Keeper) GetAllPacketCommitmentsAtChannel ¶
func (k *Keeper) GetAllPacketCommitmentsAtChannel(ctx sdk.Context, portID, channelID string) (commitments []types.PacketState)
GetAllPacketCommitmentsAtChannel returns all stored PacketCommitments objects for a specified port ID and channel ID.
func (*Keeper) GetAllPacketReceipts ¶
func (k *Keeper) GetAllPacketReceipts(ctx sdk.Context) (receipts []types.PacketState)
GetAllPacketReceipts returns all stored PacketReceipt objects.
func (*Keeper) GetAllPacketRecvSeqs ¶
func (k *Keeper) GetAllPacketRecvSeqs(ctx sdk.Context) (seqs []types.PacketSequence)
GetAllPacketRecvSeqs returns all stored next recv sequences.
func (*Keeper) GetAllPacketSendSeqs ¶
func (k *Keeper) GetAllPacketSendSeqs(ctx sdk.Context) (seqs []types.PacketSequence)
GetAllPacketSendSeqs returns all stored next send sequences.
func (*Keeper) GetAppVersion ¶
GetAppVersion gets the version for the specified channel.
func (*Keeper) GetChannel ¶
GetChannel returns a channel with a particular identifier binded to a specific port
func (*Keeper) GetChannelClientState ¶
func (k *Keeper) GetChannelClientState(ctx sdk.Context, portID, channelID string) (string, exported.ClientState, error)
GetChannelClientState returns the associated client state with its ID, from a port and channel identifier.
func (*Keeper) GetChannelConnection ¶
func (k *Keeper) GetChannelConnection(ctx sdk.Context, portID, channelID string) (string, connectiontypes.ConnectionEnd, error)
GetChannelConnection returns the connection ID and state associated with the given port and channel identifier.
func (*Keeper) GetConnection ¶
func (k *Keeper) GetConnection(ctx sdk.Context, connectionID string) (connectiontypes.ConnectionEnd, error)
GetConnection wraps the connection keeper's GetConnection function.
func (*Keeper) GetCounterpartyUpgrade ¶
func (k *Keeper) GetCounterpartyUpgrade(ctx sdk.Context, portID, channelID string) (types.Upgrade, bool)
GetCounterpartyUpgrade gets the counterparty upgrade from the store.
func (*Keeper) GetNextChannelSequence ¶
GetNextChannelSequence gets the next channel sequence from the store.
func (*Keeper) GetNextSequenceAck ¶
GetNextSequenceAck gets a channel's next ack sequence from the store
func (*Keeper) GetNextSequenceRecv ¶
GetNextSequenceRecv gets a channel's next receive sequence from the store
func (*Keeper) GetNextSequenceSend ¶
GetNextSequenceSend gets a channel's next send sequence from the store
func (*Keeper) GetPacketAcknowledgement ¶
func (k *Keeper) GetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64) ([]byte, bool)
GetPacketAcknowledgement gets the packet ack hash from the store
func (*Keeper) GetPacketCommitment ¶
func (k *Keeper) GetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) []byte
GetPacketCommitment gets the packet commitment hash from the store
func (*Keeper) GetPacketReceipt ¶
func (k *Keeper) GetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) (string, bool)
GetPacketReceipt gets a packet receipt from the store
func (*Keeper) GetPruningSequenceStart ¶
GetPruningSequenceStart gets a channel's pruning sequence start from the store.
func (*Keeper) GetRecvStartSequence ¶
GetRecvStartSequence gets a channel's recv start sequence from the store. The recv start sequence will be set to the counterparty's next sequence send upon a successful channel upgrade. It will be used for replay protection of historical packets and as the upper bound for pruning stale packet receives.
func (*Keeper) GetUpgrade ¶
GetUpgrade returns the proposed upgrade for the provided port and channel identifiers.
func (*Keeper) GetUpgradeErrorReceipt ¶
func (k *Keeper) GetUpgradeErrorReceipt(ctx sdk.Context, portID, channelID string) (types.ErrorReceipt, bool)
GetUpgradeErrorReceipt returns the upgrade error receipt for the provided port and channel identifiers.
func (*Keeper) HasChannel ¶
HasChannel true if the channel with the given identifiers exists in state.
func (*Keeper) HasInflightPackets ¶
HasInflightPackets returns true if there are packet commitments stored at the specified port and channel, and false otherwise.
func (*Keeper) HasPacketAcknowledgement ¶
func (k *Keeper) HasPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64) bool
HasPacketAcknowledgement check if the packet ack hash is already on the store
func (*Keeper) HasPacketCommitment ¶
func (k *Keeper) HasPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) bool
HasPacketCommitment returns true if the packet commitment exists
func (*Keeper) HasPruningSequenceStart ¶
HasPruningSequenceStart returns true if the pruning sequence start is set for the specified channel.
func (*Keeper) IterateChannels ¶
IterateChannels provides an iterator over all Channel objects. For each Channel, cb will be called. If the cb returns true, the iterator will close and stop.
func (*Keeper) IteratePacketAcknowledgement ¶
func (k *Keeper) IteratePacketAcknowledgement(ctx sdk.Context, cb func(portID, channelID string, sequence uint64, hash []byte) bool)
IteratePacketAcknowledgement provides an iterator over all PacketAcknowledgement objects. For each acknowledgement, cb will be called. If the cb returns true, the iterator will close and stop.
func (*Keeper) IteratePacketCommitment ¶
func (k *Keeper) IteratePacketCommitment(ctx sdk.Context, cb func(portID, channelID string, sequence uint64, hash []byte) bool)
IteratePacketCommitment provides an iterator over all PacketCommitment objects. For each packet commitment, cb will be called. If the cb returns true, the iterator will close and stop.
func (*Keeper) IteratePacketCommitmentAtChannel ¶
func (k *Keeper) IteratePacketCommitmentAtChannel(ctx sdk.Context, portID, channelID string, cb func(_, _ string, sequence uint64, hash []byte) bool)
IteratePacketCommitmentAtChannel provides an iterator over all PacketCommmitment objects at a specified channel. For each packet commitment, cb will be called. If the cb returns true, the iterator will close and stop.
func (*Keeper) IteratePacketReceipt ¶
func (k *Keeper) IteratePacketReceipt(ctx sdk.Context, cb func(portID, channelID string, sequence uint64, receipt []byte) bool)
IteratePacketReceipt provides an iterator over all PacketReceipt objects. For each receipt, cb will be called. If the cb returns true, the iterator will close and stop.
func (Keeper) IteratePacketSequence ¶
func (Keeper) IteratePacketSequence(ctx sdk.Context, iterator db.Iterator, cb func(portID, channelID string, sequence uint64) bool)
IteratePacketSequence provides an iterator over all send, receive or ack sequences. For each sequence, cb will be called. If the cb returns true, the iterator will close and stop.
func (*Keeper) LookupModuleByChannel ¶
func (k *Keeper) LookupModuleByChannel(ctx sdk.Context, portID, channelID string) (string, *capabilitytypes.Capability, error)
LookupModuleByChannel will return the IBCModule along with the capability associated with a given channel defined by its portID and channelID
func (*Keeper) MustAbortUpgrade ¶
MustAbortUpgrade will restore the channel state to its pre-upgrade state so that upgrade is aborted. Any unnecessary state is deleted and an error receipt is written. This function is expected to always succeed, a panic will occur if an error occurs.
func (*Keeper) PruneAcknowledgements ¶
func (k *Keeper) PruneAcknowledgements(ctx sdk.Context, portID, channelID string, limit uint64) (uint64, uint64, error)
PruneAcknowledgements prunes packet acknowledgements and receipts that have a sequence number less than pruning sequence end. The number of packet acks/receipts pruned is bounded by the limit. Pruning can only occur after a channel has been upgraded.
Pruning sequence start keeps track of the packet ack/receipt that can be pruned next. When it reaches pruningSequenceEnd, pruning is complete.
func (*Keeper) RecvPacket ¶
func (k *Keeper) RecvPacket( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet, proof []byte, proofHeight exported.Height, ) (string, error)
RecvPacket is called by a module in order to receive & process an IBC packet sent on the corresponding channel end on the counterparty chain.
func (*Keeper) RecvPacketReCheckTx ¶
RecvPacketReCheckTx applies replay protection ensuring that when relay messages are re-executed in ReCheckTx, we can appropriately filter out redundant relay transactions.
func (*Keeper) SendPacket ¶
func (k *Keeper) SendPacket( ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte, ) (uint64, error)
SendPacket is called by a module in order to send an IBC packet on a channel. The packet sequence generated for the packet to be sent is returned. An error is returned if one occurs.
func (*Keeper) SetChannel ¶
SetChannel sets a channel to the store
func (*Keeper) SetCounterpartyUpgrade ¶
func (k *Keeper) SetCounterpartyUpgrade(ctx sdk.Context, portID, channelID string, upgrade types.Upgrade)
SetCounterpartyUpgrade sets the counterparty upgrade in the store.
func (*Keeper) SetNextChannelSequence ¶
SetNextChannelSequence sets the next channel sequence to the store.
func (*Keeper) SetNextSequenceAck ¶
SetNextSequenceAck sets a channel's next ack sequence to the store
func (*Keeper) SetNextSequenceRecv ¶
SetNextSequenceRecv sets a channel's next receive sequence to the store
func (*Keeper) SetNextSequenceSend ¶
SetNextSequenceSend sets a channel's next send sequence to the store
func (*Keeper) SetPacketAcknowledgement ¶
func (k *Keeper) SetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64, ackHash []byte)
SetPacketAcknowledgement sets the packet ack hash to the store
func (*Keeper) SetPacketCommitment ¶
func (k *Keeper) SetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64, commitmentHash []byte)
SetPacketCommitment sets the packet commitment hash to the store
func (*Keeper) SetPacketReceipt ¶
SetPacketReceipt sets an empty packet receipt to the store
func (*Keeper) SetPruningSequenceStart ¶
func (k *Keeper) SetPruningSequenceStart(ctx sdk.Context, portID, channelID string, sequence uint64)
SetPruningSequenceStart sets a channel's pruning sequence start to the store.
func (*Keeper) SetUpgrade ¶
SetUpgrade sets the proposed upgrade using the provided port and channel identifiers.
func (*Keeper) TimeoutExecuted ¶
func (k *Keeper) TimeoutExecuted( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet, ) error
TimeoutExecuted deletes the commitment send from this chain after it verifies timeout. If the timed-out packet came from an ORDERED channel then this channel will be closed. If the channel is in the FLUSHING state and there is a counterparty upgrade, then the upgrade will be aborted if the upgrade has timed out. Otherwise, if there are no more inflight packets, then the channel will be set to the FLUSHCOMPLETE state.
CONTRACT: this function must be called in the IBC handler
func (*Keeper) TimeoutOnClose ¶
func (k *Keeper) TimeoutOnClose( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet types.Packet, proof, closedProof []byte, proofHeight exported.Height, nextSequenceRecv uint64, counterpartyUpgradeSequence uint64, ) (string, error)
TimeoutOnClose is called by a module in order to prove that the channel to which an unreceived packet was addressed has been closed, so the packet will never be received (even if the timeoutHeight has not yet been reached).
func (*Keeper) TimeoutPacket ¶
func (k *Keeper) TimeoutPacket( ctx sdk.Context, packet types.Packet, proof []byte, proofHeight exported.Height, nextSequenceRecv uint64, ) (string, error)
TimeoutPacket is called by a module which originally attempted to send a packet to a counterparty module, where the timeout height has passed on the counterparty chain without the packet being committed, to prove that the packet can no longer be executed and to allow the calling module to safely perform appropriate state transitions. Its intended usage is within the ante handler.
func (*Keeper) WriteAcknowledgement ¶
func (k *Keeper) WriteAcknowledgement( ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, acknowledgement exported.Acknowledgement, ) error
WriteAcknowledgement writes the packet execution acknowledgement to the state, which will be verified by the counterparty chain using AcknowledgePacket.
CONTRACT:
1) For synchronous execution, this function is be called in the IBC handler . For async handling, it needs to be called directly by the module which originally processed the packet.
2) Assumes that packet receipt has been written (unordered), or nextSeqRecv was incremented (ordered) previously by RecvPacket.
func (*Keeper) WriteErrorReceipt ¶
func (k *Keeper) WriteErrorReceipt(ctx sdk.Context, portID, channelID string, upgradeError *types.UpgradeError)
WriteErrorReceipt will write an error receipt from the provided UpgradeError.
func (*Keeper) WriteOpenAckChannel ¶
func (k *Keeper) WriteOpenAckChannel( ctx sdk.Context, portID, channelID, counterpartyVersion, counterpartyChannelID string, )
WriteOpenAckChannel writes an updated channel state for the successful OpenAck handshake step. An event is emitted for the handshake step.
func (*Keeper) WriteOpenConfirmChannel ¶
WriteOpenConfirmChannel writes an updated channel state for the successful OpenConfirm handshake step. An event is emitted for the handshake step.
func (*Keeper) WriteOpenInitChannel ¶
func (k *Keeper) WriteOpenInitChannel( ctx sdk.Context, portID, channelID string, order types.Order, connectionHops []string, counterparty types.Counterparty, version string, )
WriteOpenInitChannel writes a channel which has successfully passed the OpenInit handshake step. The channel is set in state and all the associated Send and Recv sequences are set to 1. An event is emitted for the handshake step.
func (*Keeper) WriteOpenTryChannel ¶
func (k *Keeper) WriteOpenTryChannel( ctx sdk.Context, portID, channelID string, order types.Order, connectionHops []string, counterparty types.Counterparty, version string, )
WriteOpenTryChannel writes a channel which has successfully passed the OpenTry handshake step. The channel is set in state. If a previous channel state did not exist, all the Send and Recv sequences are set to 1. An event is emitted for the handshake step.
func (*Keeper) WriteUpgradeAckChannel ¶
func (k *Keeper) WriteUpgradeAckChannel(ctx sdk.Context, portID, channelID string, counterpartyUpgrade types.Upgrade) (types.Channel, types.Upgrade)
WriteUpgradeAckChannel writes a channel which has successfully passed the UpgradeAck handshake step as well as setting the upgrade for that channel. An event is emitted for the handshake step.
func (*Keeper) WriteUpgradeCancelChannel ¶
func (k *Keeper) WriteUpgradeCancelChannel(ctx sdk.Context, portID, channelID string, sequence uint64)
WriteUpgradeCancelChannel writes a channel which has canceled the upgrade process.Auxiliary upgrade state is also deleted.
func (*Keeper) WriteUpgradeConfirmChannel ¶
func (k *Keeper) WriteUpgradeConfirmChannel(ctx sdk.Context, portID, channelID string, counterpartyUpgrade types.Upgrade) types.Channel
WriteUpgradeConfirmChannel writes a channel which has successfully passed the ChanUpgradeConfirm handshake step. If the channel has no in-flight packets, its state is updated to indicate that flushing has completed. Otherwise, the counterparty upgrade is set and the channel state is left unchanged. An event is emitted for the handshake step.
func (*Keeper) WriteUpgradeInitChannel ¶
func (k *Keeper) WriteUpgradeInitChannel(ctx sdk.Context, portID, channelID string, upgrade types.Upgrade, upgradeVersion string) (types.Channel, types.Upgrade)
WriteUpgradeInitChannel writes a channel which has successfully passed the UpgradeInit handshake step. An event is emitted for the handshake step.
func (*Keeper) WriteUpgradeOpenChannel ¶
WriteUpgradeOpenChannel writes the agreed upon upgrade fields to the channel, and sets the channel state back to OPEN. This can be called in one of two cases: - In the UpgradeConfirm step of the handshake if both sides have already flushed all in-flight packets. - In the UpgradeOpen step of the handshake.
func (*Keeper) WriteUpgradeTimeoutChannel ¶
func (k *Keeper) WriteUpgradeTimeoutChannel( ctx sdk.Context, portID, channelID string, ) (types.Channel, types.Upgrade)
WriteUpgradeTimeoutChannel restores the channel state of an initialising chain in the event that the counterparty chain has passed the timeout set in ChanUpgradeInit to the state before the upgrade was proposed. Auxiliary upgrade state is also deleted. An event is emitted for the handshake step.
func (*Keeper) WriteUpgradeTryChannel ¶
func (k *Keeper) WriteUpgradeTryChannel(ctx sdk.Context, portID, channelID string, upgrade types.Upgrade, upgradeVersion string) (types.Channel, types.Upgrade)
WriteUpgradeTryChannel writes the channel end and upgrade to state after successfully passing the UpgradeTry handshake step. An event is emitted for the handshake step.