ethtest

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Copyright 2023 The go-ethereum Authors This file is part of go-ethereum.

go-ethereum is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

go-ethereum is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addresses added in v1.13.8

type Addresses []common.Address

func (Addresses) Len added in v1.13.8

func (a Addresses) Len() int

func (Addresses) Less added in v1.13.8

func (a Addresses) Less(i, j int) bool

func (Addresses) Swap added in v1.13.8

func (a Addresses) Swap(i, j int)

type Chain

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

Chain is a lightweight blockchain-like store which can read a hivechain created chain.

func NewChain added in v1.13.8

func NewChain(dir string) (*Chain, error)

NewChain takes the given chain.rlp file, and decodes and returns the blocks from the file.

func (*Chain) AccountsInHashOrder added in v1.13.8

func (c *Chain) AccountsInHashOrder() []state.DumpAccount

AccountsInHashOrder returns all accounts of the head state, ordered by hash of address.

func (*Chain) Balance added in v1.13.8

func (c *Chain) Balance(addr common.Address) *big.Int

Balance returns the balance of an account at the head of the chain.

func (*Chain) CodeHashes added in v1.13.8

func (c *Chain) CodeHashes() []common.Hash

CodeHashes returns all bytecode hashes contained in the head state.

func (*Chain) ForkID

func (c *Chain) ForkID() forkid.ID

ForkID gets the fork id of the chain.

func (*Chain) GetBlock added in v1.13.8

func (c *Chain) GetBlock(number int) *types.Block

GetBlock returns the block at the specified number.

func (*Chain) GetHeaders added in v1.9.23

func (c *Chain) GetHeaders(req *eth.GetBlockHeadersPacket) ([]*types.Header, error)

GetHeaders returns the headers base on an ethGetPacketHeadersPacket.

func (*Chain) GetSender added in v1.13.8

func (c *Chain) GetSender(idx int) (common.Address, uint64)

GetSender returns the address associated with account at the index in the pre-funded accounts list.

func (*Chain) Head

func (c *Chain) Head() *types.Block

Head returns the chain head.

func (*Chain) IncNonce added in v1.13.8

func (c *Chain) IncNonce(addr common.Address, amt uint64)

IncNonce increases the specified signing account's pending nonce.

func (*Chain) Len

func (c *Chain) Len() int

Len returns the length of the chain.

func (*Chain) RootAt added in v1.10.16

func (c *Chain) RootAt(height int) common.Hash

RootAt returns the state root for the block at the given height.

func (*Chain) Shorten

func (c *Chain) Shorten(height int) *Chain

Shorten returns a copy chain of a desired height from the imported

func (*Chain) SignTx added in v1.13.8

func (c *Chain) SignTx(from common.Address, tx *types.Transaction) (*types.Transaction, error)

SignTx signs a transaction for the specified from account, so long as that account was in the hivechain accounts dump.

func (*Chain) TD

func (c *Chain) TD() *big.Int

TD calculates the total difficulty of the chain at the chain head.

type Conn

type Conn struct {
	*rlpx.Conn
	// contains filtered or unexported fields
}

Conn represents an individual connection with a peer

func (*Conn) Read

func (c *Conn) Read() (uint64, []byte, error)

Read reads a packet from the connection.

func (*Conn) ReadEth added in v1.13.8

func (c *Conn) ReadEth() (any, error)

ReadEth reads an Eth sub-protocol wire message.

func (*Conn) ReadMsg added in v1.13.8

func (c *Conn) ReadMsg(proto Proto, code uint64, msg any) error

ReadMsg attempts to read a devp2p message with a specific code.

func (*Conn) ReadSnap added in v1.10.16

func (c *Conn) ReadSnap() (any, error)

ReadSnap reads a snap/1 response with the given id from the connection.

func (*Conn) Write

func (c *Conn) Write(proto Proto, code uint64, msg any) error

Write writes a eth packet to the connection.

type EngineClient added in v1.13.8

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

EngineClient is a wrapper around engine-related data.

func NewEngineClient added in v1.13.8

func NewEngineClient(dir, url, jwt string) (*EngineClient, error)

NewEngineClient creates a new engine client.

type Hello

type Hello = protoHandshake

type Proto added in v1.13.8

type Proto int

Proto is an enum representing devp2p protocol types.

type Suite

type Suite struct {
	Dest *enode.Node
	// contains filtered or unexported fields
}

Suite represents a structure used to test a node's conformance to the eth protocol.

func NewSuite

func NewSuite(dest *enode.Node, chainDir, engineURL, jwt string) (*Suite, error)

NewSuite creates and returns a new eth-test suite that can be used to test the given node against the given blockchain data.

func (*Suite) EthTests added in v1.10.0

func (s *Suite) EthTests() []utesting.Test

func (*Suite) SnapTests added in v1.10.16

func (s *Suite) SnapTests() []utesting.Test

func (*Suite) TestBlobViolations added in v1.13.8

func (s *Suite) TestBlobViolations(t *utesting.T)

func (*Suite) TestGetBlockBodies

func (s *Suite) TestGetBlockBodies(t *utesting.T)

func (*Suite) TestGetBlockHeaders

func (s *Suite) TestGetBlockHeaders(t *utesting.T)

func (*Suite) TestInvalidTxs added in v1.13.8

func (s *Suite) TestInvalidTxs(t *utesting.T)

func (*Suite) TestLargeTxRequest added in v1.10.22

func (s *Suite) TestLargeTxRequest(t *utesting.T)

func (*Suite) TestMaliciousHandshake added in v1.9.25

func (s *Suite) TestMaliciousHandshake(t *utesting.T)

func (*Suite) TestMaliciousStatus added in v1.9.25

func (s *Suite) TestMaliciousStatus(t *utesting.T)

func (*Suite) TestNewPooledTxs added in v1.10.22

func (s *Suite) TestNewPooledTxs(t *utesting.T)

func (*Suite) TestSameRequestID added in v1.10.22

func (s *Suite) TestSameRequestID(t *utesting.T)

func (*Suite) TestSimultaneousRequests added in v1.10.22

func (s *Suite) TestSimultaneousRequests(t *utesting.T)

func (*Suite) TestSnapGetAccountRange added in v1.10.16

func (s *Suite) TestSnapGetAccountRange(t *utesting.T)

TestSnapGetAccountRange various forms of GetAccountRange requests.

func (*Suite) TestSnapGetByteCodes added in v1.10.16

func (s *Suite) TestSnapGetByteCodes(t *utesting.T)

TestSnapGetByteCodes various forms of GetByteCodes requests.

func (*Suite) TestSnapGetStorageRanges added in v1.10.16

func (s *Suite) TestSnapGetStorageRanges(t *utesting.T)

TestSnapGetStorageRanges various forms of GetStorageRanges requests.

func (*Suite) TestSnapStatus added in v1.10.16

func (s *Suite) TestSnapStatus(t *utesting.T)

func (*Suite) TestSnapTrieNodes added in v1.10.16

func (s *Suite) TestSnapTrieNodes(t *utesting.T)

TestSnapTrieNodes various forms of GetTrieNodes requests.

func (*Suite) TestStatus

func (s *Suite) TestStatus(t *utesting.T)

func (*Suite) TestTransaction added in v1.9.25

func (s *Suite) TestTransaction(t *utesting.T)

func (*Suite) TestZeroRequestID added in v1.10.22

func (s *Suite) TestZeroRequestID(t *utesting.T)

Jump to

Keyboard shortcuts

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