add bootnodes test

This commit is contained in:
jangko 2022-02-27 11:53:11 +07:00
parent 622e6489d8
commit 6c4d04562d
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 19 additions and 2 deletions

View File

@ -12,7 +12,7 @@
import import
std/[net, options], std/[net, options],
unittest2, unittest2,
../../eth/p2p/enode ../../eth/p2p/[enode, bootnodes]
suite "ENode": suite "ENode":
test "Go-Ethereum tests": test "Go-Ethereum tests":
@ -92,3 +92,20 @@ suite "ENode":
check (results[index].isSome and res.error == results[index].get) or check (results[index].isSome and res.error == results[index].get) or
res.isOk res.isOk
test "Bootnodes test":
proc runBNTest(bns: openArray[string]): bool =
for z in bns:
let res = ENode.fromString(z)
if res.isErr: return false
true
check runBNTest(MainnetBootnodes)
check runBNTest(RopstenBootnodes)
check runBNTest(RinkebyBootnodes)
check runBNTest(GoerliBootnodes)
check runBNTest(DiscoveryV5Bootnodes)
check runBNTest(KovanBootnodes)
check runBNTest(StatusBootNodes)
check runBNTest(StatusBootNodesStaging)
check runBNTest(StatusBootNodesTest)