connect_to_testnet.nims: fix warning and enforce verbosity [skip ci]

This commit is contained in:
Ștefan Talpalaru 2019-11-12 15:57:33 +01:00
parent 6b22485197
commit 6c021f8c12
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
2 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@ eth2_network_simulation: | build deps p2pd clean_eth2_network_simulation_files p
GIT_ROOT="$$PWD" tests/simulation/start.sh
testnet0 testnet1: | build deps
NIM_PARAMS="$(NIM_PARAMS)" $(ENV_SCRIPT) nim scripts/connect_to_testnet.nims $@
NIM_PARAMS="$(NIM_PARAMS)" $(ENV_SCRIPT) nim $(NIM_PARAMS) scripts/connect_to_testnet.nims $@
clean-testnet0:
rm -rf build/data/nimbus_testnet0

View File

@ -1,5 +1,5 @@
import
confutils, strutils, strformat, ospaths
confutils, strutils, strformat, os
const
rootDir = thisDir() / ".."
@ -36,13 +36,13 @@ cli do (testnetName {.argument.}: string):
exec &"git clone --quiet --depth=1 {testnetsGitUrl}"
let testnetDir = allTestnetsDir / team / testnet
if not dirExists(testnetDir):
if not system.dirExists(testnetDir):
echo &"No metadata files exists for the '{testnetName}' testnet"
quit 1
proc checkRequiredFile(fileName: string) =
let filePath = testnetDir / fileName
if not fileExists(filePath):
if not system.fileExists(filePath):
echo &"The required file {fileName} is not present in '{testnetDir}'."
quit 1
@ -50,7 +50,7 @@ cli do (testnetName {.argument.}: string):
checkRequiredFile genesisFile
var preset = testnetDir / configFile
if not fileExists(preset): preset = "minimal"
if not system.fileExists(preset): preset = "minimal"
let
dataDirName = testnetName.replace("/", "_")
@ -60,11 +60,11 @@ cli do (testnetName {.argument.}: string):
var depositContractOpt = ""
let depositContractFile = testnetDir / depositContractFile
if fileExists(depositContractFile):
if system.fileExists(depositContractFile):
depositContractOpt = "--deposit-contract=" & readFile(depositContractFile).strip
if dirExists(dataDir):
if fileExists(dataDir/genesisFile):
if system.dirExists(dataDir):
if system.fileExists(dataDir/genesisFile):
let localGenesisContent = readFile(dataDir/genesisFile)
let testnetGenesisContent = readFile(testnetDir/genesisFile)
if localGenesisContent != testnetGenesisContent: