summaryrefslogtreecommitdiff
path: root/ledger/acctupdates_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ledger/acctupdates_test.go')
-rw-r--r--ledger/acctupdates_test.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/ledger/acctupdates_test.go b/ledger/acctupdates_test.go
index f1434b02f..1e77ef49a 100644
--- a/ledger/acctupdates_test.go
+++ b/ledger/acctupdates_test.go
@@ -75,12 +75,10 @@ func accumulateTotals(t testing.TB, consensusVersion protocol.ConsensusVersion,
return
}
-func makeMockLedgerForTracker(t testing.TB, inMemory bool, initialBlocksCount int, consensusVersion protocol.ConsensusVersion, accts []map[basics.Address]basics.AccountData) *mockLedgerForTracker {
+func makeMockLedgerForTrackerWithLogger(t testing.TB, inMemory bool, initialBlocksCount int, consensusVersion protocol.ConsensusVersion, accts []map[basics.Address]basics.AccountData, l logging.Logger) *mockLedgerForTracker {
dbs, fileName := dbOpenTest(t, inMemory)
- dblogger := logging.TestingLog(t)
- dblogger.SetLevel(logging.Info)
- dbs.Rdb.SetLogger(dblogger)
- dbs.Wdb.SetLogger(dblogger)
+ dbs.Rdb.SetLogger(l)
+ dbs.Wdb.SetLogger(l)
blocks := randomInitChain(consensusVersion, initialBlocksCount)
deltas := make([]ledgercore.StateDelta, initialBlocksCount)
@@ -92,7 +90,15 @@ func makeMockLedgerForTracker(t testing.TB, inMemory bool, initialBlocksCount in
}
}
consensusParams := config.Consensus[consensusVersion]
- return &mockLedgerForTracker{dbs: dbs, log: dblogger, filename: fileName, inMemory: inMemory, blocks: blocks, deltas: deltas, consensusParams: consensusParams, accts: accts[0]}
+ return &mockLedgerForTracker{dbs: dbs, log: l, filename: fileName, inMemory: inMemory, blocks: blocks, deltas: deltas, consensusParams: consensusParams, accts: accts[0]}
+
+}
+
+func makeMockLedgerForTracker(t testing.TB, inMemory bool, initialBlocksCount int, consensusVersion protocol.ConsensusVersion, accts []map[basics.Address]basics.AccountData) *mockLedgerForTracker {
+ dblogger := logging.TestingLog(t)
+ dblogger.SetLevel(logging.Info)
+
+ return makeMockLedgerForTrackerWithLogger(t, inMemory, initialBlocksCount, consensusVersion, accts, dblogger)
}
// fork creates another database which has the same content as the current one. Works only for non-memory databases.