cmd/devp2p/internal/ethtest: use shared message types (#22315)

This updates the eth protocol test suite to use the message type
definitions of the 'production' protocol implementation in eth/protocols/eth.
This commit is contained in:
rene
2021-02-16 15:23:03 +01:00
committed by GitHub
parent 6291fc9230
commit f9445e93bb
4 changed files with 36 additions and 84 deletions

View File

@ -21,6 +21,7 @@ import (
"strconv"
"testing"
"github.com/ethereum/go-ethereum/eth/protocols/eth"
"github.com/ethereum/go-ethereum/p2p"
"github.com/stretchr/testify/assert"
)
@ -93,7 +94,7 @@ func TestChain_GetHeaders(t *testing.T) {
}{
{
req: GetBlockHeaders{
Origin: hashOrNumber{
Origin: eth.HashOrNumber{
Number: uint64(2),
},
Amount: uint64(5),
@ -110,7 +111,7 @@ func TestChain_GetHeaders(t *testing.T) {
},
{
req: GetBlockHeaders{
Origin: hashOrNumber{
Origin: eth.HashOrNumber{
Number: uint64(chain.Len() - 1),
},
Amount: uint64(3),
@ -125,7 +126,7 @@ func TestChain_GetHeaders(t *testing.T) {
},
{
req: GetBlockHeaders{
Origin: hashOrNumber{
Origin: eth.HashOrNumber{
Hash: chain.Head().Hash(),
},
Amount: uint64(1),