cosmos

package
v3.0.0-...-9121f9c Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainClientConfig

func ChainClientConfig(pcfg *CosmosProviderConfig) *lens.ChainClientConfig

ChainClientConfig builds a ChainClientConfig struct from a CosmosProviderConfig, this is used to instantiate an instance of ChainClient from lens which is how we build the CosmosProvider

func CosmosMsg

func CosmosMsg(rm provider.RelayerMessage) sdk.Msg

func CosmosMsgs

func CosmosMsgs(rm ...provider.RelayerMessage) []sdk.Msg

func DefaultPageRequest

func DefaultPageRequest() *querytypes.PageRequest

func NewCosmosMessage

func NewCosmosMessage(msg sdk.Msg) provider.RelayerMessage

Types

type CosmosIBCHeader

type CosmosIBCHeader struct {
	SignedHeader *tmtypes.SignedHeader
	ValidatorSet *tmtypes.ValidatorSet
}

func (CosmosIBCHeader) Height

func (h CosmosIBCHeader) Height() uint64

func (CosmosIBCHeader) IBCHeaderIndicator

func (h CosmosIBCHeader) IBCHeaderIndicator()

noop to implement processor.IBCHeader

type CosmosMessage

type CosmosMessage struct {
	Msg sdk.Msg
}

func (CosmosMessage) MarshalLogObject

func (cm CosmosMessage) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject is used to encode cm to a zap logger with the zap.Object field type.

func (CosmosMessage) MsgBytes

func (cm CosmosMessage) MsgBytes() ([]byte, error)

func (CosmosMessage) Type

func (cm CosmosMessage) Type() string

type CosmosProvider

type CosmosProvider struct {
	lens.ChainClient
	PCfg CosmosProviderConfig
	// contains filtered or unexported fields
}

func (*CosmosProvider) AcknowledgementFromSequence

func (cc *CosmosProvider) AcknowledgementFromSequence(ctx context.Context, dst provider.ChainProvider, dsth, seq uint64, dstChanId, dstPortId, srcChanId, srcPortId string) (provider.RelayerMessage, error)

AcknowledgementFromSequence relays an acknowledgement with a given seq on src, source is the sending chain, destination is the receiving chain

func (*CosmosProvider) AddKey

func (cc *CosmosProvider) AddKey(name string, coinType uint32) (*provider.KeyOutput, error)

func (*CosmosProvider) Address

func (cc *CosmosProvider) Address() (string, error)

Address returns the chains configured address as a string

func (*CosmosProvider) AutoUpdateClient

func (cc *CosmosProvider) AutoUpdateClient(ctx context.Context, dst provider.ChainProvider, thresholdTime time.Duration, srcClientId, dstClientId string) (time.Duration, error)

AutoUpdateClient update client automatically to prevent expiry

func (*CosmosProvider) BlockTime

func (cc *CosmosProvider) BlockTime(ctx context.Context, height int64) (int64, error)

func (*CosmosProvider) ChainId

func (cc *CosmosProvider) ChainId() string

func (*CosmosProvider) ChainName

func (cc *CosmosProvider) ChainName() string

func (*CosmosProvider) ChannelCloseConfirm

func (cc *CosmosProvider) ChannelCloseConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dsth int64, dstChanId, dstPortId, srcPortId, srcChanId string) (provider.RelayerMessage, error)

func (*CosmosProvider) ChannelCloseInit

func (cc *CosmosProvider) ChannelCloseInit(srcPortId, srcChanId string) (provider.RelayerMessage, error)

func (*CosmosProvider) ChannelOpenAck

func (cc *CosmosProvider) ChannelOpenAck(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.Header, srcClientId, srcPortId, srcChanId, dstChanId, dstPortId string) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ChannelOpenConfirm

func (cc *CosmosProvider) ChannelOpenConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.Header, srcClientId, srcPortId, srcChanId, dstPortId, dstChanId string) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ChannelOpenInit

func (cc *CosmosProvider) ChannelOpenInit(srcClientId, srcConnId, srcPortId, srcVersion, dstPortId string, order chantypes.Order, dstHeader ibcexported.Header) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ChannelOpenTry

