@@ -125,7 +125,7 @@ type tester struct {
125125 snapStorages map [common.Hash ]map [common.Hash ]map [common.Hash ][]byte // Keyed by the hash of account address and the hash of storage key
126126}
127127
128- func newTester (t * testing.T , historyLimit uint64 , isVerkle bool , layers int , enableIndex bool , journal string ) * tester {
128+ func newTester (t * testing.T , historyLimit uint64 , isVerkle bool , layers int , enableIndex bool , journalDir string ) * tester {
129129 var (
130130 disk , _ = rawdb .Open (rawdb .NewMemoryDatabase (), rawdb.OpenOptions {Ancient : t .TempDir ()})
131131 db = New (disk , & Config {
@@ -135,7 +135,7 @@ func newTester(t *testing.T, historyLimit uint64, isVerkle bool, layers int, ena
135135 StateCleanSize : 256 * 1024 ,
136136 WriteBufferSize : 256 * 1024 ,
137137 NoAsyncFlush : true ,
138- JournalPath : journal ,
138+ JournalDirectory : journalDir ,
139139 }, isVerkle )
140140
141141 obj = & tester {
@@ -619,14 +619,14 @@ func TestJournal(t *testing.T) {
619619 testJournal (t , filepath .Join (t .TempDir (), strconv .Itoa (rand .Intn (10000 ))))
620620}
621621
622- func testJournal (t * testing.T , journal string ) {
622+ func testJournal (t * testing.T , journalDir string ) {
623623 // Redefine the diff layer depth allowance for faster testing.
624624 maxDiffLayers = 4
625625 defer func () {
626626 maxDiffLayers = 128
627627 }()
628628
629- tester := newTester (t , 0 , false , 12 , false , journal )
629+ tester := newTester (t , 0 , false , 12 , false , journalDir )
630630 defer tester .release ()
631631
632632 if err := tester .db .Journal (tester .lastHash ()); err != nil {
@@ -657,23 +657,23 @@ func TestCorruptedJournal(t *testing.T) {
657657 rawdb .WriteTrieJournal (db , blob )
658658 })
659659
660- path := filepath .Join (t .TempDir (), strconv .Itoa (rand .Intn (10000 )))
661- testCorruptedJournal (t , path , func (_ ethdb.Database ) {
662- f , _ := os .OpenFile (path , os .O_WRONLY , 0644 )
660+ directory := filepath .Join (t .TempDir (), strconv .Itoa (rand .Intn (10000 )))
661+ testCorruptedJournal (t , directory , func (_ ethdb.Database ) {
662+ f , _ := os .OpenFile (filepath . Join ( directory , "merkle.journal" ) , os .O_WRONLY , 0644 )
663663 f .WriteAt ([]byte {0xa }, 0 )
664664 f .Sync ()
665665 f .Close ()
666666 })
667667}
668668
669- func testCorruptedJournal (t * testing.T , journal string , modifyFn func (database ethdb.Database )) {
669+ func testCorruptedJournal (t * testing.T , journalDir string , modifyFn func (database ethdb.Database )) {
670670 // Redefine the diff layer depth allowance for faster testing.
671671 maxDiffLayers = 4
672672 defer func () {
673673 maxDiffLayers = 128
674674 }()
675675
676- tester := newTester (t , 0 , false , 12 , false , journal )
676+ tester := newTester (t , 0 , false , 12 , false , journalDir )
677677 defer tester .release ()
678678
679679 if err := tester .db .Journal (tester .lastHash ()); err != nil {
0 commit comments