evmtest

package
v0.0.0-...-3674750 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGetDefaultChain

func MustGetDefaultChain(t testing.TB, cc legacyevm.LegacyChainContainer) legacyevm.Chain

Deprecated, this is a replacement function for tests for now removed default chain logic

func MustGetDefaultChainID

func MustGetDefaultChainID(t testing.TB, evmCfgs evmtoml.EVMConfigs) *big.Int

Deprecated, this is a replacement function for tests for now removed default evmChainID logic

func NewChainRelayExtOpts

func NewChainRelayExtOpts(t testing.TB, testopts TestChainOpts) legacyevm.ChainRelayExtenderConfig

func NewChainRelayExtenders

func NewChainRelayExtenders(t testing.TB, testopts TestChainOpts) *evmrelay.ChainRelayerExtenders

NewChainRelayExtenders returns a simple chain collection with one chain and allows to mock client/config on that chain

func NewEthClientMock

func NewEthClientMock(t *testing.T) *evmclimocks.Client

func NewEthClientMockWithDefaultChain

func NewEthClientMockWithDefaultChain(t *testing.T) *evmclimocks.Client

Types

type MockEth

type MockEth struct {
	EthClient       *evmclimocks.Client
	CheckFilterLogs func(int64, int64)
	// contains filtered or unexported fields
}

func (*MockEth) NewSub

func (m *MockEth) NewSub(t *testing.T) ethereum.Subscription

func (*MockEth) SubsErr

func (m *MockEth) SubsErr(err error)

func (*MockEth) SubscribeCallCount

func (m *MockEth) SubscribeCallCount() int32

func (*MockEth) UnsubscribeCallCount

func (m *MockEth) UnsubscribeCallCount() int32

type RawSub

type RawSub[T any] struct {
	// contains filtered or unexported fields
}

func NewRawSub

func NewRawSub[T any](ch chan<- T, err <-chan error) RawSub[T]

func (*RawSub[T]) CloseCh

func (r *RawSub[T]) CloseCh()

func (*RawSub[T]) TrySend

func (r *RawSub[T]) TrySend(t T)

type TestChainOpts

type TestChainOpts struct {
	Client         evmclient.Client
	LogBroadcaster log.Broadcaster
	LogPoller      logpoller.LogPoller
	GeneralConfig  legacyevm.AppConfig
	HeadTracker    httypes.HeadTracker
	DB             *sqlx.DB
	TxManager      txmgr.TxManager
	KeyStore       keystore.Eth
	MailMon        *mailbox.Monitor
	GasEstimator   gas.EvmFeeEstimator
}

type TestConfigs

type TestConfigs struct {
	evmtoml.EVMConfigs
	// contains filtered or unexported fields
}

func NewTestConfigs

func NewTestConfigs(cs ...*evmtoml.EVMConfig) *TestConfigs

func (*TestConfigs) Chains

func (mo *TestConfigs) Chains(ids ...relay.ChainID) (cs []types.ChainStatus, count int, err error)

func (*TestConfigs) Node

func (mo *TestConfigs) Node(name string) (evmtypes.Node, error)

func (*TestConfigs) NodeStatusesPaged

func (mo *TestConfigs) NodeStatusesPaged(offset int, limit int, chainIDs ...string) (nodes []types.NodeStatus, cnt int, err error)

func (*TestConfigs) Nodes

func (mo *TestConfigs) Nodes(id relay.ChainID) (nodes []evmtypes.Node, err error)

Nodes implements evmtypes.Configs

func (*TestConfigs) PutChains

func (mo *TestConfigs) PutChains(cs ...evmtoml.EVMConfig)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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