From f770ec1ffcbd3afc08aa8959abba100f3f11fcce Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 20 Sep 2025 07:20:44 +0800 Subject: [PATCH] common, eth: remove duplicate test cases (#32624) Remove redundant duplicate test vectors. The two entries were identical and back-to-back, providing no additional coverage while adding noise. Keeping a single instance maintains test intent and clarity without altering behavior. --- common/hexutil/json_test.go | 1 - eth/protocols/snap/gentrie_test.go | 2 -- eth/protocols/snap/sync_test.go | 1 - 3 files changed, 4 deletions(-) diff --git a/common/hexutil/json_test.go b/common/hexutil/json_test.go index a014438458..3dc19680f9 100644 --- a/common/hexutil/json_test.go +++ b/common/hexutil/json_test.go @@ -408,7 +408,6 @@ func TestUnmarshalFixedUnprefixedText(t *testing.T) { {input: "0x2", wantErr: ErrOddLength}, {input: "2", wantErr: ErrOddLength}, {input: "4444", wantErr: errors.New("hex string has length 4, want 8 for x")}, - {input: "4444", wantErr: errors.New("hex string has length 4, want 8 for x")}, // check that output is not modified for partially correct input {input: "444444gg", wantErr: ErrSyntax, want: []byte{0, 0, 0, 0}}, {input: "0x444444gg", wantErr: ErrSyntax, want: []byte{0, 0, 0, 0}}, diff --git a/eth/protocols/snap/gentrie_test.go b/eth/protocols/snap/gentrie_test.go index 2da4f3c866..5998840b52 100644 --- a/eth/protocols/snap/gentrie_test.go +++ b/eth/protocols/snap/gentrie_test.go @@ -239,7 +239,6 @@ func TestPartialGentree(t *testing.T) { {1, len(entries) - 1}, // no left {2, len(entries) - 1}, // no left {2, len(entries) - 2}, // no left and right - {2, len(entries) - 2}, // no left and right {len(entries) / 2, len(entries) / 2}, // single {0, 0}, // single first {len(entries) - 1, len(entries) - 1}, // single last @@ -348,7 +347,6 @@ func TestGentreeDanglingClearing(t *testing.T) { {1, len(entries) - 1}, // no left {2, len(entries) - 1}, // no left {2, len(entries) - 2}, // no left and right - {2, len(entries) - 2}, // no left and right {len(entries) / 2, len(entries) / 2}, // single {0, 0}, // single first {len(entries) - 1, len(entries) - 1}, // single last diff --git a/eth/protocols/snap/sync_test.go b/eth/protocols/snap/sync_test.go index 89a782496f..713b358ff8 100644 --- a/eth/protocols/snap/sync_test.go +++ b/eth/protocols/snap/sync_test.go @@ -597,7 +597,6 @@ func testSyncBloatedProof(t *testing.T, scheme string) { proof := trienode.NewProofSet() if err := t.accountTrie.Prove(origin[:], proof); err != nil { t.logger.Error("Could not prove origin", "origin", origin, "error", err) - t.logger.Error("Could not prove origin", "origin", origin, "error", err) } // The bloat: add proof of every single element for _, entry := range t.accountValues {