backendmock

package
v2.8.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: BSD-3-Clause Imports: 7 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")

Functions

func New

func New(opts ...Option) transaction.Backend

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is the option passed to the mock Chequebook service

func WithBalanceAt

func WithBalanceAt(f func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error)) Option

func WithBlockNumberFunc

func WithBlockNumberFunc(f func(context.Context) (uint64, error)) Option

func WithCallContractFunc

func WithCallContractFunc(f func(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)) Option

func WithCodeAtFunc

func WithCodeAtFunc(f func(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)) Option

func WithEstimateGasFunc

func WithEstimateGasFunc(f func(ctx context.Context, msg ethereum.CallMsg) (gas uint64, err error)) Option

func WithHeaderbyNumberFunc

func WithHeaderbyNumberFunc(f func(ctx context.Context, number *big.Int) (*types.Header, error)) Option

func WithNonceAtFunc

func WithNonceAtFunc(f func(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)) Option

func WithPendingNonceAtFunc

func WithPendingNonceAtFunc(f func(ctx context.Context, account common.Address) (uint64, error)) Option

func WithSendTransactionFunc

func WithSendTransactionFunc(f func(ctx context.Context, tx *types.Transaction) error) Option

func WithSuggestGasTipCapFunc

func WithSuggestGasTipCapFunc(f func(ctx context.Context) (*big.Int, error)) Option

func WithSuggestedFeeAndTipFunc added in v2.7.0

func WithSuggestedFeeAndTipFunc(f func(ctx context.Context, gasPrice *big.Int, boostPercent int) (*big.Int, *big.Int, error)) Option

func WithTransactionByHashFunc

func WithTransactionByHashFunc(f func(ctx context.Context, txHash common.Hash) (*types.Transaction, bool, error)) Option

func WithTransactionReceiptFunc

func WithTransactionReceiptFunc(f func(ctx context.Context, txHash common.Hash) (*types.Receipt, error)) Option

Jump to

Keyboard shortcuts

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