fix standalone compilation of `trusted_node_sync.nim` (#5861)
#5544 contained a regression that broke standalone compilation of `trusted_node_sync` as a main module. Fix it, and add to CI.
This commit is contained in:
parent
94ba0a9bd1
commit
ed8743b986
|
@ -221,6 +221,11 @@ jobs:
|
|||
run: |
|
||||
make -j nimbus_beacon_node LOG_LEVEL=TRACE NIMFLAGS="-d:has_deposit_root_checks=1"
|
||||
|
||||
- name: Build files with isMainModule
|
||||
run: |
|
||||
source env.sh
|
||||
nim c beacon_chain/trusted_node_sync
|
||||
|
||||
lint:
|
||||
name: "Lint"
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -540,16 +540,18 @@ proc doTrustedNodeSync*(
|
|||
|
||||
when isMainModule:
|
||||
import
|
||||
std/[os],
|
||||
std/os,
|
||||
networking/network_metadata
|
||||
|
||||
let
|
||||
cfg = getRuntimeConfig(some os.paramStr(1))
|
||||
databaseDir = os.paramStr(2)
|
||||
syncTarget = TrustedNodeSyncTarget(
|
||||
kind: TrustedNodeSyncKind.StateId,
|
||||
stateId: os.paramStr(5))
|
||||
backfill = os.paramCount() > 5 and os.paramStr(6) == "true"
|
||||
db = BeaconChainDB.new(databaseDir, cfg, inMemory = false)
|
||||
waitFor db.doTrustedNodeSync(
|
||||
getRuntimeConfig(some os.paramStr(1)), os.paramStr(2), os.paramStr(3),
|
||||
cfg, databaseDir, os.paramStr(3),
|
||||
os.paramStr(4), syncTarget, backfill, false, true)
|
||||
db.close()
|
||||
|
|
Loading…
Reference in New Issue