mock

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestBackend

type TestBackend struct {
	*backends.SimulatedBackend
}

TestBackend is the backend to use for tests with a simulated backend

func NewTestBackend

func NewTestBackend(backend *backends.SimulatedBackend) *TestBackend

NewTestBackend returns a new TestBackend for the given SimulatedBackend It also causes an initial commit to make sure that genesis accounts are set up

func (*TestBackend) Close

func (b *TestBackend) Close()

Close overrides the Close function of the underlying SimulatedBackend so that it does nothing This allows the same SimulatedBackend backend to be reused across tests This is necessary due to some memory leakage issues with the used version of the SimulatedBackend

func (*TestBackend) SendTransaction

func (b *TestBackend) SendTransaction(ctx context.Context, tx *types.Transaction) (err error)

SendTransaction adds a commit after a successful send

Jump to

Keyboard shortcuts

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