{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ethtest\n\n## Types\n\n```go\ntype BlockBodies eth.BlockBodiesPacket\n```\nBlockBodies is the network packet for block content distribution.\n\n```go\nfunc (bb BlockBodies) Code() int\n```\n\n```go\ntype BlockHeaders eth.BlockHeadersPacket\n```\n\n```go\nfunc (bh BlockHeaders) Code() int\n```\n\n```go\ntype Chain struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *Chain) ForkID() forkid.ID\n```\nForkID gets the fork id of the chain.\n\n```go\nfunc (c *Chain) GetHeaders(req GetBlockHeaders) (BlockHeaders, error)\n```\n\n```go\nfunc (c *Chain) Head() *types.Block\n```\nHead returns the chain head.\n\n```go\nfunc (c *Chain) Len() int\n```\nLen returns the length of the chain.\n\n```go\nfunc (c *Chain) Shorten(height int) *Chain\n```\nShorten returns a copy chain of a desired height from the imported\n\n```go\nfunc (c *Chain) TD() *big.Int\n```\nTD calculates the total difficulty of the chain at the chain head.\n\n```go\nfunc (c *Chain) TotalDifficultyAt(height int) *big.Int\n```\nTotalDifficultyAt calculates the total difficulty of the chain at the given block height.\n\n```go\ntype Conn struct {\n\t*rlpx.Conn\n\t// contains filtered or unexported fields\n}\n```\nConn represents an individual connection with a peer\n\n```go\nfunc (c *Conn) Read() Message\n```\nRead reads an eth packet from the connection.\n\n```go\nfunc (c *Conn) Read66() (uint64, Message)\n```\nRead66 reads an eth66 packet from the connection.\n\n```go\nfunc (c *Conn) Write(msg Message) error\n```\nWrite writes a eth packet to the connection.\n\n```go\nfunc (c *Conn) Write66(req eth.Packet, code int) error\n```\nWrite66 writes an eth66 packet to the connection.\n\n```go\ntype Disconnect struct {\n\tReason p2p.DiscReason\n}\n```\nDisconnect is the RLP structure for a disconnect message.\n\n```go\nfunc (d Disconnect) Code() int\n```\n\n```go\ntype Error struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (e *Error) Code() int\n```\n\n```go\nfunc (e *Error) Error() string\n```\n\n```go\nfunc (e *Error) String() string\n```\n\n```go\nfunc (e *Error) Unwrap() error\n```\n\n```go\ntype GetBlockBodies eth.GetBlockBodiesPacket\n```\nGetBlockBodies represents a GetBlockBodies request\n\n```go\nfunc (gbb GetBlockBodies) Code() int\n```\n\n```go\ntype GetBlockHeaders eth.GetBlockHeadersPacket\n```\nGetBlockHeaders represents a block header query.\n\n```go\nfunc (g GetBlockHeaders) Code() int\n```\n\n```go\ntype GetPooledTransactions eth.GetPooledTransactionsPacket\n```\n\n```go\nfunc (gpt GetPooledTransactions) Code() int\n```\n\n```go\ntype Hello struct {\n\tVersion    uint64\n\tName       string\n\tCaps       []p2p.Cap\n\tListenPort uint64\n\tID         []byte // secp256k1 public key\n\n\t// Ignore additional fields (for forward compatibility).\n\tRest []rlp.RawValue `rlp:\"tail\"`\n}\n```\nHello is the RLP structure of the protocol handshake.\n\n```go\nfunc (h Hello) Code() int\n```\n\n```go\ntype Message interface {\n\tCode() int\n}\n```\n\n```go\ntype NewBlock eth.NewBlockPacket\n```\nNewBlock is the network packet for the block propagation message.\n\n```go\nfunc (nb NewBlock) Code() int\n```\n\n```go\ntype NewBlockHashes eth.NewBlockHashesPacket\n```\nNewBlockHashes is the network packet for the block announcements.\n\n```go\nfunc (nbh NewBlockHashes) Code() int\n```\n\n```go\ntype NewPooledTransactionHashes eth.NewPooledTransactionHashesPacket\n```\nNewPooledTransactionHashes is the network packet for the tx hash propagation message.\n\n```go\nfunc (nb NewPooledTransactionHashes) Code() int\n```\n\n```go\ntype Ping struct{}\n```\n\n```go\nfunc (p Ping) Code() int\n```\n\n```go\ntype Pong struct{}\n```\n\n```go\nfunc (p Pong) Code() int\n```\n\n```go\ntype PooledTransactions eth.PooledTransactionsPacket\n```\n\n```go\nfunc (pt PooledTransactions) Code() int\n```\n\n```go\ntype Status eth.StatusPacket\n```\nStatus is the network packet for the status message for eth/64 and later.\n\n```go\nfunc (s Status) Code() int\n```\n\n```go\ntype Suite struct {\n\tDest *enode.Node\n\t// contains filtered or unexported fields\n}\n```\nSuite represents a structure used to test a node's conformance to the eth protocol.\n\n```go\nfunc NewSuite(dest *enode.Node, chainfile string, genesisfile string) (*Suite, error)\n```\nNewSuite creates and returns a new eth-test suite that can be used to test the given node against the given blockchain data.\n\n```go\nfunc (s *Suite) AllEthTests() []utesting.Test\n```\n\n```go\nfunc (s *Suite) Eth66Tests() []utesting.Test\n```\n\n```go\nfunc (s *Suite) EthTests() []utesting.Test\n```\n\n```go\nfunc (s *Suite) Is_66(t *utesting.T)\n```\nIs\\_66 checks if the node supports the eth66 protocol version, and if not, exists the test suite\n\n```go\nfunc (s *Suite) TestBlockHashAnnounce65(t *utesting.T)\n```\nTestBlockHashAnnounce65 sends a new block hash announcement and expects the node to perform a \\`GetBlockHeaders\\` request.\n\n```go\nfunc (s *Suite) TestBlockHashAnnounce66(t *utesting.T)\n```\nTestBlockHashAnnounce66 sends a new block hash announcement and expects the node to perform a \\`GetBlockHeaders\\` request.\n\n```go\nfunc (s *Suite) TestBroadcast65(t *utesting.T)\n```\nTestBroadcast65 tests whether a block announcement is correctly propagated to the given node's peer(s).\n\n```go\nfunc (s *Suite) TestBroadcast66(t *utesting.T)\n```\nTestBroadcast66 tests whether a block announcement is correctly propagated to the given node's peer(s) on the eth66 protocol.\n\n```go\nfunc (s *Suite) TestGetBlockBodies65(t *utesting.T)\n```\nTestGetBlockBodies65 tests whether the given node can respond to a \\`GetBlockBodies\\` request and that the response is accurate.\n\n```go\nfunc (s *Suite) TestGetBlockBodies66(t *utesting.T)\n```\nTestGetBlockBodies66 tests whether the given node can respond to a \\`GetBlockBodies\\` request and that the response is accurate over the eth66 protocol.\n\n```go\nfunc (s *Suite) TestGetBlockHeaders65(t *utesting.T)\n```\nTestGetBlockHeaders65 tests whether the given node can respond to a \\`GetBlockHeaders\\` request accurately.\n\n```go\nfunc (s *Suite) TestGetBlockHeaders66(t *utesting.T)\n```\nTestGetBlockHeaders66 tests whether the given node can respond to an eth66 \\`GetBlockHeaders\\` request and that the response is accurate.\n\n```go\nfunc (s *Suite) TestLargeAnnounce65(t *utesting.T)\n```\nTestLargeAnnounce65 tests the announcement mechanism with a large block.\n\n```go\nfunc (s *Suite) TestLargeAnnounce66(t *utesting.T)\n```\nTestLargeAnnounce66 tests the announcement mechanism with a large block over the eth66 protocol.\n\n```go\nfunc (s *Suite) TestLargeTxRequest66(t *utesting.T)\n```\nTestLargeTxRequest66 tests whether a node can fulfill a large GetPooledTransactions request.\n\n```go\nfunc (s *Suite) TestMaliciousHandshake65(t *utesting.T)\n```\nTestMaliciousHandshake65 tries to send malicious data during the handshake.\n\n```go\nfunc (s *Suite) TestMaliciousHandshake66(t *utesting.T)\n```\nTestMaliciousHandshake66 tries to send malicious data during the handshake.\n\n```go\nfunc (s *Suite) TestMaliciousStatus65(t *utesting.T)\n```\nTestMaliciousStatus65 sends a status package with a large total difficulty.\n\n```go\nfunc (s *Suite) TestMaliciousStatus66(t *utesting.T)\n```\nTestMaliciousStatus66 sends a status package with a large total difficulty over the eth66 protocol.\n\n```go\nfunc (s *Suite) TestMaliciousTx65(t *utesting.T)\n```\nTestMaliciousTx65 sends several invalid transactions and tests whether the node will propagate them.\n\n```go\nfunc (s *Suite) TestMaliciousTx66(t *utesting.T)\n```\nTestMaliciousTx66 sends several invalid transactions and tests whether the node will propagate them.\n\n```go\nfunc (s *Suite) TestNewPooledTxs66(t *utesting.T)\n```\nTestNewPooledTxs\\_66 tests whether a node will do a GetPooledTransactions request upon receiving a NewPooledTransactionHashes announcement.\n\n```go\nfunc (s *Suite) TestOldAnnounce65(t *utesting.T)\n```\nTestOldAnnounce65 tests the announcement mechanism with an old block.\n\n```go\nfunc (s *Suite) TestOldAnnounce66(t *utesting.T)\n```\nTestOldAnnounce66 tests the announcement mechanism with an old block, over the eth66 protocol.\n\n```go\nfunc (s *Suite) TestSameRequestID66(t *utesting.T)\n```\nTestSameRequestID66 sends two requests with the same request ID to a single node.\n\n```go\nfunc (s *Suite) TestSimultaneousRequests66(t *utesting.T)\n```\nTestSimultaneousRequests66 sends two simultaneous \\`GetBlockHeader\\` requests from the same connection with different request IDs and checks to make sure the node responds with the correct headers per request.\n\n```go\nfunc (s *Suite) TestStatus65(t *utesting.T)\n```\nTestStatus65 attempts to connect to the given node and exchange a status message with it.\n\n```go\nfunc (s *Suite) TestStatus66(t *utesting.T)\n```\nTestStatus66 attempts to connect to the given node and exchange a status message with it on the eth66 protocol.\n\n```go\nfunc (s *Suite) TestTransaction65(t *utesting.T)\n```\nTestTransaction65 sends a valid transaction to the node and checks if the transaction gets propagated.\n\n```go\nfunc (s *Suite) TestTransaction66(t *utesting.T)\n```\nTestTransaction66 sends a valid transaction to the node and checks if the transaction gets propagated.\n\n```go\nfunc (s *Suite) TestZeroRequestID66(t *utesting.T)\n```\nTestZeroRequestID\\_66 checks that a message with a request ID of zero is still handled by the node.\n\n```go\ntype Transactions eth.TransactionsPacket\n```\n\n```go\nfunc (t Transactions) Code() int\n```\n\n","path":"github.com/Evolution404/simcore/cmd/devp2p/internal/ethtest","name":"ethtest","synopsis":"","isRedistributable":true}
