Skip to content

Commit 6c0e40e

Browse files
authored
Cleanup defaultRuntimeConfig use in blockchain_dag tests (#7609)
* Cleanup defaultRuntimeConfig use in blockchain_dag tests Extract RuntimeConfig into variable to streamline the DAG tests, and fix a few instances where the cfg was not properly passed to the test DB. * A couple more in other test files * Lint
1 parent d07084a commit 6c0e40e

File tree

6 files changed

+98
-101
lines changed

6 files changed

+98
-101
lines changed

tests/consensus_spec/test_fixture_fork_choice.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ proc initialLoad(
100100
ChainDAGRef.preInit(db, forkedState[])
101101

102102
let
103+
cfg = forkedState[].kind.genesisTestRuntimeConfig
103104
validatorMonitor = newClone(ValidatorMonitor.init())
104-
dag = ChainDAGRef.init(
105-
forkedState[].kind.genesisTestRuntimeConfig, db, validatorMonitor, {})
105+
dag = ChainDAGRef.init(cfg, db, validatorMonitor, {})
106106
fkChoice = newClone(ForkChoice.init(
107107
dag.getFinalizedEpochRef(), dag.finalizedHead.blck))
108108

tests/test_beacon_chain_db.nim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ suite "Beacon chain DB" & preset():
331331

332332
let
333333
state = newClone(initialize_hashed_beacon_state_from_eth1(
334-
defaultRuntimeConfig, mockEth1BlockHash, 0,
334+
cfg, mockEth1BlockHash, 0,
335335
makeInitialDeposits(SLOTS_PER_EPOCH), {skipBlsValidation}))
336336

337337
db.putState(state[].root, state[].data)
@@ -564,8 +564,6 @@ suite "Beacon chain DB" & preset():
564564
db.close()
565565

566566
suite "Quarantine" & preset():
567-
const cfg = defaultRuntimeConfig
568-
569567
setup:
570568
let
571569
db = BeaconChainDB.new("", cfg, inMemory = true)

0 commit comments

Comments
 (0)