jsonrpctest

package
v0.6.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	T         testing.TB
	Client    *ethclient.Client
	RawClient *rpc.Client
	ChainID   uint16

	WaitTxConfirmed       func(common.Hash) error
	NewAccountWithL2Funds func(baseTokens ...uint64) (*ecdsa.PrivateKey, common.Address)
	// contains filtered or unexported fields
}

Env is a testing environment for the EVM JSON-RPC support, allowing to run the same tests with both Solo and cluster backends.

func (*Env) Accounts

func (e *Env) Accounts() []common.Address

func (*Env) Balance

func (e *Env) Balance(address common.Address) *big.Int

func (*Env) BalanceAt added in v1.0.3

func (e *Env) BalanceAt(address common.Address, blockNumber *big.Int) *big.Int

func (*Env) BlockByHash

func (e *Env) BlockByHash(hash common.Hash) *types.Block

func (*Env) BlockByNumber

func (e *Env) BlockByNumber(number *big.Int) *types.Block

func (*Env) BlockNumber

func (e *Env) BlockNumber() uint64

func (*Env) BlockTransactionCountByHash

func (e *Env) BlockTransactionCountByHash(hash common.Hash) uint

func (*Env) BlockTransactionCountByNumber

func (e *Env) BlockTransactionCountByNumber() uint

func (*Env) Code

func (e *Env) Code(address common.Address) []byte

func (*Env) DeployEVMContract

func (e *Env) DeployEVMContract(creator *ecdsa.PrivateKey, contractABI abi.ABI, contractBytecode []byte, args ...interface{}) (*types.Transaction, *types.Receipt, common.Address)

func (*Env) MustSendTransaction

func (e *Env) MustSendTransaction(args *jsonrpc.SendTxArgs) common.Hash

func (*Env) MustTxReceipt

func (e *Env) MustTxReceipt(hash common.Hash) *types.Receipt

func (*Env) NonceAt

func (e *Env) NonceAt(address common.Address) uint64

func (*Env) SendTransaction

func (e *Env) SendTransaction(args *jsonrpc.SendTxArgs) (common.Hash, error)

func (*Env) SendTransactionAndWait added in v0.3.0

func (e *Env) SendTransactionAndWait(tx *types.Transaction) (*types.Receipt, error)

func (*Env) Sign

func (e *Env) Sign(address common.Address, data []byte) []byte

func (*Env) SignTransaction

func (e *Env) SignTransaction(args *jsonrpc.SendTxArgs) []byte

func (*Env) Signer added in v0.3.0

func (e *Env) Signer() types.Signer

func (*Env) Storage

func (e *Env) Storage(address common.Address, key common.Hash) []byte

func (*Env) TestGasPrice added in v1.0.3

func (e *Env) TestGasPrice()

func (*Env) TestRPCAccessHistoricalState added in v1.0.3

func (e *Env) TestRPCAccessHistoricalState()

func (*Env) TestRPCGasLimitTooLow added in v0.3.0

func (e *Env) TestRPCGasLimitTooLow()

func (*Env) TestRPCGetLogs

func (e *Env) TestRPCGetLogs()

func (*Env) TestRPCInvalidNonce

func (e *Env) TestRPCInvalidNonce()

func (*Env) TransactionByBlockHashAndIndex

func (e *Env) TransactionByBlockHashAndIndex(blockHash common.Hash, index uint) *types.Transaction

func (*Env) TransactionByBlockNumberAndIndex

func (e *Env) TransactionByBlockNumberAndIndex(blockNumber *big.Int, index uint) (*jsonrpc.RPCTransaction, error)

func (*Env) TransactionByHash

func (e *Env) TransactionByHash(hash common.Hash) *types.Transaction

func (*Env) TxReceipt

func (e *Env) TxReceipt(hash common.Hash) (*types.Receipt, error)

func (*Env) UncleByBlockHashAndIndex

func (e *Env) UncleByBlockHashAndIndex(blockHash common.Hash, index uint) map[string]interface{}

func (*Env) UncleByBlockNumberAndIndex

func (e *Env) UncleByBlockNumberAndIndex(blockNumber *big.Int, index uint) map[string]interface{}

func (*Env) UncleCountByBlockHash

func (e *Env) UncleCountByBlockHash(hash common.Hash) uint

func (*Env) UncleCountByBlockNumber

func (e *Env) UncleCountByBlockNumber(blockNumber *big.Int) uint

Jump to

Keyboard shortcuts

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