@@ -246,7 +246,7 @@ func InsertChainAcceptSingleBlock(t *testing.T, create createFunc) {
246246
247247 // This call generates a chain of 3 blocks.
248248 signer := types.HomesteadSigner {}
249- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (i int , gen * BlockGen ) {
249+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (_ int , gen * BlockGen ) {
250250 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), ethparams .TxGas , nil , nil ), signer , key1 )
251251 gen .AddTx (tx )
252252 })
@@ -317,7 +317,7 @@ func InsertLongForkedChain(t *testing.T, create createFunc) {
317317
318318 numBlocks := 129
319319 signer := types.HomesteadSigner {}
320- _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
320+ _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
321321 // Generate a transaction to create a unique block
322322 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), ethparams .TxGas , nil , nil ), signer , key1 )
323323 gen .AddTx (tx )
@@ -327,7 +327,7 @@ func InsertLongForkedChain(t *testing.T, create createFunc) {
327327 }
328328 // Generate the forked chain to be longer than the original chain to check for a regression where
329329 // a longer chain can trigger a reorg.
330- _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks + 1 , 10 , func (i int , gen * BlockGen ) {
330+ _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks + 1 , 10 , func (_ int , gen * BlockGen ) {
331331 // Generate a transaction with a different amount to ensure [chain2] is different than [chain1].
332332 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (5000 ), ethparams .TxGas , nil , nil ), signer , key1 )
333333 gen .AddTx (tx )
@@ -481,15 +481,15 @@ func AcceptNonCanonicalBlock(t *testing.T, create createFunc) {
481481
482482 numBlocks := 3
483483 signer := types.HomesteadSigner {}
484- _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
484+ _ , chain1 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
485485 // Generate a transaction to create a unique block
486486 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), ethparams .TxGas , nil , nil ), signer , key1 )
487487 gen .AddTx (tx )
488488 })
489489 if err != nil {
490490 t .Fatal (err )
491491 }
492- _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
492+ _ , chain2 , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
493493 // Generate a transaction with a different amount to create a chain of blocks different from [chain1]
494494 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (5000 ), ethparams .TxGas , nil , nil ), signer , key1 )
495495 gen .AddTx (tx )
@@ -590,7 +590,7 @@ func SetPreferenceRewind(t *testing.T, create createFunc) {
590590
591591 numBlocks := 3
592592 signer := types.HomesteadSigner {}
593- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
593+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
594594 // Generate a transaction to create a unique block
595595 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), ethparams .TxGas , nil , nil ), signer , key1 )
596596 gen .AddTx (tx )
@@ -879,7 +879,7 @@ func EmptyBlocks(t *testing.T, create createFunc) {
879879 }
880880 defer blockchain .Stop ()
881881
882- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (i int , gen * BlockGen ) {})
882+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , 10 , func (int , * BlockGen ) {})
883883 if err != nil {
884884 t .Fatal (err )
885885 }
@@ -896,7 +896,7 @@ func EmptyBlocks(t *testing.T, create createFunc) {
896896 blockchain .DrainAcceptorQueue ()
897897
898898 // Nothing to assert about the state
899- checkState := func (sdb * state.StateDB ) error {
899+ checkState := func (* state.StateDB ) error {
900900 return nil
901901 }
902902
@@ -997,7 +997,7 @@ func ReorgReInsert(t *testing.T, create createFunc) {
997997
998998 signer := types.HomesteadSigner {}
999999 numBlocks := 3
1000- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (i int , gen * BlockGen ) {
1000+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , numBlocks , 10 , func (_ int , gen * BlockGen ) {
10011001 // Generate a transaction to create a unique block
10021002 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), ethparams .TxGas , nil , nil ), signer , key1 )
10031003 gen .AddTx (tx )
@@ -1400,7 +1400,7 @@ func GenerateChainInvalidBlockFee(t *testing.T, create createFunc) {
14001400
14011401 // This call generates a chain of 3 blocks.
14021402 signer := types .LatestSigner (params .TestChainConfig )
1403- _ , _ , _ , err = GenerateChainWithGenesis (gspec , blockchain .engine , 3 , extras .TestChainConfig .FeeConfig .TargetBlockRate - 1 , func (i int , gen * BlockGen ) {
1403+ _ , _ , _ , err = GenerateChainWithGenesis (gspec , blockchain .engine , 3 , extras .TestChainConfig .FeeConfig .TargetBlockRate - 1 , func (_ int , gen * BlockGen ) {
14041404 tx := types .NewTx (& types.DynamicFeeTx {
14051405 ChainID : params .TestChainConfig .ChainID ,
14061406 Nonce : gen .TxNonce (addr1 ),
@@ -1442,7 +1442,7 @@ func InsertChainInvalidBlockFee(t *testing.T, create createFunc) {
14421442 // This call generates a chain of 3 blocks.
14431443 signer := types .LatestSigner (params .TestChainConfig )
14441444 eng := dummy .NewFakerWithMode (dummy.Mode {ModeSkipBlockFee : true , ModeSkipCoinbase : true })
1445- _ , chain , _ , err := GenerateChainWithGenesis (gspec , eng , 3 , extras .TestChainConfig .FeeConfig .TargetBlockRate - 1 , func (i int , gen * BlockGen ) {
1445+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , eng , 3 , extras .TestChainConfig .FeeConfig .TargetBlockRate - 1 , func (_ int , gen * BlockGen ) {
14461446 tx := types .NewTx (& types.DynamicFeeTx {
14471447 ChainID : params .TestChainConfig .ChainID ,
14481448 Nonce : gen .TxNonce (addr1 ),
@@ -1487,7 +1487,7 @@ func InsertChainValidBlockFee(t *testing.T, create createFunc) {
14871487 signer := types .LatestSigner (params .TestChainConfig )
14881488 tip := big .NewInt (50000 * params .GWei )
14891489 transfer := big .NewInt (10000 )
1490- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , extras .TestChainConfig .FeeConfig .TargetBlockRate - 1 , func (i int , gen * BlockGen ) {
1490+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 3 , extras .TestChainConfig .FeeConfig .TargetBlockRate - 1 , func (_ int , gen * BlockGen ) {
14911491 feeCap := new (big.Int ).Add (gen .BaseFee (), tip )
14921492 tx := types .NewTx (& types.DynamicFeeTx {
14931493 ChainID : params .TestChainConfig .ChainID ,
@@ -1692,7 +1692,7 @@ func StatefulPrecompiles(t *testing.T, create createFunc) {
16921692
16931693 // Generate chain of blocks using [genDB] instead of [chainDB] to avoid writing
16941694 // to the BlockChain's database while generating blocks.
1695- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 1 , 0 , func (i int , gen * BlockGen ) {
1695+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 1 , 0 , func (_ int , gen * BlockGen ) {
16961696 for _ , test := range tests {
16971697 test .addTx (gen )
16981698 }
@@ -1759,7 +1759,7 @@ func ReexecBlocks(t *testing.T, create ReexecTestFunc) {
17591759
17601760 // This call generates a chain of 10 blocks.
17611761 signer := types.HomesteadSigner {}
1762- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 10 , 10 , func (i int , gen * BlockGen ) {
1762+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , 10 , 10 , func (_ int , gen * BlockGen ) {
17631763 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), ethparams .TxGas , nil , nil ), signer , key1 )
17641764 gen .AddTx (tx )
17651765 })
@@ -1893,7 +1893,7 @@ func ReexecMaxBlocks(t *testing.T, create ReexecTestFunc) {
18931893 numAcceptedBlocks := 2 * newCommitInterval - 1
18941894
18951895 signer := types.HomesteadSigner {}
1896- _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , genNumBlocks , 10 , func (i int , gen * BlockGen ) {
1896+ _ , chain , _ , err := GenerateChainWithGenesis (gspec , blockchain .engine , genNumBlocks , 10 , func (_ int , gen * BlockGen ) {
18971897 tx , _ := types .SignTx (types .NewTransaction (gen .TxNonce (addr1 ), addr2 , big .NewInt (10000 ), ethparams .TxGas , nil , nil ), signer , key1 )
18981898 gen .AddTx (tx )
18991899 })
0 commit comments