mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
fix: fix test error
This commit is contained in:
parent
739f4ecc31
commit
266efa10fb
1 changed files with 11 additions and 9 deletions
|
|
@ -928,15 +928,17 @@ func (s *Suite) TestInvalidMetadata(t *utesting.T) {
|
|||
if err != nil && !errors.Is(err, os.ErrDeadlineExceeded) {
|
||||
t.Fatalf("unexpected err: %v", err)
|
||||
}
|
||||
switch msg := msg.(type) {
|
||||
case *eth.GetPooledTransactionsPacket:
|
||||
t.Fatalf("Transaction announcements with invalid metadata should be ignored")
|
||||
case *eth.NewPooledTransactionHashesPacket:
|
||||
return
|
||||
case *eth.TransactionsPacket:
|
||||
return
|
||||
default:
|
||||
t.Fatalf("unexpected %s", pretty.Sdump(msg))
|
||||
if err == nil {
|
||||
switch msg := msg.(type) {
|
||||
case *eth.GetPooledTransactionsPacket:
|
||||
t.Fatalf("Transaction announcements with invalid metadata should be ignored")
|
||||
case *eth.NewPooledTransactionHashesPacket:
|
||||
return
|
||||
case *eth.TransactionsPacket:
|
||||
return
|
||||
default:
|
||||
t.Fatalf("unexpected %s", pretty.Sdump(msg))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue