cosmos

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 43 Imported by: 7

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 CosmosChainProcessor

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

func NewCosmosChainProcessor

func NewCosmosChainProcessor(log *zap.Logger, provider *CosmosProvider, metrics *processor.PrometheusMetrics) *CosmosChainProcessor

func (*CosmosChainProcessor) CollectMetrics

func (ccp *CosmosChainProcessor) CollectMetrics(ctx context.Context, persistence *queryCyclePersistence)

func (*CosmosChainProcessor) CurrentBlockHeight

func (ccp *CosmosChainProcessor) CurrentBlockHeight(ctx context.Context, persistence *queryCyclePersistence)

func (*CosmosChainProcessor) CurrentRelayerBalance

func (ccp *CosmosChainProcessor) CurrentRelayerBalance(ctx context.Context)

func (*CosmosChainProcessor) Provider

Provider returns the ChainProvider, which provides the methods for querying, assembling IBC messages, and sending transactions.

func (*CosmosChainProcessor) Run

func (ccp *CosmosChainProcessor) Run(ctx context.Context, initialBlockHistory uint64) error

Run starts the query loop for the chain which will gather applicable ibc messages and push events out to the relevant PathProcessors. The initialBlockHistory parameter determines how many historical blocks should be fetched and processed before continuing with current blocks. ChainProcessors should obey the context and return upon context cancellation.

func (*CosmosChainProcessor) SetPathProcessors

func (ccp *CosmosChainProcessor) SetPathProcessors(pathProcessors processor.PathProcessors)

Set the PathProcessors that this ChainProcessor should publish relevant IBC events to. ChainProcessors need reference to their PathProcessors and vice-versa, handled by EventProcessorBuilder.Build().

type CosmosIBCHeader

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

func (CosmosIBCHeader) ConsensusState

func (h CosmosIBCHeader) ConsensusState() ibcexported.ConsensusState

func (CosmosIBCHeader) Height

func (h CosmosIBCHeader) Height() uint64

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

	// metrics to monitor the provider
	TotalFees sdk.Coins
	// 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) BlockTime

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

func (*CosmosProvider) ChainId

func (cc *CosmosProvider) ChainId() string

func (*CosmosProvider) ChainName

func (cc *CosmosProvider) ChainName() string

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) ConnectionProof

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

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) 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) MsgCreateClient

func (cc *CosmosProvider) MsgCreateClient(
	clientState ibcexported.ClientState,
	consensusState ibcexported.ConsensusState,
) (provider.RelayerMessage, error)

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

func (*CosmosProvider) MsgRecvPacket

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

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(
	dstAddr string,
	amount sdk.Coin,
	info provider.PacketInfo,
) (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(
	dstChainID string,
	dstUpdateHeader provider.IBCHeader,
	dstTrustingPeriod,
	dstUbdPeriod time.Duration,
	allowUpdateAfterExpiry,
	allowUpdateAfterMisbehaviour bool,
) (ibcexported.ClientState, error)

NewClientState creates a new tendermint client state tracking the dst chain.

func (*CosmosProvider) NextSeqRecv

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

NextSeqRecv queries for the appropriate Tendermint proof required to prove the next expected packet sequence number for a given counterparty channel. This is used in ORDERED channels to ensure packets are being delivered in the exact same order as they were sent over the wire.

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) QueryIBCHeader

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

QueryIBCHeader returns the IBC compatible block header (CosmosIBCHeader) at a specific height.

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) QueryRecvPacket

func (cc *CosmosProvider) QueryRecvPacket(
	ctx context.Context,
	dstChanID,
	dstPortID string,
	sequence uint64,
) (provider.PacketInfo, error)

func (*CosmosProvider) QuerySendPacket

func (cc *CosmosProvider) QuerySendPacket(
	ctx context.Context,
	srcChanID,
	srcPortID string,
	sequence uint64,
) (provider.PacketInfo, error)

func (*CosmosProvider) QueryStakingParams

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

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) RelayPacketFromSequence

func (cc *CosmosProvider) RelayPacketFromSequence(
	ctx context.Context,
	src provider.ChainProvider,
	srch, dsth, seq uint64,
	srcChanID, srcPortID 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) SetMetrics

func (cc *CosmosProvider) SetMetrics(m *processor.PrometheusMetrics)

func (*CosmosProvider) Sprint

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

Sprint returns the json representation of the specified proto message.

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) UpdateFeesSpent

func (cc *CosmosProvider) UpdateFeesSpent(chain, key string, fees sdk.Coins)

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"`
	MinGasAmount   uint64  `json:"min-gas-amount" yaml:"min-gas-amount"`
	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