package ethtest
import "github.com/ethereum/go-ethereum/cmd/devp2p/internal/ethtest"
Index ¶
- type Chain
- func NewChain(dir string) (*Chain, error)
- func (c *Chain) AccountsInHashOrder() []state.DumpAccount
- func (c *Chain) Balance(addr common.Address) *big.Int
- func (c *Chain) CodeHashes() []common.Hash
- func (c *Chain) ForkID() forkid.ID
- func (c *Chain) GetBlock(number int) *types.Block
- func (c *Chain) GetHeaders(req *eth.GetBlockHeadersPacket) ([]*types.Header, error)
- func (c *Chain) GetSender(idx int) (common.Address, uint64)
- func (c *Chain) Head() *types.Block
- func (c *Chain) IncNonce(addr common.Address, amt uint64)
- func (c *Chain) Len() int
- func (c *Chain) RootAt(height int) common.Hash
- func (c *Chain) Shorten(height int) *Chain
- func (c *Chain) SignTx(from common.Address, tx *types.Transaction) (*types.Transaction, error)
- func (c *Chain) TD() *big.Int
- type Conn
- func (c *Conn) Read() (uint64, []byte, error)
- func (c *Conn) ReadEth() (any, error)
- func (c *Conn) ReadMsg(proto Proto, code uint64, msg any) error
- func (c *Conn) ReadSnap() (any, error)
- func (c *Conn) Write(proto Proto, code uint64, msg any) error
- type EngineClient
- type Hello
- type Proto
- type Suite
- func NewSuite(dest *enode.Node, chainDir, engineURL, jwt string) (*Suite, error)
- func (s *Suite) EthTests() []utesting.Test
- func (s *Suite) SnapTests() []utesting.Test
- func (s *Suite) TestBlobTxWithMismatchedSidecar(t *utesting.T)
- func (s *Suite) TestBlobTxWithoutSidecar(t *utesting.T)
- func (s *Suite) TestBlobViolations(t *utesting.T)
- func (s *Suite) TestGetBlockBodies(t *utesting.T)
- func (s *Suite) TestGetBlockHeaders(t *utesting.T)
- func (s *Suite) TestGetNonexistentBlockHeaders(t *utesting.T)
- func (s *Suite) TestInvalidTxs(t *utesting.T)
- func (s *Suite) TestLargeTxRequest(t *utesting.T)
- func (s *Suite) TestMaliciousHandshake(t *utesting.T)
- func (s *Suite) TestNewPooledTxs(t *utesting.T)
- func (s *Suite) TestSameRequestID(t *utesting.T)
- func (s *Suite) TestSimultaneousRequests(t *utesting.T)
- func (s *Suite) TestSnapGetAccountRange(t *utesting.T)
- func (s *Suite) TestSnapGetByteCodes(t *utesting.T)
- func (s *Suite) TestSnapGetStorageRanges(t *utesting.T)
- func (s *Suite) TestSnapStatus(t *utesting.T)
- func (s *Suite) TestSnapTrieNodes(t *utesting.T)
- func (s *Suite) TestStatus(t *utesting.T)
- func (s *Suite) TestTransaction(t *utesting.T)
- func (s *Suite) TestZeroRequestID(t *utesting.T)
Types ¶
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 ¶
NewChain takes the given chain.rlp file, and decodes and returns the blocks from the file.
func (*Chain) AccountsInHashOrder ¶
func (c *Chain) AccountsInHashOrder() []state.DumpAccount
AccountsInHashOrder returns all accounts of the head state, ordered by hash of address.
func (*Chain) Balance ¶
Balance returns the balance of an account at the head of the chain.
func (*Chain) CodeHashes ¶
CodeHashes returns all bytecode hashes contained in the head state.
func (*Chain) ForkID ¶
ForkID gets the fork id of the chain.
func (*Chain) GetBlock ¶
GetBlock returns the block at the specified number.
func (*Chain) GetHeaders ¶
GetHeaders returns the headers base on an ethGetPacketHeadersPacket.
func (*Chain) GetSender ¶
GetSender returns the address associated with account at the index in the pre-funded accounts list.
func (*Chain) Head ¶
Head returns the chain head.
func (*Chain) IncNonce ¶
IncNonce increases the specified signing account's pending nonce.
func (*Chain) Len ¶
Len returns the length of the chain.
func (*Chain) RootAt ¶
RootAt returns the state root for the block at the given height.
func (*Chain) Shorten ¶
Shorten returns a copy chain of a desired height from the imported
func (*Chain) SignTx ¶
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 ¶
TD calculates the total difficulty of the chain at the chain head.
type Conn ¶
Conn represents an individual connection with a peer
func (*Conn) Read ¶
Read reads a packet from the connection.
func (*Conn) ReadEth ¶
ReadEth reads an Eth sub-protocol wire message.
func (*Conn) ReadMsg ¶
ReadMsg attempts to read a devp2p message with a specific code.
func (*Conn) ReadSnap ¶
ReadSnap reads a snap/1 response with the given id from the connection.
func (*Conn) Write ¶
Write writes a eth packet to the connection.
type EngineClient ¶
type EngineClient struct {
// contains filtered or unexported fields
}
EngineClient is a wrapper around engine-related data.
func NewEngineClient ¶
func NewEngineClient(dir, url, jwt string) (*EngineClient, error)
NewEngineClient creates a new engine client.
type Hello ¶
type Hello = protoHandshake
type Proto ¶
type Proto int
Proto is an enum representing devp2p protocol types.
type Suite ¶
Suite represents a structure used to test a node's conformance to the eth protocol.
func NewSuite ¶
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 ¶
func (*Suite) SnapTests ¶
func (*Suite) TestBlobTxWithMismatchedSidecar ¶
func (*Suite) TestBlobTxWithoutSidecar ¶
func (*Suite) TestBlobViolations ¶
func (*Suite) TestGetBlockBodies ¶
func (*Suite) TestGetBlockHeaders ¶
func (*Suite) TestGetNonexistentBlockHeaders ¶
func (*Suite) TestInvalidTxs ¶
func (*Suite) TestLargeTxRequest ¶
func (*Suite) TestMaliciousHandshake ¶
func (*Suite) TestNewPooledTxs ¶
func (*Suite) TestSameRequestID ¶
func (*Suite) TestSimultaneousRequests ¶
func (*Suite) TestSnapGetAccountRange ¶
TestSnapGetAccountRange various forms of GetAccountRange requests.
func (*Suite) TestSnapGetByteCodes ¶
TestSnapGetByteCodes various forms of GetByteCodes requests.
func (*Suite) TestSnapGetStorageRanges ¶
TestSnapGetStorageRanges various forms of GetStorageRanges requests.
func (*Suite) TestSnapStatus ¶
func (*Suite) TestSnapTrieNodes ¶
TestSnapTrieNodes various forms of GetTrieNodes requests.
func (*Suite) TestStatus ¶
func (*Suite) TestTransaction ¶
func (*Suite) TestZeroRequestID ¶
Source Files ¶
chain.go conn.go engine.go protocol.go snap.go suite.go transaction.go
- Version
- v1.15.11 (latest)
- Published
- May 5, 2025
- Platform
- linux/amd64
- Imports
- 43 packages
- Last checked
- 1 day ago –
Tools for package owners.