From 65f31760a7417277b52281aa83e4493e8aff67eb Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Wed, 19 Mar 2025 09:18:36 +0800 Subject: [PATCH] eth/protocols/eth: polish test --- eth/protocols/eth/handler_test.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/eth/protocols/eth/handler_test.go b/eth/protocols/eth/handler_test.go index 4d3b569d2e..36f5e90c9a 100644 --- a/eth/protocols/eth/handler_test.go +++ b/eth/protocols/eth/handler_test.go @@ -72,10 +72,7 @@ func newTestBackend(blocks int) *testBackend { // newTestBackendWithGenerator creates a chain with a number of explicitly defined blocks and // wraps it into a mock backend. -func newTestBackendWithGenerator( - blocks int, shanghai bool, cancun bool, - generator func(int, *core.BlockGen), -) *testBackend { +func newTestBackendWithGenerator(blocks int, shanghai bool, cancun bool, generator func(int, *core.BlockGen)) *testBackend { var ( // Create a database pre-initialize with a genesis block db = rawdb.NewMemoryDatabase() @@ -621,12 +618,11 @@ func testGetPooledTransaction(t *testing.T, blobTx bool) { peer, _ := newTestPeer("peer", ETH68, backend) defer peer.close() - signer := types.NewCancunSigner(params.TestChainConfig.ChainID) var ( - tx *types.Transaction - err error + tx *types.Transaction + err error + signer = types.NewCancunSigner(params.TestChainConfig.ChainID) ) - if blobTx { tx, err = types.SignNewTx(testKey, signer, &types.BlobTx{ ChainID: uint256.MustFromBig(params.TestChainConfig.ChainID),