diff --git a/ledger/acctonline_test.go b/ledger/acctonline_test.go index ea20db0598..da12c28c88 100644 --- a/ledger/acctonline_test.go +++ b/ledger/acctonline_test.go @@ -173,7 +173,7 @@ func TestAcctOnline(t *testing.T) { conf := config.GetDefaultLocal() maxDeltaLookback := conf.MaxAcctLookback - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() _, totals, err := au.LatestTotals() @@ -462,7 +462,7 @@ func TestAcctOnlineCache(t *testing.T) { conf.MaxAcctLookback = val maxDeltaLookback := conf.MaxAcctLookback - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() _, totals, err := au.LatestTotals() @@ -723,7 +723,7 @@ func TestAcctOnlineRoundParamsCache(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, ao := newAcctUpdates(t, ml, conf, ".") + au, ao := newAcctUpdates(t, ml, conf) defer au.close() defer ao.close() @@ -871,7 +871,7 @@ func TestAcctOnlineCacheDBSync(t *testing.T) { conf := config.GetDefaultLocal() conf.MaxAcctLookback = maxBalLookback - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() _, totals, err := au.LatestTotals() require.NoError(t, err) @@ -951,7 +951,7 @@ func TestAcctOnlineCacheDBSync(t *testing.T) { conf := config.GetDefaultLocal() conf.MaxAcctLookback = 4 - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() _, totals, err := au.LatestTotals() require.NoError(t, err) @@ -999,7 +999,7 @@ func TestAcctOnlineCacheDBSync(t *testing.T) { const maxDeltaLookback = 0 conf.MaxAcctLookback = maxDeltaLookback - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() _, totals, err := au.LatestTotals() require.NoError(t, err) @@ -1152,7 +1152,7 @@ func TestAcctOnlineVotersLongerHistory(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() _, totals, err := au.LatestTotals() require.NoError(t, err) @@ -1292,7 +1292,7 @@ func TestAcctOnlineTop(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() top, err := oa.onlineTop(0, 0, 5) @@ -1383,7 +1383,7 @@ func TestAcctOnlineTopInBatches(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - _, oa := newAcctUpdates(t, ml, conf, ".") + _, oa := newAcctUpdates(t, ml, conf) defer oa.close() top, err := oa.onlineTop(0, 0, 2048) @@ -1427,7 +1427,7 @@ func TestAcctOnlineTopBetweenCommitAndPostCommit(t *testing.T) { } conf := config.GetDefaultLocal() - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() ml.trackers.trackers = append([]ledgerTracker{stallingTracker}, ml.trackers.trackers...) @@ -1518,7 +1518,7 @@ func TestAcctOnlineTopDBBehindMemRound(t *testing.T) { } conf := config.GetDefaultLocal() - au, oa := newAcctUpdates(t, ml, conf, ".") + au, oa := newAcctUpdates(t, ml, conf) defer oa.close() ml.trackers.trackers = append([]ledgerTracker{stallingTracker}, ml.trackers.trackers...) diff --git a/ledger/acctupdates_test.go b/ledger/acctupdates_test.go index af7ff587d5..1ff0657979 100644 --- a/ledger/acctupdates_test.go +++ b/ledger/acctupdates_test.go @@ -261,7 +261,7 @@ func (au *accountUpdates) allBalances(rnd basics.Round) (bals map[basics.Address return } -func newAcctUpdates(tb testing.TB, l *mockLedgerForTracker, conf config.Local, dbPathPrefix string) (*accountUpdates, *onlineAccounts) { +func newAcctUpdates(tb testing.TB, l *mockLedgerForTracker, conf config.Local) (*accountUpdates, *onlineAccounts) { au := &accountUpdates{} au.initialize(conf) ao := &onlineAccounts{} @@ -270,7 +270,8 @@ func newAcctUpdates(tb testing.TB, l *mockLedgerForTracker, conf config.Local, d _, err := trackerDBInitialize(l, false, ".") require.NoError(tb, err) - l.trackers.initialize(l, []ledgerTracker{au, ao, &txTail{}}, conf) + err = l.trackers.initialize(l, []ledgerTracker{au, ao, &txTail{}}, conf) + require.NoError(tb, err) err = l.trackers.loadFromDisk(l) require.NoError(tb, err) @@ -481,7 +482,7 @@ func TestAcctUpdates(t *testing.T) { ml := makeMockLedgerForTracker(t, true, initialBlocksCount, protocol.ConsensusCurrentVersion, accts) defer ml.Close() - au, ao := newAcctUpdates(t, ml, conf, ".") + au, ao := newAcctUpdates(t, ml, conf) defer au.close() defer ao.close() @@ -604,7 +605,7 @@ func TestAcctUpdatesFastUpdates(t *testing.T) { ml := makeMockLedgerForTracker(t, true, initialBlocksCount, protocol.ConsensusCurrentVersion, accts) defer ml.Close() - au, ao := newAcctUpdates(t, ml, conf, ".") + au, ao := newAcctUpdates(t, ml, conf) defer au.close() defer ao.close() @@ -692,7 +693,7 @@ func BenchmarkBalancesChanges(b *testing.B) { conf := config.GetDefaultLocal() maxAcctLookback := conf.MaxAcctLookback - au, ao := newAcctUpdates(b, ml, conf, ".") + au, ao := newAcctUpdates(b, ml, conf) defer au.close() defer ao.close() @@ -834,7 +835,7 @@ func TestLargeAccountCountCatchpointGeneration(t *testing.T) { ml := makeMockLedgerForTracker(t, true, initialBlocksCount, testProtocolVersion, accts) defer ml.Close() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() // cover 10 genesis blocks @@ -938,7 +939,7 @@ func TestAcctUpdatesUpdatesCorrectness(t *testing.T) { } conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() // cover 10 genesis blocks @@ -1297,7 +1298,7 @@ func BenchmarkLargeMerkleTrieRebuild(b *testing.B) { cfg := config.GetDefaultLocal() cfg.Archival = true - au, _ := newAcctUpdates(b, ml, cfg, ".") + au, _ := newAcctUpdates(b, ml, cfg) defer au.close() // at this point, the database was created. We want to fill the accounts data @@ -1637,7 +1638,7 @@ func TestAcctUpdatesCachesInitialization(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) // cover initialRounds genesis blocks rewardLevel := uint64(0) @@ -1697,7 +1698,7 @@ func TestAcctUpdatesCachesInitialization(t *testing.T) { ml2.deltas = ml.deltas conf = config.GetDefaultLocal() - au, _ = newAcctUpdates(t, ml2, conf, ".") + au, _ = newAcctUpdates(t, ml2, conf) defer au.close() // make sure the deltas array end up containing only the most recent 320 rounds. @@ -1735,7 +1736,7 @@ func TestAcctUpdatesSplittingConsensusVersionCommits(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() // cover initialRounds genesis blocks @@ -1853,7 +1854,7 @@ func TestAcctUpdatesSplittingConsensusVersionCommitsBoundary(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() // cover initialRounds genesis blocks @@ -2001,7 +2002,7 @@ func TestAcctUpdatesResources(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() var addr1 basics.Address @@ -2204,7 +2205,7 @@ func TestAcctUpdatesLookupLatest(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() for addr, acct := range accts { acctData, validThrough, withoutRewards, err := au.lookupLatest(addr) @@ -2250,7 +2251,7 @@ func testAcctUpdatesLookupRetry(t *testing.T, assertFn func(au *accountUpdates, ml := makeMockLedgerForTracker(t, false, initialBlocksCount, testProtocolVersion, accts) defer ml.Close() - au, ao := newAcctUpdates(t, ml, conf, ".") + au, ao := newAcctUpdates(t, ml, conf) defer au.close() defer ao.close() @@ -2499,7 +2500,7 @@ func TestAcctUpdatesLookupLatestCacheRetry(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() var addr1 basics.Address @@ -2637,7 +2638,7 @@ func TestAcctUpdatesLookupResources(t *testing.T) { defer ml.Close() conf := config.GetDefaultLocal() - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) defer au.close() var addr1 basics.Address diff --git a/ledger/catchpointwriter_test.go b/ledger/catchpointwriter_test.go index 86cfa94153..d8e34500af 100644 --- a/ledger/catchpointwriter_test.go +++ b/ledger/catchpointwriter_test.go @@ -211,7 +211,7 @@ func TestBasicCatchpointWriter(t *testing.T) { conf := config.GetDefaultLocal() conf.CatchpointInterval = 1 conf.Archival = true - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) err := au.loadFromDisk(ml, 0) require.NoError(t, err) au.close() @@ -293,7 +293,7 @@ func TestFullCatchpointWriter(t *testing.T) { conf := config.GetDefaultLocal() conf.CatchpointInterval = 1 conf.Archival = true - au, _ := newAcctUpdates(t, ml, conf, ".") + au, _ := newAcctUpdates(t, ml, conf) err := au.loadFromDisk(ml, 0) require.NoError(t, err) au.close()