From 919fc390be4f30b2f122432909ee4748a32d8db6 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Tue, 10 Jan 2023 13:52:05 +0700 Subject: [PATCH] randomized mock db path (#6541) --- turbo/stages/mock_sentry.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/turbo/stages/mock_sentry.go b/turbo/stages/mock_sentry.go index d548e8505..4a51888b9 100644 --- a/turbo/stages/mock_sentry.go +++ b/turbo/stages/mock_sentry.go @@ -218,7 +218,12 @@ func MockWithEverything(t *testing.T, gspec *core.Genesis, key *ecdsa.PrivateKey cfg.DeprecatedTxPool.Disable = !withTxPool cfg.DeprecatedTxPool.StartOnInit = true - db := memdb.New() + var db kv.RwDB + if t != nil { + db = memdb.NewTestDB(t) + } else { + db = memdb.New() + } ctx, ctxCancel := context.WithCancel(context.Background()) _ = db.Update(ctx, func(tx kv.RwTx) error { _, _ = kvcfg.HistoryV3.WriteOnce(tx, cfg.HistoryV3)