mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-05 00:36:45 +00:00
add more networkid cli test
This commit is contained in:
parent
1da4346295
commit
4459fc3519
@ -25,9 +25,9 @@ proc miscMain*() =
|
|||||||
check toAddress(0x10, 0x0).toInt == 0x1000
|
check toAddress(0x10, 0x0).toInt == 0x1000
|
||||||
check toAddress(0x10, 0x0, 0x0).toInt == 0x100000
|
check toAddress(0x10, 0x0, 0x0).toInt == 0x100000
|
||||||
|
|
||||||
|
const genesisFile = "tests" / "customgenesis" / "calaveras.json"
|
||||||
test "networkid cli":
|
test "networkid cli":
|
||||||
var msg: string
|
var msg: string
|
||||||
const genesisFile = "tests" / "customgenesis" / "calaveras.json"
|
|
||||||
var opt = initOptParser("--customnetwork:" & genesisFile & " --networkid:123")
|
var opt = initOptParser("--customnetwork:" & genesisFile & " --networkid:123")
|
||||||
let res = processArguments(msg, opt)
|
let res = processArguments(msg, opt)
|
||||||
if res != Success:
|
if res != Success:
|
||||||
@ -37,5 +37,16 @@ proc miscMain*() =
|
|||||||
let conf = getConfiguration()
|
let conf = getConfiguration()
|
||||||
check conf.net.networkId == 123.NetworkId
|
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:
|
when isMainModule:
|
||||||
miscMain()
|
miscMain()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user