babylonclient

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BabylonClient

type BabylonClient interface {
	Stop()
	GetConfig() *config.BabylonConfig
	GetTagIdx() uint8
	GetAddr() (sdk.AccAddress, error)
	MustGetAddr() sdk.AccAddress
	QueryStakingParams() (*stakingtypes.Params, error)
	QueryEpochingParams() (*epochingtypes.Params, error)
	QueryBTCLightclientParams() (*btclctypes.Params, error)
	QueryBTCCheckpointParams() (*btcctypes.Params, error)
	MustQueryBTCCheckpointParams() *btcctypes.Params
	QueryHeaderChainTip() (*chainhash.Hash, uint64, error)
	QueryRawCheckpoint(epochNumber uint64) (*checkpointingtypes.RawCheckpointWithMeta, error)
	QueryRawCheckpointList(status checkpointingtypes.CheckpointStatus) ([]*checkpointingtypes.RawCheckpointWithMeta, error)
	QueryBaseHeader() (*wire.BlockHeader, uint64, error)
	QueryContainsBlock(blockHash *chainhash.Hash) (bool, error)
	InsertBTCSpvProof(msg *btcctypes.MsgInsertBTCSpvProof) (*sdk.TxResponse, error)
	InsertHeader(msg *btclctypes.MsgInsertHeader) (*sdk.TxResponse, error)
	InsertHeaders(msgs []*btclctypes.MsgInsertHeader) (*sdk.TxResponse, error)
	MustInsertBTCSpvProof(msg *btcctypes.MsgInsertBTCSpvProof) *sdk.TxResponse
}

type Client

type Client struct {
	*lensclient.ChainClient
	// contains filtered or unexported fields
}

func New

func New(cfg *config.BabylonConfig, retrySleepTime, maxRetrySleepTime time.Duration) (*Client, error)

func (*Client) GetAddr

func (c *Client) GetAddr() (sdk.AccAddress, error)

func (*Client) GetConfig

func (c *Client) GetConfig() *config.BabylonConfig

func (*Client) GetTagIdx

func (c *Client) GetTagIdx() uint8

func (*Client) InsertBTCSpvProof

func (c *Client) InsertBTCSpvProof(msg *btcctypes.MsgInsertBTCSpvProof) (*sdk.TxResponse, error)

func (*Client) InsertHeader

func (c *Client) InsertHeader(msg *btclctypes.MsgInsertHeader) (*sdk.TxResponse, error)

func (*Client) InsertHeaders

func (c *Client) InsertHeaders(msgs []*btclctypes.MsgInsertHeader) (*sdk.TxResponse, error)

func (*Client) MustGetAddr

func (c *Client) MustGetAddr() sdk.AccAddress

func (*Client) MustInsertBTCSpvProof

func (c *Client) MustInsertBTCSpvProof(msg *btcctypes.MsgInsertBTCSpvProof) *sdk.TxResponse

func (*Client) MustQueryBTCCheckpointParams

func (c *Client) MustQueryBTCCheckpointParams() *btcctypes.Params

func (*Client) QueryBTCCheckpointParams

func (c *Client) QueryBTCCheckpointParams() (*btcctypes.Params, error)

QueryBTCCheckpointParams queries btccheckpoint module's parameters via ChainClient

func (*Client) QueryBTCLightclientParams

func (c *Client) QueryBTCLightclientParams() (*btclctypes.Params, error)

QueryBTCLightclientParams queries btclightclient module's parameters via ChainClient

func (*Client) QueryBaseHeader

func (c *Client) QueryBaseHeader() (*wire.BlockHeader, uint64, error)

func (*Client) QueryContainsBlock

func (c *Client) QueryContainsBlock(blockHash *chainhash.Hash) (bool, error)

func (*Client) QueryEpochingParams

func (c *Client) QueryEpochingParams() (*epochingtypes.Params, error)

QueryEpochingParams queries epoching module's parameters via ChainClient code is adapted from https://github.com/strangelove-ventures/lens/blob/v0.5.1/client/query/staking.go#L7-L18

func (*Client) QueryHeaderChainTip

func (c *Client) QueryHeaderChainTip() (*chainhash.Hash, uint64, error)

QueryHeaderChainTip queries hash/height of the latest BTC block in the btclightclient module

func (*Client) QueryRawCheckpoint

func (c *Client) QueryRawCheckpoint(epochNumber uint64) (*checkpointingtypes.RawCheckpointWithMeta, error)

func (*Client) QueryStakingParams

func (c *Client) QueryStakingParams() (*stakingtypes.Params, error)

QueryStakingParams queries staking module's parameters via ChainClient code is adapted from https://github.com/strangelove-ventures/lens/blob/v0.5.1/cmd/staking.go#L128-L149

func (*Client) Stop

func (c *Client) Stop()

Jump to

Keyboard shortcuts

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