@@ -269,7 +269,7 @@ func InsertChainAcceptSingleBlockTest(t *testing.T, create createFunc) {
269269
270270 // This call generates a chain of 3 blocks.
271271 signer := types.HomesteadSigner {}
272- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (i int , gen * BlockGen ) {
272+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (_ int , gen * BlockGen ) {
273273 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , key1 )
274274 gen .AddTx (tx )
275275 })
@@ -340,7 +340,7 @@ func InsertLongForkedChainTest(t *testing.T, create createFunc) {
340340
341341 numBlocks := 129
342342 signer := types.HomesteadSigner {}
343- _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
343+ _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
344344 // Generate a transaction to create a unique block
345345 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , key1 )
346346 gen .AddTx (tx )
@@ -350,7 +350,7 @@ func InsertLongForkedChainTest(t *testing.T, create createFunc) {
350350 }
351351 // Generate the forked chain to be longer than the original chain to check for a regression where
352352 // a longer chain can trigger a reorg.
353- _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks + 1 , 10 , func (i int , gen * BlockGen ) {
353+ _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks + 1 , 10 , func (_ int , gen * BlockGen ) {
354354 // Generate a transaction with a different amount to ensure [chain2] is different than [chain1].
355355 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (5000 ), params .TxGas , nil , nil ), signer , key1 )
356356 gen .AddTx (tx )
@@ -506,15 +506,15 @@ func AcceptNonCanonicalBlockTest(t *testing.T, create createFunc) {
506506
507507 numBlocks := 3
508508 signer := types.HomesteadSigner {}
509- _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
509+ _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
510510 // Generate a transaction to create a unique block
511511 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , key1 )
512512 gen .AddTx (tx )
513513 })
514514 if err != nil {
515515 t .Fatal (err )
516516 }
517- _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
517+ _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
518518 // Generate a transaction with a different amount to create a chain of blocks different from [chain1]
519519 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (5000 ), params .TxGas , nil , nil ), signer , key1 )
520520 gen .AddTx (tx )
@@ -615,7 +615,7 @@ func SetPreferenceRewindTest(t *testing.T, create createFunc) {
615615
616616 numBlocks := 3
617617 signer := types.HomesteadSigner {}
618- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
618+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
619619 // Generate a transaction to create a unique block
620620 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , key1 )
621621 gen .AddTx (tx )
@@ -905,7 +905,7 @@ func EmptyBlocksTest(t *testing.T, create createFunc) {
905905 }
906906 defer blockchain .Stop ()
907907
908- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (i int , gen * BlockGen ) {})
908+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (_ int , _ * BlockGen ) {})
909909 if err != nil {
910910 t .Fatal (err )
911911 }
@@ -922,7 +922,7 @@ func EmptyBlocksTest(t *testing.T, create createFunc) {
922922 blockchain .DrainAcceptorQueue ()
923923
924924 // Nothing to assert about the state
925- checkState := func (sdb * state.StateDB ) error {
925+ checkState := func (_ * state.StateDB ) error {
926926 return nil
927927 }
928928
@@ -1023,7 +1023,7 @@ func ReorgReInsertTest(t *testing.T, create createFunc) {
10231023
10241024 signer := types.HomesteadSigner {}
10251025 numBlocks := 3
1026- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
1026+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
10271027 // Generate a transaction to create a unique block
10281028 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , key1 )
10291029 gen .AddTx (tx )
@@ -1427,7 +1427,7 @@ func GenerateChainInvalidBlockFeeTest(t *testing.T, create createFunc) {
14271427
14281428 // This call generates a chain of 3 blocks.
14291429 signer := types .LatestSigner (params .TestChainConfig )
1430- _ , _ , _ , err = GenerateChainWithGenesis (gspec , blockchain .engine , 3 , ap4 .TargetBlockRate - 1 , func (i int , gen * BlockGen ) {
1430+ _ , _ , _ , err = GenerateChainWithGenesis (gspec , blockchain .engine , 3 , ap4 .TargetBlockRate - 1 , func (_ int , gen * BlockGen ) {
14311431 tx := types .NewTx (& types.DynamicFeeTx {
14321432 ChainID : params .TestChainConfig .ChainID ,
14331433 Nonce : gen .TxNonce (addr1 ),
@@ -1469,7 +1469,7 @@ func InsertChainInvalidBlockFeeTest(t *testing.T, create createFunc) {
14691469 // This call generates a chain of 3 blocks.
14701470 signer := types .LatestSigner (params .TestChainConfig )
14711471 eng := dummy .NewFakerWithMode (TestCallbacks , dummy.Mode {ModeSkipBlockFee : true , ModeSkipCoinbase : true })
1472- _ , chain , _ , err := GenerateChainWithGenesis (gspec , eng , 3 , ap4 .TargetBlockRate - 1 , func (i int , gen * BlockGen ) {
1472+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , eng , 3 , ap4 .TargetBlockRate - 1 , func (_ int , gen * BlockGen ) {
14731473 tx := types .NewTx (& types.DynamicFeeTx {
14741474 ChainID : params .TestChainConfig .ChainID ,
14751475 Nonce : gen .TxNonce (addr1 ),
@@ -1516,7 +1516,7 @@ func InsertChainValidBlockFeeTest(t *testing.T, create createFunc) {
15161516 signer := types .LatestSigner (params .TestChainConfig )
15171517 tip := big .NewInt (50000 * params .GWei )
15181518 transfer := big .NewInt (10000 )
1519- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , ap4 .TargetBlockRate - 1 , func (i int , gen * BlockGen ) {
1519+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , ap4 .TargetBlockRate - 1 , func (_ int , gen * BlockGen ) {
15201520 feeCap := new (big.Int ).Add (gen .BaseFee (), tip )
15211521 tx := types .NewTx (& types.DynamicFeeTx {
15221522 ChainID : params .TestChainConfig .ChainID ,
@@ -1598,7 +1598,7 @@ func ReexecBlocksTest(t *testing.T, create ReexecTestFunc) {
15981598
15991599 // This call generates a chain of 10 blocks.
16001600 signer := types.HomesteadSigner {}
1601- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 10 , 10 , func (i int , gen * BlockGen ) {
1601+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 10 , 10 , func (_ int , gen * BlockGen ) {
16021602 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , key1 )
16031603 gen .AddTx (tx )
16041604 })
@@ -1732,7 +1732,7 @@ func ReexecMaxBlocksTest(t *testing.T, create ReexecTestFunc) {
17321732 numAcceptedBlocks := 2 * newCommitInterval - 1
17331733
17341734 signer := types.HomesteadSigner {}
1735- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , genNumBlocks , 10 , func (i int , gen * BlockGen ) {
1735+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , genNumBlocks , 10 , func (_ int , gen * BlockGen ) {
17361736 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), params .TxGas , nil , nil ), signer , key1 )
17371737 gen .AddTx (tx )
17381738 })
0 commit comments