Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/devp2p/internal/ethtest: update tests for eth/67 #25306

Merged
merged 7 commits into from
Aug 2, 2022
Prev Previous commit
Next Next commit
cmd/devp2p/internal/ethtest: remove unused getBlockHeaders66
fjl committed Jul 15, 2022
commit 3ccd7968cd8d916b098ba9987a53274962aba21d
16 changes: 0 additions & 16 deletions cmd/devp2p/internal/ethtest/helpers.go
Original file line number Diff line number Diff line change
@@ -280,22 +280,6 @@ func (c *Conn) snapRequest(msg Message, id uint64, chain *Chain) (Message, error
return c.ReadSnap(id)
}

// getBlockHeaders66 executes the given `GetBlockHeaders` request over the eth66 protocol.
func getBlockHeaders66(chain *Chain, conn *Conn, request *GetBlockHeaders, id uint64) ([]*types.Header, error) {
request.RequestId = id
if err := conn.Write(request); err != nil {
return nil, fmt.Errorf("could not write to connection: %v", err)
}
// wait for response
msg := conn.waitForResponse(chain, timeout, request.RequestId)
resp, ok := msg.(*BlockHeaders)
if !ok {
return nil, fmt.Errorf("unexpected message received: %s", pretty.Sdump(msg))
}
headers := []*types.Header(resp.BlockHeadersPacket)
return headers, nil
}

// headersMatch returns whether the received headers match the given request
func headersMatch(expected []*types.Header, headers []*types.Header) bool {
return reflect.DeepEqual(expected, headers)