@@ -1534,7 +1534,7 @@ func TestTrieForkGC(t *testing.T) {
15341534
15351535 db := rawdb .NewMemoryDatabase ()
15361536 genesis := new (Genesis ).MustCommit (db )
1537- blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 2 * triesInMemory , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {1 }) })
1537+ blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 2 * TriesInMemory , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {1 }) })
15381538
15391539 // Generate a bunch of fork blocks, each side forking from the canonical chain
15401540 forks := make ([]* types.Block , len (blocks ))
@@ -1563,7 +1563,7 @@ func TestTrieForkGC(t *testing.T) {
15631563 }
15641564 }
15651565 // Dereference all the recent tries and ensure no past trie is left in
1566- for i := 0 ; i < triesInMemory ; i ++ {
1566+ for i := 0 ; i < TriesInMemory ; i ++ {
15671567 chain .stateCache .TrieDB ().Dereference (blocks [len (blocks )- 1 - i ].Root ())
15681568 chain .stateCache .TrieDB ().Dereference (forks [len (blocks )- 1 - i ].Root ())
15691569 }
@@ -1582,8 +1582,8 @@ func TestLargeReorgTrieGC(t *testing.T) {
15821582 genesis := new (Genesis ).MustCommit (db )
15831583
15841584 shared , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 64 , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {1 }) })
1585- original , _ := GenerateChain (params .TestChainConfig , shared [len (shared )- 1 ], engine , db , 2 * triesInMemory , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {2 }) })
1586- competitor , _ := GenerateChain (params .TestChainConfig , shared [len (shared )- 1 ], engine , db , 2 * triesInMemory + 1 , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {3 }) })
1585+ original , _ := GenerateChain (params .TestChainConfig , shared [len (shared )- 1 ], engine , db , 2 * TriesInMemory , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {2 }) })
1586+ competitor , _ := GenerateChain (params .TestChainConfig , shared [len (shared )- 1 ], engine , db , 2 * TriesInMemory + 1 , func (i int , b * BlockGen ) { b .SetCoinbase (common.Address {3 }) })
15871587
15881588 // Import the shared chain and the original canonical one
15891589 diskdb := rawdb .NewMemoryDatabase ()
@@ -1618,7 +1618,7 @@ func TestLargeReorgTrieGC(t *testing.T) {
16181618 if _ , err := chain .InsertChain (competitor [len (competitor )- 2 :]); err != nil {
16191619 t .Fatalf ("failed to finalize competitor chain: %v" , err )
16201620 }
1621- for i , block := range competitor [:len (competitor )- triesInMemory ] {
1621+ for i , block := range competitor [:len (competitor )- TriesInMemory ] {
16221622 if node , _ := chain .stateCache .TrieDB ().Node (block .Root ()); node != nil {
16231623 t .Fatalf ("competitor %d: competing chain state missing" , i )
16241624 }
@@ -1753,7 +1753,7 @@ func TestLowDiffLongChain(t *testing.T) {
17531753
17541754 // We must use a pretty long chain to ensure that the fork doesn't overtake us
17551755 // until after at least 128 blocks post tip
1756- blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 6 * triesInMemory , func (i int , b * BlockGen ) {
1756+ blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 6 * TriesInMemory , func (i int , b * BlockGen ) {
17571757 b .SetCoinbase (common.Address {1 })
17581758 b .OffsetTime (- 9 )
17591759 })
@@ -1771,7 +1771,7 @@ func TestLowDiffLongChain(t *testing.T) {
17711771 }
17721772 // Generate fork chain, starting from an early block
17731773 parent := blocks [10 ]
1774- fork , _ := GenerateChain (params .TestChainConfig , parent , engine , db , 8 * triesInMemory , func (i int , b * BlockGen ) {
1774+ fork , _ := GenerateChain (params .TestChainConfig , parent , engine , db , 8 * TriesInMemory , func (i int , b * BlockGen ) {
17751775 b .SetCoinbase (common.Address {2 })
17761776 })
17771777
@@ -1806,7 +1806,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
18061806 genesis := new (Genesis ).MustCommit (db )
18071807
18081808 // Generate and import the canonical chain
1809- blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 2 * triesInMemory , nil )
1809+ blocks , _ := GenerateChain (params .TestChainConfig , genesis , engine , db , 2 * TriesInMemory , nil )
18101810 diskdb := rawdb .NewMemoryDatabase ()
18111811 new (Genesis ).MustCommit (diskdb )
18121812 chain , err := NewBlockChain (diskdb , nil , params .TestChainConfig , engine , vm.Config {}, nil )
@@ -1817,9 +1817,9 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
18171817 t .Fatalf ("block %d: failed to insert into chain: %v" , n , err )
18181818 }
18191819
1820- lastPrunedIndex := len (blocks ) - triesInMemory - 1
1820+ lastPrunedIndex := len (blocks ) - TriesInMemory - 1
18211821 lastPrunedBlock := blocks [lastPrunedIndex ]
1822- firstNonPrunedBlock := blocks [len (blocks )- triesInMemory ]
1822+ firstNonPrunedBlock := blocks [len (blocks )- TriesInMemory ]
18231823
18241824 // Verify pruning of lastPrunedBlock
18251825 if chain .HasBlockAndState (lastPrunedBlock .Hash (), lastPrunedBlock .NumberU64 ()) {
@@ -1836,7 +1836,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
18361836 // Generate fork chain, make it longer than canon
18371837 parentIndex := lastPrunedIndex + blocksBetweenCommonAncestorAndPruneblock
18381838 parent := blocks [parentIndex ]
1839- fork , _ := GenerateChain (params .TestChainConfig , parent , engine , db , 2 * triesInMemory , func (i int , b * BlockGen ) {
1839+ fork , _ := GenerateChain (params .TestChainConfig , parent , engine , db , 2 * TriesInMemory , func (i int , b * BlockGen ) {
18401840 b .SetCoinbase (common.Address {2 })
18411841 })
18421842 // Prepend the parent(s)
0 commit comments