Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Jun 3, 2024
1 parent bcca2df commit 6c5f591
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
4 changes: 3 additions & 1 deletion premix/dumper.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import
stint,
../nimbus/common/common,
../nimbus/db/opts,
../nimbus/db/core_db/persistent,
../nimbus/core/executor,
../nimbus/[vm_state, vm_types],
Expand Down Expand Up @@ -47,7 +48,8 @@ proc dumpDebug(com: CommonRef, blockNumber: UInt256) =

proc main() {.used.} =
let conf = getConfiguration()
let com = CommonRef.new(newCoreDbRef(DefaultDbPersistent, conf.dataDir))
let com = CommonRef.new(
newCoreDbRef(DefaultDbPersistent, conf.dataDir, DbOptions.init()))

if conf.head != 0.u256:
dumpDebug(com, conf.head)
Expand Down
3 changes: 2 additions & 1 deletion premix/persist.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import
../nimbus/errors,
../nimbus/core/chain,
../nimbus/common,
../nimbus/db/opts,
../nimbus/db/[core_db/persistent, storage_types],
configuration # must be late (compilation annoyance)

Expand Down Expand Up @@ -54,7 +55,7 @@ proc main() {.used.} =

let conf = configuration.getConfiguration()
let com = CommonRef.new(
newCoreDbRef(DefaultDbPersistent, conf.dataDir),
newCoreDbRef(DefaultDbPersistent, conf.dataDir, DbOptions.init()),
conf.netId, networkParams(conf.netId))

# move head to block number ...
Expand Down
4 changes: 3 additions & 1 deletion premix/regress.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import
../nimbus/[vm_state, vm_types],
../nimbus/core/executor,
../nimbus/common/common,
../nimbus/db/opts,
../nimbus/db/core_db/persistent,
configuration # must be late (compilation annoyance)

Expand Down Expand Up @@ -52,7 +53,8 @@ proc validateBlock(com: CommonRef, blockNumber: BlockNumber): BlockNumber =
proc main() {.used.} =
let
conf = getConfiguration()
com = CommonRef.new(newCoreDbRef(DefaultDbPersistent, conf.dataDir))
com = CommonRef.new(newCoreDbRef(
DefaultDbPersistent, conf.dataDir, DbOptions.init()))

# move head to block number ...
if conf.head == 0.u256:
Expand Down
4 changes: 3 additions & 1 deletion tests/persistBlockTestGen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import
../nimbus/[tracer, config],
../nimbus/core/chain,
../nimbus/common/common,
../nimbus/db/opts,
../nimbus/db/core_db/persistent

proc dumpTest(com: CommonRef, blockNumber: int) =
Expand Down Expand Up @@ -58,7 +59,8 @@ proc main() {.used.} =
# nimbus --rpcapi: eth, debug --prune: archive

var conf = makeConfig()
let db = newCoreDbRef(DefaultDbPersistent, string conf.dataDir)
let db = newCoreDbRef(
DefaultDbPersistent, string conf.dataDir, DbOptions.init())
let com = CommonRef.new(db)

com.dumpTest(97)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_rpc_getproofs_track_state_changes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import
../nimbus/core/chain,
../nimbus/common/common,
../nimbus/rpc,
../nimbus/db/opts,
../nimbus/db/core_db,
../nimbus/db/core_db/persistent,
../nimbus/db/state_db/base,
Expand Down Expand Up @@ -145,7 +146,8 @@ proc rpcGetProofsTrackStateChangesMain*() =

test "Test tracking the changes introduced in every block":

let com = CommonRef.new(newCoreDbRef(DefaultDbPersistent, DATABASE_PATH))
let com = CommonRef.new(newCoreDbRef(
DefaultDbPersistent, DATABASE_PATH, DbOptions.init()))
com.initializeEmptyDb()

let
Expand Down
4 changes: 3 additions & 1 deletion tests/tracerTestGen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import
json,
../nimbus/common/common, # must be early (compilation annoyance)
../nimbus/db/opts,
../nimbus/db/core_db/persistent,
../nimbus/[config, tracer, vm_types]

Expand Down Expand Up @@ -57,7 +58,8 @@ proc main() {.used.} =
# nimbus --rpc-api: eth, debug --prune: archive

var conf = makeConfig()
let db = newCoreDbRef(DefaultDbPersistent, string conf.dataDir)
let db = newCoreDbRef(
DefaultDbPersistent, string conf.dataDir, DbOptions.init())
let com = CommonRef.new(db)

com.dumpTest(97)
Expand Down

0 comments on commit 6c5f591

Please sign in to comment.