Skip to content

Commit

Permalink
cmd/devp2p/internal/ethtest: remove even more '66'
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Jul 15, 2022
1 parent c14c717 commit fa1d37d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
6 changes: 2 additions & 4 deletions cmd/devp2p/internal/ethtest/helpers.go
Expand Up @@ -68,9 +68,7 @@ func (s *Suite) dial() (*Conn, error) {
return &conn, nil
}

// dial66 attempts to dial the given node and perform a handshake,
// returning the created Conn with additional snap/1 capabilities if
// successful.
// dialSnap creates a connection with snap/1 capability.
func (s *Suite) dialSnap() (*Conn, error) {
conn, err := s.dial()
if err != nil {
Expand Down Expand Up @@ -220,7 +218,7 @@ func (s *Suite) createSendAndRecvConns() (*Conn, *Conn, error) {
return sendConn, recvConn, nil
}

// readAndServe serves eth66 GetBlockHeaders requests while waiting
// readAndServe serves GetBlockHeaders requests while waiting
// on another message from the node.
func (c *Conn) readAndServe(chain *Chain, timeout time.Duration) Message {
start := time.Now()
Expand Down
18 changes: 7 additions & 11 deletions cmd/devp2p/internal/ethtest/suite.go
Expand Up @@ -87,7 +87,7 @@ func (s *Suite) SnapTests() []utesting.Test {
}

// TestStatus attempts to connect to the given node and exchange
// a status message with it on the eth66 protocol.
// a status message with it on the eth protocol.
func (s *Suite) TestStatus(t *utesting.T) {
conn, err := s.dial()
if err != nil {
Expand All @@ -100,7 +100,7 @@ func (s *Suite) TestStatus(t *utesting.T) {
}

// TestGetBlockHeaders tests whether the given node can respond to
// an eth66 `GetBlockHeaders` request and that the response is accurate.
// an eth `GetBlockHeaders` request and that the response is accurate.
func (s *Suite) TestGetBlockHeaders(t *utesting.T) {
conn, err := s.dial()
if err != nil {
Expand Down Expand Up @@ -309,8 +309,7 @@ func (s *Suite) TestZeroRequestID(t *utesting.T) {
}

// TestGetBlockBodies tests whether the given node can respond to
// a `GetBlockBodies` request and that the response is accurate over
// the eth66 protocol.
// a `GetBlockBodies` request and that the response is accurate.
func (s *Suite) TestGetBlockBodies(t *utesting.T) {
conn, err := s.dial()
if err != nil {
Expand Down Expand Up @@ -346,15 +345,14 @@ func (s *Suite) TestGetBlockBodies(t *utesting.T) {
}

// TestBroadcast tests whether a block announcement is correctly
// propagated to the given node's peer(s) on the eth66 protocol.
// propagated to the node's peers.
func (s *Suite) TestBroadcast(t *utesting.T) {
if err := s.sendNextBlock(); err != nil {
t.Fatalf("block broadcast failed: %v", err)
}
}

// TestLargeAnnounce tests the announcement mechanism with a large
// block over the eth66 protocol.
// TestLargeAnnounce tests the announcement mechanism with a large block.
func (s *Suite) TestLargeAnnounce(t *utesting.T) {
nextBlock := len(s.chain.blocks)
blocks := []*NewBlock{
Expand Down Expand Up @@ -400,8 +398,7 @@ func (s *Suite) TestLargeAnnounce(t *utesting.T) {
}
}

// TestOldAnnounce tests the announcement mechanism with an old block,
// over the eth66 protocol.
// TestOldAnnounce tests the announcement mechanism with an old block.
func (s *Suite) TestOldAnnounce(t *utesting.T) {
if err := s.oldAnnounce(); err != nil {
t.Fatal(err)
Expand All @@ -423,8 +420,7 @@ func (s *Suite) TestMaliciousHandshake(t *utesting.T) {
}
}

// TestMaliciousStatus sends a status package with a large total
// difficulty over the eth66 protocol.
// TestMaliciousStatus sends a status package with a large total difficulty.
func (s *Suite) TestMaliciousStatus(t *utesting.T) {
conn, err := s.dial()
if err != nil {
Expand Down

0 comments on commit fa1d37d

Please sign in to comment.