chainclients

package
v1.109.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadChains

func LoadChains(thorKeys *mayaclient.Keys,
	cfg map[common.Chain]config.BifrostChainConfiguration,
	server *tss.TssServer,
	mayachainBridge mayaclient.MayachainBridge,
	m *metrics.Metrics,
	pubKeyValidator pubkeymanager.PubKeyValidator,
	poolMgr mayaclient.PoolManager,
) (chains map[common.Chain]ChainClient, restart chan struct{})

LoadChains returns chain clients from chain configuration

Types

type ChainClient

type ChainClient interface {
	SignTx(tx stypes.TxOutItem, height int64) ([]byte, []byte, error)
	BroadcastTx(_ stypes.TxOutItem, _ []byte) (string, error)
	GetHeight() (int64, error)
	GetBlockScannerHeight() (int64, error)
	GetLatestTxForVault(vault string) (string, string, error)
	GetAddress(poolPubKey common.PubKey) string
	GetAccount(poolPubKey common.PubKey, height *big.Int) (common.Account, error)
	GetAccountByAddress(address string, height *big.Int) (common.Account, error)
	GetChain() common.Chain
	OnObservedTxIn(txIn types.TxInItem, blockHeight int64)
	Start(globalTxsQueue chan stypes.TxIn, globalErrataQueue chan stypes.ErrataBlock, globalSolvencyQueue chan stypes.Solvency)
	GetConfig() config.BifrostChainConfiguration
	GetConfirmationCount(txIn stypes.TxIn) int64
	ConfirmationCountReady(txIn stypes.TxIn) bool
	IsBlockScannerHealthy() bool
	Stop()
}

ChainClient is the interface that wraps basic chain client methods

SignTx signs transactions BroadcastTx broadcast transactions on the chain associated with the client GetChain get chain id SignTx sign transaction GetHeight get chain height GetAddress gets address for public key pool in chain GetAccount gets account from mayaclient in cain GetConfig gets the chain configuration Start Stop

type DummyChain

type DummyChain struct{}

func (DummyChain) BroadcastTx

func (DummyChain) BroadcastTx(_ stypes.TxOutItem, tx []byte) error

func (DummyChain) CheckIsTestNet

func (DummyChain) CheckIsTestNet() (string, bool)

func (DummyChain) GetAccount

func (DummyChain) GetAccount(addr string) (common.Account, error)

func (DummyChain) GetAddress

func (DummyChain) GetAddress(poolPubKey common.PubKey) string

func (DummyChain) GetChain

func (DummyChain) GetChain() common.Chain

func (DummyChain) GetGasFee

func (DummyChain) GetGasFee(count uint64) common.Gas

func (DummyChain) GetHeight

func (DummyChain) GetHeight() (int64, error)

func (DummyChain) IsBlockScannerHealthy

func (DummyChain) IsBlockScannerHealthy() bool

func (DummyChain) SignTx

func (DummyChain) SignTx(tx stypes.TxOutItem, height int64) ([]byte, error)

func (DummyChain) Start

func (DummyChain) Start(globalTxsQueue chan stypes.TxIn)

func (DummyChain) Stop

func (DummyChain) Stop()

Jump to

Keyboard shortcuts

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