evmtest

package
v2.0.0-beta0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGetDefaultChain

func MustGetDefaultChain(t testing.TB, cc evm.ChainSet) evm.Chain

func NewChainSet

func NewChainSet(t testing.TB, testopts TestChainOpts) evm.ChainSet

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

func NewChainSetOpts

func NewChainSetOpts(t testing.TB, testopts TestChainOpts) evm.ChainSetOpts

func NewEthClientMock

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

func NewEthClientMockWithDefaultChain

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

func NewMockChainSetWithChain

func NewMockChainSetWithChain(t testing.TB, ch evm.Chain) *evmmocks.ChainSet

NewMockChainSetWithChain returns a mock chainset with one chain

Types

type MockEth

type MockEth struct {
	EthClient       *evmMocks.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 MockORM

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

func NewMockORM

func NewMockORM(cs []chains.ChainConfig, nodes []evmtypes.Node) *MockORM

func (*MockORM) AddNodes

func (mo *MockORM) AddNodes(ns ...evmtypes.Node)

func (*MockORM) Chains

func (mo *MockORM) Chains(offset int, limit int, ids ...utils.Big) (cs []chains.ChainConfig, count int, err error)

func (*MockORM) GetNodesByChainIDs

func (mo *MockORM) GetNodesByChainIDs(chainIDs []utils.Big) (nodes []evmtypes.Node, err error)

GetNodesByChainIDs implements evmtypes.Configs

func (*MockORM) NodeNamed

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

func (*MockORM) Nodes

func (mo *MockORM) Nodes(offset int, limit int) (nodes []evmtypes.Node, cnt int, err error)

Nodes implements evmtypes.Configs

func (*MockORM) NodesForChain

func (mo *MockORM) NodesForChain(chainID utils.Big, offset int, limit int) ([]evmtypes.Node, int, error)

NodesForChain implements evmtypes.Configs

func (*MockORM) PutChains

func (mo *MockORM) PutChains(cs ...chains.ChainConfig)

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  evm.GeneralConfig
	HeadTracker    httypes.HeadTracker
	DB             *sqlx.DB
	TxManager      txmgr.TxManager
	KeyStore       keystore.Eth
	MailMon        *utils.MailboxMonitor
	GasEstimator   gas.EvmFeeEstimator
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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