func (cc *CosmosProvider) ChannelOpenTry(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.Header, srcPortId, dstPortId, srcChanId, dstChanId, srcVersion, srcConnectionId, srcClientId string) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ChannelProof

func (cc *CosmosProvider) ChannelProof(
	ctx context.Context,
	msg provider.ChannelInfo,
	height uint64,
) (provider.ChannelProof, error)

func (*CosmosProvider) ConnectionHandshakeProof

func (cc *CosmosProvider) ConnectionHandshakeProof(
	ctx context.Context,
	msgOpenInit provider.ConnectionInfo,
	height uint64,
) (provider.ConnectionProof, error)

func (*CosmosProvider) ConnectionOpenAck

func (cc *CosmosProvider) ConnectionOpenAck(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.Header, srcClientId, srcConnId, dstClientId, dstConnId string) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ConnectionOpenConfirm

func (cc *CosmosProvider) ConnectionOpenConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.Header, dstConnId, srcClientId, srcConnId string) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ConnectionOpenInit

func (cc *CosmosProvider) ConnectionOpenInit(srcClientId, dstClientId string, dstHeader ibcexported.Header) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ConnectionOpenTry

func (cc *CosmosProvider) ConnectionOpenTry(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.Header, srcClientId, dstClientId, srcConnId, dstConnId string) ([]provider.RelayerMessage, error)

func (*CosmosProvider) ConnectionProof

func (cc *CosmosProvider) ConnectionProof(
	ctx context.Context,
	msgOpenAck provider.ConnectionInfo,
	height uint64,
) (provider.ConnectionProof, error)

func (*CosmosProvider) CreateClient

func (cc *CosmosProvider) CreateClient(clientState ibcexported.ClientState, dstHeader ibcexported.Header, signer string) (provider.RelayerMessage, error)

CreateClient creates an sdk.Msg to update the client on src with consensus state from dst

func (*CosmosProvider) GenerateConnHandshakeProof

func (cc *CosmosProvider) GenerateConnHandshakeProof(ctx context.Context, height int64, clientId, connId string) (clientState ibcexported.ClientState, clientStateProof []byte, consensusProof []byte, connectionProof []byte, connectionProofHeight ibcexported.Height, err error)

GenerateConnHandshakeProof generates all the proofs needed to prove the existence of the connection state on this chain. A counterparty should use these generated proofs.

func (*CosmosProvider) GetIBCUpdateHeader

func (cc *CosmosProvider) GetIBCUpdateHeader(ctx context.Context, srch int64, dst provider.ChainProvider, dstClientId string) (ibcexported.Header, error)

GetIBCUpdateHeader updates the off chain tendermint light client and returns an IBC Update Header which can be used to update an on chain light client on the destination chain. The source is used to construct the header data.

func (*CosmosProvider) GetLightSignedHeaderAtHeight

func (cc *CosmosProvider) GetLightSignedHeaderAtHeight(ctx context.Context, h int64) (ibcexported.Header, error)

func (*CosmosProvider) IBCHeaderAtHeight

func (cc *CosmosProvider) IBCHeaderAtHeight(ctx context.Context, h int64) (provider.IBCHeader, error)

func (*CosmosProvider) InjectTrustedFields

func (cc *CosmosProvider) InjectTrustedFields(ctx context.Context, header ibcexported.Header, dst provider.ChainProvider, dstClientId string) (ibcexported.Header, error)

InjectTrustedFields injects the necessary trusted fields for a header to update a light client stored on the destination chain, using the information provided by the source chain. TrustedHeight is the latest height of the IBC client on dst TrustedValidators is the validator set of srcChain at the TrustedHeight InjectTrustedFields returns a copy of the header with TrustedFields modified

func (*CosmosProvider) Key

func (cc *CosmosProvider) Key() string

func (*CosmosProvider) LogFailedTx

func (cc *CosmosProvider) LogFailedTx(res *provider.RelayerTxResponse, err error, msgs []provider.RelayerMessage)

LogFailedTx takes the transaction and the messages to create it and logs the appropriate data

func (*CosmosProvider) LogSuccessTx

