check chain_ids on all networks (#507)

* check chain_ids on all networks
This commit is contained in:
a10zn8
2024-06-11 17:41:37 +03:00
committed by GitHub
parent c1ea446dfc
commit cce2bcf739
9 changed files with 172 additions and 55 deletions

View File

@@ -115,7 +115,8 @@ class ChainsConfigReader(
?: throw IllegalArgumentException("undefined code for $blockchain")
val grpcId = getValueAsInt(node, "grpcId")
?: throw IllegalArgumentException("undefined code for $blockchain")
val netVersion = getValueAsLong(node, "net-version")?.toBigInteger() ?: BigInteger(chainId.drop(2), 16)
val netVersion = getValueAsLong(node, "net-version")?.toBigInteger() ?:
if (chainId.startsWith("0x")) BigInteger(chainId.drop(2), 16) else BigInteger.ZERO
val shortNames = getListOfString(node, "short-names")
?: throw IllegalArgumentException("undefined shortnames for $blockchain")
val type = getValueAsString(node, "type")