@@ -569,11 +569,11 @@ func testInsertNonceError(t *testing.T, full bool) {
569569func TestFastVsFullChains (t * testing.T ) {
570570 // Configure and generate a sample block chain
571571 var (
572- gendb , _ = ethdb .NewMemDatabase ()
573- key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
574- address = crypto .PubkeyToAddress (key .PublicKey )
575- funds = big .NewInt (1000000000 )
576- gspec = & Genesis {
572+ gendb = ethdb .NewMemDatabase ()
573+ key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
574+ address = crypto .PubkeyToAddress (key .PublicKey )
575+ funds = big .NewInt (1000000000 )
576+ gspec = & Genesis {
577577 Config : params .TestChainConfig ,
578578 Alloc : GenesisAlloc {address : {Balance : funds }},
579579 }
@@ -599,7 +599,7 @@ func TestFastVsFullChains(t *testing.T) {
599599 }
600600 })
601601 // Import the chain as an archive node for the comparison baseline
602- archiveDb , _ := ethdb .NewMemDatabase ()
602+ archiveDb := ethdb .NewMemDatabase ()
603603 gspec .MustCommit (archiveDb )
604604 archive , _ := NewBlockChain (archiveDb , nil , gspec .Config , ethash .NewFaker (), vm.Config {})
605605 defer archive .Stop ()
@@ -608,7 +608,7 @@ func TestFastVsFullChains(t *testing.T) {
608608 t .Fatalf ("failed to process block %d: %v" , n , err )
609609 }
610610 // Fast import the chain as a non-archive node to test
611- fastDb , _ := ethdb .NewMemDatabase ()
611+ fastDb := ethdb .NewMemDatabase ()
612612 gspec .MustCommit (fastDb )
613613 fast , _ := NewBlockChain (fastDb , nil , gspec .Config , ethash .NewFaker (), vm.Config {})
614614 defer fast .Stop ()
@@ -657,12 +657,12 @@ func TestFastVsFullChains(t *testing.T) {
657657func TestLightVsFastVsFullChainHeads (t * testing.T ) {
658658 // Configure and generate a sample block chain
659659 var (
660- gendb , _ = ethdb .NewMemDatabase ()
661- key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
662- address = crypto .PubkeyToAddress (key .PublicKey )
663- funds = big .NewInt (1000000000 )
664- gspec = & Genesis {Config : params .TestChainConfig , Alloc : GenesisAlloc {address : {Balance : funds }}}
665- genesis = gspec .MustCommit (gendb )
660+ gendb = ethdb .NewMemDatabase ()
661+ key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
662+ address = crypto .PubkeyToAddress (key .PublicKey )
663+ funds = big .NewInt (1000000000 )
664+ gspec = & Genesis {Config : params .TestChainConfig , Alloc : GenesisAlloc {address : {Balance : funds }}}
665+ genesis = gspec .MustCommit (gendb )
666666 )
667667 height := uint64 (1024 )
668668 blocks , receipts := GenerateChain (gspec .Config , genesis , ethash .NewFaker (), gendb , int (height ), nil )
@@ -685,7 +685,7 @@ func TestLightVsFastVsFullChainHeads(t *testing.T) {
685685 }
686686 }
687687 // Import the chain as an archive node and ensure all pointers are updated
688- archiveDb , _ := ethdb .NewMemDatabase ()
688+ archiveDb := ethdb .NewMemDatabase ()
689689 gspec .MustCommit (archiveDb )
690690
691691 archive , _ := NewBlockChain (archiveDb , nil , gspec .Config , ethash .NewFaker (), vm.Config {})
@@ -699,7 +699,7 @@ func TestLightVsFastVsFullChainHeads(t *testing.T) {
699699 assert (t , "archive" , archive , height / 2 , height / 2 , height / 2 )
700700
701701 // Import the chain as a non-archive node and ensure all pointers are updated
702- fastDb , _ := ethdb .NewMemDatabase ()
702+ fastDb := ethdb .NewMemDatabase ()
703703 gspec .MustCommit (fastDb )
704704 fast , _ := NewBlockChain (fastDb , nil , gspec .Config , ethash .NewFaker (), vm.Config {})
705705 defer fast .Stop ()
@@ -719,7 +719,7 @@ func TestLightVsFastVsFullChainHeads(t *testing.T) {
719719 assert (t , "fast" , fast , height / 2 , height / 2 , 0 )
720720
721721 // Import the chain as a light node and ensure all pointers are updated
722- lightDb , _ := ethdb .NewMemDatabase ()
722+ lightDb := ethdb .NewMemDatabase ()
723723 gspec .MustCommit (lightDb )
724724
725725 light , _ := NewBlockChain (lightDb , nil , gspec .Config , ethash .NewFaker (), vm.Config {})
@@ -742,7 +742,7 @@ func TestChainTxReorgs(t *testing.T) {
742742 addr1 = crypto .PubkeyToAddress (key1 .PublicKey )
743743 addr2 = crypto .PubkeyToAddress (key2 .PublicKey )
744744 addr3 = crypto .PubkeyToAddress (key3 .PublicKey )
745- db , _ = ethdb .NewMemDatabase ()
745+ db = ethdb .NewMemDatabase ()
746746 gspec = & Genesis {
747747 Config : params .TestChainConfig ,
748748 GasLimit : 3141592 ,
@@ -854,7 +854,7 @@ func TestLogReorgs(t *testing.T) {
854854 var (
855855 key1 , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
856856 addr1 = crypto .PubkeyToAddress (key1 .PublicKey )
857- db , _ = ethdb .NewMemDatabase ()
857+ db = ethdb .NewMemDatabase ()
858858 // this code generates a log
859859 code = common .Hex2Bytes ("60606040525b7f24ec1d3ff24c2f6ff210738839dbc339cd45a5294d85c79361016243157aae7b60405180905060405180910390a15b600a8060416000396000f360606040526008565b00" )
860860 gspec = & Genesis {Config : params .TestChainConfig , Alloc : GenesisAlloc {addr1 : {Balance : big .NewInt (10000000000000 )}}}
@@ -898,7 +898,7 @@ func TestLogReorgs(t *testing.T) {
898898
899899func TestReorgSideEvent (t * testing.T ) {
900900 var (
901- db , _ = ethdb .NewMemDatabase ()
901+ db = ethdb .NewMemDatabase ()
902902 key1 , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
903903 addr1 = crypto .PubkeyToAddress (key1 .PublicKey )
904904 gspec = & Genesis {
@@ -1026,7 +1026,7 @@ func TestCanonicalBlockRetrieval(t *testing.T) {
10261026func TestEIP155Transition (t * testing.T ) {
10271027 // Configure and generate a sample block chain
10281028 var (
1029- db , _ = ethdb .NewMemDatabase ()
1029+ db = ethdb .NewMemDatabase ()
10301030 key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
10311031 address = crypto .PubkeyToAddress (key .PublicKey )
10321032 funds = big .NewInt (1000000000 )
@@ -1130,7 +1130,7 @@ func TestEIP155Transition(t *testing.T) {
11301130func TestEIP161AccountRemoval (t * testing.T ) {
11311131 // Configure and generate a sample block chain
11321132 var (
1133- db , _ = ethdb .NewMemDatabase ()
1133+ db = ethdb .NewMemDatabase ()
11341134 key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
11351135 address = crypto .PubkeyToAddress (key .PublicKey )
11361136 funds = big .NewInt (1000000000 )
@@ -1202,7 +1202,7 @@ func TestBlockchainHeaderchainReorgConsistency(t *testing.T) {
12021202 // Generate a canonical chain to act as the main dataset
12031203 engine := ethash .NewFaker ()
12041204
1205- db , _ := ethdb .NewMemDatabase ()
1205+ db := ethdb .NewMemDatabase ()
12061206 genesis := new (Genesis ).MustCommit (db )
12071207 blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 64 , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {1 }) })
12081208
@@ -1218,7 +1218,7 @@ func TestBlockchainHeaderchainReorgConsistency(t *testing.T) {
12181218 }
12191219 // Import the canonical and fork chain side by side, verifying the current block
12201220 // and current header consistency
1221- diskdb , _ := ethdb .NewMemDatabase ()
1221+ diskdb := ethdb .NewMemDatabase ()
12221222 new (Genesis ).MustCommit (diskdb )
12231223
12241224 chain , err := NewBlockChain (diskdb , nil , params .TestChainConfig , engine , vm.Config {})
@@ -1247,7 +1247,7 @@ func TestTrieForkGC(t *testing.T) {
12471247 // Generate a canonical chain to act as the main dataset
12481248 engine := ethash .NewFaker ()
12491249
1250- db , _ := ethdb .NewMemDatabase ()
1250+ db := ethdb .NewMemDatabase ()
12511251 genesis := new (Genesis ).MustCommit (db )
12521252 blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 2 * triesInMemory , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {1 }) })
12531253
@@ -1262,7 +1262,7 @@ func TestTrieForkGC(t *testing.T) {
12621262 forks [i ] = fork [0 ]
12631263 }
12641264 // Import the canonical and fork chain side by side, forcing the trie cache to cache both
1265- diskdb , _ := ethdb .NewMemDatabase ()
1265+ diskdb := ethdb .NewMemDatabase ()
12661266 new (Genesis ).MustCommit (diskdb )
12671267
12681268 chain , err := NewBlockChain (diskdb , nil , params .TestChainConfig , engine , vm.Config {})
@@ -1293,15 +1293,15 @@ func TestLargeReorgTrieGC(t *testing.T) {
12931293 // Generate the original common chain segment and the two competing forks
12941294 engine := ethash .NewFaker ()
12951295
1296- db , _ := ethdb .NewMemDatabase ()
1296+ db := ethdb .NewMemDatabase ()
12971297 genesis := new (Genesis ).MustCommit (db )
12981298
12991299 shared , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 64 , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {1 }) })
13001300 original , _ := GenerateChain (params .TestChainConfig , shared [len (shared )- 1 ], engine , db , 2 * triesInMemory , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {2 }) })
13011301 competitor , _ := GenerateChain (params .TestChainConfig , shared [len (shared )- 1 ], engine , db , 2 * triesInMemory + 1 , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {3 }) })
13021302
13031303 // Import the shared chain and the original canonical one
1304- diskdb , _ := ethdb .NewMemDatabase ()
1304+ diskdb := ethdb .NewMemDatabase ()
13051305 new (Genesis ).MustCommit (diskdb )
13061306
13071307 chain , err := NewBlockChain (diskdb , nil , params .TestChainConfig , engine , vm.Config {})
@@ -1361,7 +1361,7 @@ func benchmarkLargeNumberOfValueToNonexisting(b *testing.B, numTxs, numBlocks in
13611361 )
13621362 // Generate the original common chain segment and the two competing forks
13631363 engine := ethash .NewFaker ()
1364- db , _ := ethdb .NewMemDatabase ()
1364+ db := ethdb .NewMemDatabase ()
13651365 genesis := gspec .MustCommit (db )
13661366
13671367 blockGenerator := func (i int , block * BlockGen ) {
@@ -1383,7 +1383,7 @@ func benchmarkLargeNumberOfValueToNonexisting(b *testing.B, numTxs, numBlocks in
13831383 b .ResetTimer ()
13841384 for i := 0 ; i < b .N ; i ++ {
13851385 // Import the shared chain and the original canonical one
1386- diskdb , _ := ethdb .NewMemDatabase ()
1386+ diskdb := ethdb .NewMemDatabase ()
13871387 gspec .MustCommit (diskdb )
13881388
13891389 chain , err := NewBlockChain (diskdb , nil , params .TestChainConfig , engine , vm.Config {})
0 commit comments