func (cc *CosmosProvider) LogSuccessTx(res *sdk.TxResponse, msgs []provider.RelayerMessage)

LogSuccessTx take the transaction and the messages to create it and logs the appropriate data

func (*CosmosProvider) MsgAcknowledgement

func (cc *CosmosProvider) MsgAcknowledgement(
	msgRecvPacket provider.PacketInfo,
	proof provider.PacketProof,
) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgChannelCloseConfirm

func (cc *CosmosProvider) MsgChannelCloseConfirm(msgCloseInit provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgChannelCloseInit

func (cc *CosmosProvider) MsgChannelCloseInit(info provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgChannelOpenAck

func (cc *CosmosProvider) MsgChannelOpenAck(msgOpenTry provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgChannelOpenConfirm

func (cc *CosmosProvider) MsgChannelOpenConfirm(msgOpenAck provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgChannelOpenInit

func (cc *CosmosProvider) MsgChannelOpenInit(info provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgChannelOpenTry

func (cc *CosmosProvider) MsgChannelOpenTry(msgOpenInit provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgConnectionOpenAck

func (cc *CosmosProvider) MsgConnectionOpenAck(msgOpenTry provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgConnectionOpenConfirm

func (cc *CosmosProvider) MsgConnectionOpenConfirm(msgOpenAck provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgConnectionOpenInit

func (cc *CosmosProvider) MsgConnectionOpenInit(info provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgConnectionOpenTry

func (cc *CosmosProvider) MsgConnectionOpenTry(msgOpenInit provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgRecvPacket

func (cc *CosmosProvider) MsgRecvPacket(
	msgTransfer provider.PacketInfo,
	proof provider.PacketProof,
) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgRelayAcknowledgement

func (cc *CosmosProvider) MsgRelayAcknowledgement(ctx context.Context, dst provider.ChainProvider, dstChanId, dstPortId, srcChanId, srcPortId string, dsth int64, packet provider.RelayPacket) (provider.RelayerMessage, error)

MsgRelayAcknowledgement constructs the MsgAcknowledgement which is to be sent to the sending chain. The counterparty represents the receiving chain where the acknowledgement would be stored.

func (*CosmosProvider) MsgRelayInterqueryResult

func (cc *CosmosProvider) MsgRelayInterqueryResult(ctx context.Context, src, dst provider.ChainProvider, srch, dsth int64, query interquerytypes.Interquery) (provider.RelayerMessage, error)

MsgRelayInterqueryResult constructs the MsgRelayInterqueryResult which is to be sent to the querying chain. The counterparty represents the queried chain being queried.

func (*CosmosProvider) MsgRelayRecvPacket

func (cc *CosmosProvider) MsgRelayRecvPacket(ctx context.Context, dst provider.ChainProvider, dsth int64, packet provider.RelayPacket, dstChanId, dstPortId, srcChanId, srcPortId string) (provider.RelayerMessage, error)

MsgRelayRecvPacket constructs the MsgRecvPacket which is to be sent to the receiving chain. The counterparty represents the sending chain where the packet commitment would be stored.

func (*CosmosProvider) MsgRelayTimeout

func (cc *CosmosProvider) MsgRelayTimeout(
	ctx context.Context,
	dst provider.ChainProvider,
	dsth int64,
	packet provider.RelayPacket,
	dstChanId, dstPortId, srcChanId, srcPortId string,
	order chantypes.Order,
) (provider.RelayerMessage, error)

MsgRelayTimeout constructs the MsgTimeout which is to be sent to the sending chain. The counterparty represents the receiving chain where the receipts would have been stored.

func (*CosmosProvider) MsgTimeout

func (cc *CosmosProvider) MsgTimeout(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgTimeoutOnClose

func (cc *CosmosProvider) MsgTimeoutOnClose(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgTransfer

func (cc *CosmosProvider) MsgTransfer(amount sdk.Coin, dstChainId, dstAddr, srcPortId, srcChanId string, timeoutHeight, timeoutTimestamp uint64) (provider.RelayerMessage, error)

MsgTransfer creates a new transfer message

func (*CosmosProvider) MsgUpdateClient

func (cc *CosmosProvider) MsgUpdateClient(srcClientId string, dstHeader ibcexported.Header) (provider.RelayerMessage, error)

func (*CosmosProvider) MsgUpdateClientHeader

func (cc *CosmosProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader) (ibcexported.Header, error)

func (*CosmosProvider) MsgUpgradeClient

func (*CosmosProvider) NewClientState

func (cc *CosmosProvider) NewClientState(dstUpdateHeader ibcexported.Header, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool) (ibcexported.ClientState, error)

func (*CosmosProvider) PacketAcknowledgement

func (cc *CosmosProvider) PacketAcknowledgement(
	ctx context.Context,
	msgRecvPacket provider.PacketInfo,
	height uint64,
) (provider.PacketProof, error)

func (*CosmosProvider) PacketCommitment

func (cc *CosmosProvider) PacketCommitment(
	ctx context.Context,
	msgTransfer provider.PacketInfo,
	height uint64,
) (provider.PacketProof, error)

func (*CosmosProvider) PacketReceipt

func (cc *CosmosProvider) PacketReceipt(
	ctx context.Context,
	msgTransfer provider.PacketInfo,
	height uint64,
) (provider.PacketProof, error)

func (*CosmosProvider) ProviderConfig

func (cc *CosmosProvider) ProviderConfig() provider.ProviderConfig

func (*CosmosProvider) QueryBalance

func (cc *CosmosProvider) QueryBalance(ctx context.Context, keyName string) (sdk.Coins, error)

QueryBalance returns the amount of coins in the relayer account

func (*CosmosProvider) QueryBalanceWithAddress

func (cc *CosmosProvider) QueryBalanceWithAddress(ctx context.Context, address string) (sdk.Coins, error)

QueryBalanceWithAddress returns the amount of coins in the relayer account with address as input TODO add pagination support

func (*CosmosProvider) QueryChannel

func (cc *CosmosProvider) QueryChannel(ctx context.Context, height int64, channelid, portid string) (chanRes *chantypes.QueryChannelResponse, err error)

QueryChannel returns the channel associated with a channelID

func (*CosmosProvider) QueryChannelClient

func (cc *CosmosProvider) QueryChannelClient(ctx context.Context, height int64, channelid, portid string) (*clienttypes.IdentifiedClientState, error)

QueryChannelClient returns the client state of the client supporting a given channel

func (*CosmosProvider) QueryChannels

func (cc *CosmosProvider) QueryChannels(ctx context.Context) ([]*chantypes.IdentifiedChannel, error)

QueryChannels returns all the channels that are registered on a chain TODO add pagination support

func (*CosmosProvider) QueryClientConsensusState

func (cc *CosmosProvider) QueryClientConsensusState(ctx context.Context, chainHeight int64, clientid string, clientHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error)

QueryClientConsensusState retrieves the latest consensus state for a client in state at a given height

func (*CosmosProvider) QueryClientState

func (cc *CosmosProvider) QueryClientState(ctx context.Context, height int64, clientid string) (ibcexported.ClientState, error)

QueryClientState retrieves the latest consensus state for a client in state at a given height and unpacks it to exported client state interface

func (*CosmosProvider) QueryClientStateResponse

func (cc *CosmosProvider) QueryClientStateResponse(ctx context.Context, height int64, srcClientId string) (*clienttypes.QueryClientStateResponse, error)

QueryClientStateResponse retrieves the latest consensus state for a client in state at a given height

func (*CosmosProvider) QueryClients

QueryClients queries all the clients! TODO add pagination support

func (*CosmosProvider) QueryConnection

func (cc *CosmosProvider) QueryConnection(ctx context.Context, height int64, connectionid string) (*conntypes.QueryConnectionResponse, error)

QueryConnection returns the remote end of a given connection

func (*CosmosProvider) QueryConnectionChannels

func (cc *CosmosProvider) QueryConnectionChannels(ctx context.Context, height int64, connectionid string) ([]*chantypes.IdentifiedChannel, error)

QueryConnectionChannels queries the channels associated with a connection

func (*CosmosProvider) QueryConnections

func (cc *CosmosProvider) QueryConnections(ctx context.Context) (conns []*conntypes.IdentifiedConnection, err error)

QueryConnections gets any connections on a chain TODO add pagination support

func (*CosmosProvider) QueryConnectionsUsingClient

func (cc *CosmosProvider) QueryConnectionsUsingClient(ctx context.Context, height int64, clientid string) (*conntypes.QueryConnectionsResponse, error)

QueryConnectionsUsingClient gets any connections that exist between chain and counterparty TODO add pagination support

func (*CosmosProvider) QueryConsensusState

func (cc *CosmosProvider) QueryConsensusState(ctx context.Context, height int64) (ibcexported.ConsensusState, int64, error)

QueryConsensusState returns a consensus state for a given chain to be used as a client in another chain, fetches latest height when passed 0 as arg

func (*CosmosProvider) QueryConsensusStateABCI

func (cc *CosmosProvider) QueryConsensusStateABCI(ctx context.Context, clientID string, height ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error)

func (*CosmosProvider) QueryDenomTrace

func (cc *CosmosProvider) QueryDenomTrace(ctx context.Context, denom string) (*transfertypes.DenomTrace, error)

QueryDenomTrace takes a denom from IBC and queries the information about it

func (*CosmosProvider) QueryDenomTraces

func (cc *CosmosProvider) QueryDenomTraces(ctx context.Context, offset, limit uint64, height int64) ([]transfertypes.DenomTrace, error)

QueryDenomTraces returns all the denom traces from a given chain TODO add pagination support

func (*CosmosProvider) QueryHeaderAtHeight

func (cc *CosmosProvider) QueryHeaderAtHeight(ctx context.Context, height int64) (ibcexported.Header, error)

QueryHeaderAtHeight returns the header at a given height

func (*CosmosProvider) QueryInterqueries

func (cc *CosmosProvider) QueryInterqueries(ctx context.Context, height uint64) ([]interquerytypes.Interquery, error)

QueryInterqueries returns a list of all interquery requests

func (*CosmosProvider) QueryInterqueryResults

func (cc *CosmosProvider) QueryInterqueryResults(ctx context.Context, height uint64) ([]interquerytypes.InterqueryResult, error)

QueryInterqueryResults returns a list of all interquery results

func (*CosmosProvider) QueryInterqueryTimeoutResults

func (cc *CosmosProvider) QueryInterqueryTimeoutResults(ctx context.Context, height uint64) ([]interquerytypes.InterqueryTimeoutResult, error)

QueryInterqueryTimeoutResults returns a list of all timeout interquery results

func (*CosmosProvider) QueryLatestHeight

func (cc *CosmosProvider) QueryLatestHeight(ctx context.Context) (int64, error)

func (*CosmosProvider) QueryNextSeqRecv

func (cc *CosmosProvider) QueryNextSeqRecv(ctx context.Context, height int64, channelid, portid string) (recvRes *chantypes.QueryNextSequenceReceiveResponse, err error)

QueryNextSeqRecv returns the next seqRecv for a configured channel

func (*CosmosProvider) QueryPacketAcknowledgement

func (cc *CosmosProvider) QueryPacketAcknowledgement(ctx context.Context, height int64, channelid, portid string, seq uint64) (ackRes *chantypes.QueryPacketAcknowledgementResponse, err error)

QueryPacketAcknowledgement returns the packet ack proof at a given height

func (*CosmosProvider) QueryPacketAcknowledgements

func (cc *CosmosProvider) QueryPacketAcknowledgements(ctx context.Context, height uint64, channelid, portid string) (acknowledgements []*chantypes.PacketState, err error)

QueryPacketAcknowledgements returns an array of packet acks TODO add pagination support

func (*CosmosProvider) QueryPacketCommitment

func (cc *CosmosProvider) QueryPacketCommitment(ctx context.Context, height int64, channelid, portid string, seq uint64) (comRes *chantypes.QueryPacketCommitmentResponse, err error)

QueryPacketCommitment returns the packet commitment proof at a given height

func (*CosmosProvider) QueryPacketCommitments

func (cc *CosmosProvider) QueryPacketCommitments(ctx context.Context, height uint64, channelid, portid string) (commitments *chantypes.QueryPacketCommitmentsResponse, err error)

QueryPacketCommitments returns an array of packet commitments TODO add pagination support

func (*CosmosProvider) QueryPacketReceipt

func (cc *CosmosProvider) QueryPacketReceipt(ctx context.Context, height int64, channelid, portid string, seq uint64) (recRes *chantypes.QueryPacketReceiptResponse, err error)

QueryPacketReceipt returns the packet receipt proof at a given height

func (*CosmosProvider) QueryStakingParams

func (cc *CosmosProvider) QueryStakingParams(ctx context.Context) (*stakingtypes.Params, error)

func (*CosmosProvider) QueryStateABCI

func (cc *CosmosProvider) QueryStateABCI(ctx context.Context, height int64, path string, key []byte) (*abci.ResponseQuery, clienttypes.Height, error)

QueryTendermintProof performs an ABCI query with the given key and returns the value of the query, the proto encoded merkle proof, and the height of the Tendermint block containing the state root. The desired tendermint height to perform the query should be set in the client context. The query will be performed at one below this height (at the IAVL version) in order to obtain the correct merkle proof. Proof queries at height less than or equal to 2 are not supported. Queries with a client context height of 0 will perform a query at the lastest state available. Issue: https://github.com/cosmos/cosmos-sdk/issues/6567

func (*CosmosProvider) QueryTendermintProof

func (cc *CosmosProvider) QueryTendermintProof(ctx context.Context, height int64, key []byte) ([]byte, []byte, clienttypes.Height, error)

QueryTendermintProof performs an ABCI query with the given key and returns the value of the query, the proto encoded merkle proof, and the height of the Tendermint block containing the state root. The desired tendermint height to perform the query should be set in the client context. The query will be performed at one below this height (at the IAVL version) in order to obtain the correct merkle proof. Proof queries at height less than or equal to 2 are not supported. Queries with a client context height of 0 will perform a query at the latest state available. Issue: https://github.com/cosmos/cosmos-sdk/issues/6567

func (*CosmosProvider) QueryTx

func (cc *CosmosProvider) QueryTx(ctx context.Context, hashHex string) (*provider.RelayerTxResponse, error)

QueryTx takes a transaction hash and returns the transaction

func (*CosmosProvider) QueryTxs

func (cc *CosmosProvider) QueryTxs(ctx context.Context, page, limit int, events []string) ([]*provider.RelayerTxResponse, error)

QueryTxs returns an array of transactions given a tag

func (*CosmosProvider) QueryUnbondingPeriod

func (cc *CosmosProvider) QueryUnbondingPeriod(ctx context.Context) (time.Duration, error)

QueryUnbondingPeriod returns the unbonding period of the chain

func (*CosmosProvider) QueryUnreceivedAcknowledgements

func (cc *CosmosProvider) QueryUnreceivedAcknowledgements(ctx context.Context, height uint64, channelid, portid string, seqs []uint64) ([]uint64, error)

QueryUnreceivedAcknowledgements returns a list of unrelayed packet acks

func (*CosmosProvider) QueryUnreceivedPackets

func (cc *CosmosProvider) QueryUnreceivedPackets(ctx context.Context, height uint64, channelid, portid string, seqs []uint64) ([]uint64, error)

QueryUnreceivedPackets returns a list of unrelayed packet commitments

func (*CosmosProvider) QueryUpgradeProof

func (cc *CosmosProvider) QueryUpgradeProof(ctx context.Context, key []byte, height uint64) ([]byte, clienttypes.Height, error)

QueryUpgradeProof performs an abci query with the given key and returns the proto encoded merkle proof for the query and the height at which the proof will succeed on a tendermint verifier.

func (*CosmosProvider) QueryUpgradedClient

func (cc *CosmosProvider) QueryUpgradedClient(ctx context.Context, height int64) (*clienttypes.QueryClientStateResponse, error)

QueryUpgradedClient returns upgraded client info

func (*CosmosProvider) QueryUpgradedConsState

func (cc *CosmosProvider) QueryUpgradedConsState(ctx context.Context, height int64) (*clienttypes.QueryConsensusStateResponse, error)

QueryUpgradedConsState returns upgraded consensus state and height of client

func (*CosmosProvider) RelayPacketFromInterquery

func (cc *CosmosProvider) RelayPacketFromInterquery(ctx context.Context, src, dst provider.ChainProvider, srch, dsth uint64, iq interquerytypes.Interquery, dstConnectionId, srcConnectionId string) (provider.RelayerMessage, error)

RelayPacketFromInterquery relays a query on src and returns msgs, and/or error

func (*CosmosProvider) RelayPacketFromSequence

func (cc *CosmosProvider) RelayPacketFromSequence(
	ctx context.Context,
	src, dst provider.ChainProvider,
	srch, dsth, seq uint64,
	dstChanId, dstPortId, dstClientId, srcChanId, srcPortId, srcClientId string,
	order chantypes.Order,
) (provider.RelayerMessage, provider.RelayerMessage, error)

RelayPacketFromSequence relays a packet with a given seq on src and returns recvPacket msgs, timeoutPacketmsgs and error

func (*CosmosProvider) SendMessage

SendMessage attempts to sign, encode & send a RelayerMessage This is used extensively in the relayer as an extension of the Provider interface

func (*CosmosProvider) SendMessages

SendMessages attempts to sign, encode, & send a slice of RelayerMessages This is used extensively in the relayer as an extension of the Provider interface

NOTE: An error is returned if there was an issue sending the transaction. A successfully sent, but failed transaction will not return an error. If a transaction is successfully sent, the result of the execution of that transaction will be logged. A boolean indicating if a transaction was successfully sent and executed successfully is returned.

func (*CosmosProvider) Sprint

func (cc *CosmosProvider) Sprint(toPrint proto.Message) (string, error)

Sprint returns the json representation of the specified proto message.

func (*CosmosProvider) SubmitMisbehavior

func (cc *CosmosProvider) SubmitMisbehavior() (provider.RelayerMessage, error)

func (*CosmosProvider) Timeout

func (cc *CosmosProvider) Timeout() string

func (*CosmosProvider) TrustingPeriod

func (cc *CosmosProvider) TrustingPeriod(ctx context.Context) (time.Duration, error)

func (*CosmosProvider) Type

func (cc *CosmosProvider) Type() string

func (*CosmosProvider) ValidatePacket

func (cc *CosmosProvider) ValidatePacket(msgTransfer provider.PacketInfo, latest provider.LatestBlock) error

func (*CosmosProvider) WaitForNBlocks

func (cc *CosmosProvider) WaitForNBlocks(ctx context.Context, n int64) error

WaitForNBlocks blocks until the next block on a given chain

type CosmosProviderConfig

type CosmosProviderConfig struct {
	Key            string  `json:"key" yaml:"key"`
	ChainName      string  `json:"-" yaml:"-"`
	ChainID        string  `json:"chain-id" yaml:"chain-id"`
	RPCAddr        string  `json:"rpc-addr" yaml:"rpc-addr"`
	AccountPrefix  string  `json:"account-prefix" yaml:"account-prefix"`
	KeyringBackend string  `json:"keyring-backend" yaml:"keyring-backend"`
	GasAdjustment  float64 `json:"gas-adjustment" yaml:"gas-adjustment"`
	GasPrices      string  `json:"gas-prices" yaml:"gas-prices"`
	Debug          bool    `json:"debug" yaml:"debug"`
	Timeout        string  `json:"timeout" yaml:"timeout"`
	OutputFormat   string  `json:"output-format" yaml:"output-format"`
	SignModeStr    string  `json:"sign-mode" yaml:"sign-mode"`
}

func (CosmosProviderConfig) NewProvider

func (pc CosmosProviderConfig) NewProvider(log *zap.Logger, homepath string, debug bool, chainName string) (provider.ChainProvider, error)

NewProvider validates the CosmosProviderConfig, instantiates a ChainClient and then instantiates a CosmosProvider

func (CosmosProviderConfig) Validate

func (pc CosmosProviderConfig) Validate() error

Jump to

Keyboard shortcuts

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