Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) AcknowledgePacket(ctx sdk.Context, msg *types.MsgAcknowledgement) error
- func (k Keeper) CallEVM(ctx sdk.Context, abi abi.ABI, from common.Address, contract common.Address, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallEVMWithData(ctx sdk.Context, from common.Address, contract *common.Address, data []byte) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallPacket(ctx sdk.Context, method string, args ...interface{}) (*evmtypes.MsgEthereumTxResponse, error)
- 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) GetAllPacketCommitmentsByPath(ctx sdk.Context, sourceChain, destChain 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) GetModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) GetNextSequenceSend(ctx sdk.Context, sourceChain, destChain string) uint64
- func (k Keeper) GetPacketAcknowledgement(ctx sdk.Context, sourceChain, destChain string, sequence uint64) ([]byte, bool)
- func (k Keeper) GetPacketCommitment(ctx sdk.Context, sourceChain, destChain string, sequence uint64) []byte
- func (k Keeper) GetPacketReceipt(ctx sdk.Context, sourceChain, destChain string, sequence uint64) (string, bool)
- func (k Keeper) GetPacketRelayer(ctx sdk.Context, sourceChain, destChain string, sequence uint64) string
- func (k Keeper) HasPacketAcknowledgement(ctx sdk.Context, sourceChain, destChain string, sequence uint64) bool
- func (k Keeper) HasPacketCommitment(ctx sdk.Context, sourceChain, destChain string, sequence uint64) bool
- func (k Keeper) HasPacketReceipt(ctx sdk.Context, sourceChain, destChain string, sequence uint64) bool
- func (k Keeper) IteratePacketAcknowledgement(ctx sdk.Context, ...)
- func (k Keeper) IteratePacketCommitment(ctx sdk.Context, ...)
- func (k Keeper) IteratePacketCommitmentByPath(ctx sdk.Context, sourceChain, destChain string, ...)
- func (k Keeper) IteratePacketReceipt(ctx sdk.Context, ...)
- func (k Keeper) IteratePacketSequence(ctx sdk.Context, iterator db.Iterator, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (q Keeper) PacketAcknowledgement(c context.Context, req *types.QueryPacketAcknowledgementRequest) (*types.QueryPacketAcknowledgementResponse, error)
- func (q Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacketAcknowledgementsRequest) (*types.QueryPacketAcknowledgementsResponse, error)
- func (q Keeper) PacketCommitment(c context.Context, req *types.QueryPacketCommitmentRequest) (*types.QueryPacketCommitmentResponse, error)
- func (q Keeper) PacketCommitments(c context.Context, req *types.QueryPacketCommitmentsRequest) (*types.QueryPacketCommitmentsResponse, error)
- func (q Keeper) PacketReceipt(c context.Context, req *types.QueryPacketReceiptRequest) (*types.QueryPacketReceiptResponse, error)
- func (k Keeper) RecvPacket(ctx sdk.Context, msg *types.MsgRecvPacket) error
- func (k Keeper) SendPacket(ctx sdk.Context, packet exported.PacketI) error
- func (k Keeper) SetNextSequenceSend(ctx sdk.Context, sourceChain, destChain string, sequence uint64)
- func (k Keeper) SetPacketAcknowledgement(ctx sdk.Context, sourceChain, destChain string, sequence uint64, ...)
- func (k Keeper) SetPacketCommitment(ctx sdk.Context, sourceChain, destChain string, sequence uint64, ...)
- func (k Keeper) SetPacketReceipt(ctx sdk.Context, sourceChain, destChain string, sequence uint64)
- func (k Keeper) SetPacketRelayer(ctx sdk.Context, sourceChain, destChain string, sequence uint64, ...)
- func (q Keeper) UnreceivedAcks(c context.Context, req *types.QueryUnreceivedAcksRequest) (*types.QueryUnreceivedAcksResponse, error)
- func (q Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceivedPacketsRequest) (*types.QueryUnreceivedPacketsResponse, error)
- func (k Keeper) ValidatePacket(ctx sdk.Context, packet exported.PacketI) error
- func (k Keeper) WriteAcknowledgement(ctx sdk.Context, packet exported.PacketI, acknowledgement []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the XIBC packet keeper
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key sdk.StoreKey, clientKeeper types.ClientKeeper, accountKeeper types.AccountKeeper, evmKeeper types.EVMKeeper, ) Keeper
NewKeeper creates a new xibc packet Keeper instance
func (Keeper) AcknowledgePacket ¶
AcknowledgePacket is called by a module to process the acknowledgement of a packet previously sent by the calling module on a port 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.
func (Keeper) CallEVM ¶
func (k Keeper) CallEVM( ctx sdk.Context, abi abi.ABI, from common.Address, contract common.Address, method string, args ...interface{}, ) ( *evmtypes.MsgEthereumTxResponse, error, )
CallEVM performs a smart contract method call using given args
func (Keeper) CallEVMWithData ¶
func (k Keeper) CallEVMWithData( ctx sdk.Context, from common.Address, contract *common.Address, data []byte, ) ( *evmtypes.MsgEthereumTxResponse, error, )
CallEVMWithData performs a smart contract method call using contract data
func (Keeper) CallPacket ¶
func (k Keeper) CallPacket( ctx sdk.Context, method string, args ...interface{}, ) ( *evmtypes.MsgEthereumTxResponse, error, )
CallPacket call a method of packet contract
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) GetAllPacketCommitmentsByPath ¶
func (k Keeper) GetAllPacketCommitmentsByPath(ctx sdk.Context, sourceChain, destChain string) (commitments []types.PacketState)
GetAllPacketCommitmentsByPath returns all stored PacketCommitments objects
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) GetModuleAccount ¶
func (k Keeper) GetModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI
func (Keeper) GetNextSequenceSend ¶
GetNextSequenceSend gets next send sequence from the store
func (Keeper) GetPacketAcknowledgement ¶
func (k Keeper) GetPacketAcknowledgement(ctx sdk.Context, sourceChain, destChain string, sequence uint64) ([]byte, bool)
GetPacketAcknowledgement gets the packet ack hash from the store
func (Keeper) GetPacketCommitment ¶
func (k Keeper) GetPacketCommitment(ctx sdk.Context, sourceChain, destChain string, sequence uint64) []byte
GetPacketCommitment gets the packet commitment hash from the store
func (Keeper) GetPacketReceipt ¶
func (k Keeper) GetPacketReceipt(ctx sdk.Context, sourceChain, destChain string, sequence uint64) (string, bool)
GetPacketReceipt gets a packet receipt from the store
func (Keeper) GetPacketRelayer ¶
func (k Keeper) GetPacketRelayer(ctx sdk.Context, sourceChain, destChain string, sequence uint64) string
GetPacketRelayer gets the packet relayer from the store
func (Keeper) HasPacketAcknowledgement ¶
func (k Keeper) HasPacketAcknowledgement(ctx sdk.Context, sourceChain, destChain 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, sourceChain, destChain string, sequence uint64) bool
HasPacketCommitment returns true if the packet commitment exists
func (Keeper) HasPacketReceipt ¶
func (k Keeper) HasPacketReceipt(ctx sdk.Context, sourceChain, destChain string, sequence uint64) bool
HasPacketAcknowledgement check if the packet ack hash is already on the store
func (Keeper) IteratePacketAcknowledgement ¶
func (k Keeper) IteratePacketAcknowledgement(ctx sdk.Context, cb func(sourceChain, destChain 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(sourceChain, destChain 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) IteratePacketCommitmentByPath ¶
func (k Keeper) IteratePacketCommitmentByPath(ctx sdk.Context, sourceChain, destChain string, cb func(_, _ string, sequence uint64, hash []byte) bool)
IteratePacketCommitmentByPath provides an iterator over all PacketCommmitment objects
func (Keeper) IteratePacketReceipt ¶
func (k Keeper) IteratePacketReceipt(ctx sdk.Context, cb func(sourceChain, destChain 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 (k Keeper) IteratePacketSequence(ctx sdk.Context, iterator db.Iterator, cb func(sourceChain, destChain 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) PacketAcknowledgement ¶
func (q Keeper) PacketAcknowledgement(c context.Context, req *types.QueryPacketAcknowledgementRequest) (*types.QueryPacketAcknowledgementResponse, error)
PacketAcknowledgement implements the Query/PacketAcknowledgement gRPC method
func (Keeper) PacketAcknowledgements ¶
func (q Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacketAcknowledgementsRequest) (*types.QueryPacketAcknowledgementsResponse, error)
PacketAcknowledgements implements the Query/PacketAcknowledgements gRPC method
func (Keeper) PacketCommitment ¶
func (q Keeper) PacketCommitment(c context.Context, req *types.QueryPacketCommitmentRequest) (*types.QueryPacketCommitmentResponse, error)
PacketCommitment implements the Query/PacketCommitment gRPC method
func (Keeper) PacketCommitments ¶
func (q Keeper) PacketCommitments(c context.Context, req *types.QueryPacketCommitmentsRequest) (*types.QueryPacketCommitmentsResponse, error)
PacketCommitments implements the Query/PacketCommitments gRPC method
func (Keeper) PacketReceipt ¶
func (q Keeper) PacketReceipt(c context.Context, req *types.QueryPacketReceiptRequest) (*types.QueryPacketReceiptResponse, error)
PacketReceipt implements the Query/PacketReceipt gRPC method
func (Keeper) RecvPacket ¶
RecvPacket is called by a module to receive & process an XIBC packet sent on the corresponding port on the counterparty chain.
func (Keeper) SendPacket ¶
SendPacket is called by a module to send an XIBC packet on a port owned by the calling module to the corresponding module on the counterparty chain.
func (Keeper) SetNextSequenceSend ¶
func (k Keeper) SetNextSequenceSend(ctx sdk.Context, sourceChain, destChain string, sequence uint64)
SetNextSequenceSend sets next send sequence to the store
func (Keeper) SetPacketAcknowledgement ¶
func (k Keeper) SetPacketAcknowledgement(ctx sdk.Context, sourceChain, destChain string, sequence uint64, ackHash []byte)
SetPacketAcknowledgement sets the packet ack hash to the store
func (Keeper) SetPacketCommitment ¶
func (k Keeper) SetPacketCommitment(ctx sdk.Context, sourceChain, destChain 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) SetPacketRelayer ¶
func (k Keeper) SetPacketRelayer(ctx sdk.Context, sourceChain, destChain string, sequence uint64, relayer string)
SetPacketRelayer sets the packet relayer to the store
func (Keeper) UnreceivedAcks ¶
func (q Keeper) UnreceivedAcks(c context.Context, req *types.QueryUnreceivedAcksRequest) (*types.QueryUnreceivedAcksResponse, error)
UnreceivedAcks implements the Query/UnreceivedAcks gRPC method. Given a list of counterparty packet acknowledgements, the querier checks if the packet has already been received by checking if the packet commitment still exists on this chain (original sender) for the packet sequence. All acknowledgmeents that haven't been received yet are returned in the response. Usage: To use this method correctly, first query all packet acknowledgements on the original receiving chain (ie the chain that wrote the acks) using the Query/PacketAcknowledgements gRPC method. Then input the returned sequences into the QueryUnreceivedAcksRequest and send the request to this Query/UnreceivedAcks on the **original sending** chain. This gRPC method will then return the list of packet sequences whose acknowledgements are already written on the receiving chain but haven't yet been received back to the sending chain.
NOTE: The querier makes the assumption that the provided list of packet acknowledgements is correct and will not function properly if the list is not up to date. Ideally the query height should equal the latest height on the counterparty's client which represents this chain.
func (Keeper) UnreceivedPackets ¶
func (q Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceivedPacketsRequest) (*types.QueryUnreceivedPacketsResponse, error)
UnreceivedPackets implements the Query/UnreceivedPackets gRPC method. Given a list of counterparty packet commitments, the querier checks if the packet has already been received by checking if a receipt exists on this chain for the packet sequence. All packets that haven't been received yet are returned in the response Usage: To use this method correctly, first query all packet commitments on the sending chain using the Query/PacketCommitments gRPC method. Then input the returned sequences into the QueryUnreceivedPacketsRequest and send the request to this Query/UnreceivedPackets on the **receiving** chain. This gRPC method will then return the list of packet sequences that are yet to be received on the receiving chain.
NOTE: The querier makes the assumption that the provided list of packet commitments is correct and will not function properly if the list is not up to date. Ideally the query height should equal the latest height on the counterparty's client which represents this chain.
func (Keeper) ValidatePacket ¶
ValidatePacket validates packet sequence
func (Keeper) WriteAcknowledgement ¶
func (k Keeper) WriteAcknowledgement( ctx sdk.Context, packet exported.PacketI, acknowledgement []byte, ) 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 XIBC 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. previously by RecvPacket.