Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainHeight ¶
type ChainHeight struct { Logger zerolog.Logger HeightChanged chan (int64) // contains filtered or unexported fields }
ChainHeight is used to cache the chain height of the current node which is being updated each time the node sends an event of EventNewBlockHeader. It starts a goroutine to subscribe to blockchain new block event and update the cached height.
func NewChainHeight ¶
func NewChainHeight( ctx context.Context, client client.CometRPC, logger zerolog.Logger, ) (*ChainHeight, error)
NewChainHeight returns a new ChainHeight struct that starts a new goroutine subscribed to EventNewBlockHeader.
func (*ChainHeight) GetChainHeight ¶
func (chainHeight *ChainHeight) GetChainHeight() (int64, error)
GetChainHeight returns the last chain height available.
type OjoClient ¶
OjoClient is a helper for initializing a keychain, a cosmos-sdk client context, and sending transactions/queries to a specific Ojo node
func NewOjoClient ¶
func NewOjoClient( chainID string, tmrpcEndpoint string, grpcEndpoint string, accountName string, accountMnemonic string, encCfg testutil.TestEncodingConfig, ) (oc *OjoClient, err error)
NewOjoClient returns a new instance of the OjoClient with initialized query and transaction clients
func (*OjoClient) NewChainHeight ¶
func (oc *OjoClient) NewChainHeight(ctx context.Context, logger zerolog.Logger) (*ChainHeight, error)
NewChainHeight returns a new instance of the ChainHeight struct using the OjoClient's transaction sdk.client
func (*OjoClient) QueryTxHash ¶ added in v0.2.0
func (oc *OjoClient) QueryTxHash(hash string) (*sdk.TxResponse, error)