add more networkid cli test

This commit is contained in:
jangko 2021-08-05 18:44:07 +07:00
parent 1da4346295
commit 4459fc3519
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9

View File

@ -25,9 +25,9 @@ proc miscMain*() =
check toAddress(0x10, 0x0).toInt == 0x1000
check toAddress(0x10, 0x0, 0x0).toInt == 0x100000
const genesisFile = "tests" / "customgenesis" / "calaveras.json"
test "networkid cli":
var msg: string
const genesisFile = "tests" / "customgenesis" / "calaveras.json"
var opt = initOptParser("--customnetwork:" & genesisFile & " --networkid:123")
let res = processArguments(msg, opt)
if res != Success:
@ -37,5 +37,16 @@ proc miscMain*() =
let conf = getConfiguration()
check conf.net.networkId == 123.NetworkId
test "networkid first, customnetwork next":
var msg: string
var opt = initOptParser(" --networkid:123 --customnetwork:" & genesisFile)
let res = processArguments(msg, opt)
if res != Success:
echo msg
quit(QuitFailure)
let conf = getConfiguration()
check conf.net.networkId == 123.NetworkId
when isMainModule:
miscMain()