mocks

package
v0.0.117 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package mocks mocks address, clients, etc for evm chains TODO: rename this package, as it's ignored by codecov. alternatively, rename all the mockery packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockLogs added in v0.0.5

func GetMockLogs(tb testing.TB, eventCount int) (logs []types.Log)

GetMockLogs gets eventCount mock events.

func GetMockTxes

func GetMockTxes(ctx context.Context, t *testing.T, count int, txType uint8) (txes []*types.Transaction)

GetMockTxes gets count txes from a new mock account. These are real txes ona simulated chain useful for testing db interactions/adding noise to listeners.

func MockAccount

func MockAccount(tb testing.TB) *keystore.Key

MockAccount mocks a new account.

func MockAddress

func MockAddress() common.Address

MockAddress generates a random ethereum address for testing.

func MockBlocksOnBackend

func MockBlocksOnBackend(ctx context.Context, t *testing.T, simulatedBackend backends.SimulatedTestBackend, count int) (blocks []*types.Block)

MockBlocksOnBackend mocks count blocks on a backend.

func MockTx

func MockTx(ctx context.Context, t *testing.T, simulatedBackend backends.SimulatedTestBackend, acct *keystore.Key, txType uint8) *types.Transaction

MockTx mocks a transaction on a simulated backend.

func NewMockHash

func NewMockHash(tb testing.TB) common.Hash

NewMockHash creates a mock hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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