mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-11 05:20:05 +00:00
randomized mock db path (#6541)
This commit is contained in:
parent
d8f6ca8485
commit
919fc390be
@ -218,7 +218,12 @@ func MockWithEverything(t *testing.T, gspec *core.Genesis, key *ecdsa.PrivateKey
|
|||||||
cfg.DeprecatedTxPool.Disable = !withTxPool
|
cfg.DeprecatedTxPool.Disable = !withTxPool
|
||||||
cfg.DeprecatedTxPool.StartOnInit = true
|
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())
|
ctx, ctxCancel := context.WithCancel(context.Background())
|
||||||
_ = db.Update(ctx, func(tx kv.RwTx) error {
|
_ = db.Update(ctx, func(tx kv.RwTx) error {
|
||||||
_, _ = kvcfg.HistoryV3.WriteOnce(tx, cfg.HistoryV3)
|
_, _ = kvcfg.HistoryV3.WriteOnce(tx, cfg.HistoryV3)
|
||||||
|
Loading…
Reference in New Issue
Block a user