testeth

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: AGPL-3.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeployToken

func DeployToken(ctx context.Context, network *Network, supply int64) error

DeployToken deploys test token to provided network using coinbase account.

func Run

func Run(t *testing.T, numNetworks, numAccounts int, test func(ctx *testcontext.Context, t *testing.T, network []*Network))

Run creates Ethereum test network with deployed test token and executes test function.

Types

type Network

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

Network - test Ethererum network.

func NewNetwork

func NewNetwork(nodeConfig node.Config, ethConfig ethconfig.Config, numAccounts int) (*Network, error)

NewNetwork creates new test Ethereum network with PoS and inmemory DBs.

func (*Network) Accounts

func (network *Network) Accounts() []accounts.Account

Accounts returns available accounts, with first one being coinbase account.

func (*Network) ChainID

func (network *Network) ChainID() *big.Int

ChainID returns chaind id of the network.

func (*Network) Close

func (network *Network) Close() error

Close stops the node and releases resources acquired in node constructor.

func (*Network) Dial

func (network *Network) Dial() *ethclient.Client

Dial creates new Ethereum client connected to in-process API handler.

func (*Network) Ethereum

func (network *Network) Ethereum() *eth.Ethereum

Ethereum returns Ethereum full service.

func (*Network) HTTPEndpoint

func (network *Network) HTTPEndpoint() string

HTTPEndpoint returns HTTP RPC API endpoint address.

func (*Network) Start

func (network *Network) Start() error

Start starts all registered lifecycles, RPC services, p2p networking and starts mining.

func (*Network) TokenAddress added in v1.0.5

func (network *Network) TokenAddress() common.Address

TokenAddress returns address of deployed test token.

func (*Network) TransactOptions

func (network *Network) TransactOptions(ctx context.Context, account accounts.Account, nonce int64) *bind.TransactOpts

TransactOptions creates new key store transaction opts for given account with provided nonce and context.

func (*Network) WaitForTx

func (network *Network) WaitForTx(ctx context.Context, hash common.Hash) (*types.Receipt, error)

WaitForTx block execution until transaction receipt is received or context is cancelled.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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