testutils

package
v0.0.0-...-b27245e Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForWithTimeout

func WaitForWithTimeout(ctx context.Context, ticker time.Duration, timeout time.Duration, cb func() (bool, error)) error

Types

type MockChain

type MockChain struct {
}

func NewMockChain

func NewMockChain() *MockChain

func (*MockChain) Config

func (c *MockChain) Config() *config.ChainConfig

func (*MockChain) Endpoint

func (c *MockChain) Endpoint() string

func (*MockChain) EthClient

func (c *MockChain) EthClient() *ethclient.Client

func (*MockChain) LogPath

func (c *MockChain) LogPath() string

func (*MockChain) SetBalance

func (c *MockChain) SetBalance(ctx context.Context, result interface{}, address common.Address, value *big.Int) error

func (*MockChain) SetCode

func (c *MockChain) SetCode(ctx context.Context, result interface{}, address common.Address, code string) error

func (*MockChain) SetIntervalMining

func (c *MockChain) SetIntervalMining(ctx context.Context, result interface{}, interval int64) error

func (*MockChain) SetStorageAt

func (c *MockChain) SetStorageAt(ctx context.Context, result interface{}, address common.Address, storageSlot string, storageValue string) error

func (*MockChain) SimulatedLogs

func (c *MockChain) SimulatedLogs(ctx context.Context, tx *types.Transaction) ([]types.Log, error)

func (*MockChain) Start

func (c *MockChain) Start(_ context.Context) error

func (*MockChain) Stop

func (c *MockChain) Stop(_ context.Context) error

func (*MockChain) String

func (c *MockChain) String() string

type MockChainReader

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

func NewMockChainReader

func NewMockChainReader(block *types.Block) *MockChainReader

func (*MockChainReader) BlockByHash

func (m *MockChainReader) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)

func (*MockChainReader) BlockByNumber

func (m *MockChainReader) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

func (*MockChainReader) HeaderByHash

func (m *MockChainReader) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)

func (*MockChainReader) HeaderByNumber

func (m *MockChainReader) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

func (*MockChainReader) SubscribeNewHead

func (m *MockChainReader) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)

func (*MockChainReader) TransactionCount

func (m *MockChainReader) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)

func (*MockChainReader) TransactionInBlock

func (m *MockChainReader) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)

type MockSubscription

type MockSubscription struct{}

func (*MockSubscription) Err

func (s *MockSubscription) Err() <-chan error

func (*MockSubscription) Unsubscribe

func (s *MockSubscription) Unsubscribe()

Jump to

Keyboard shortcuts

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