mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
parent
c5b56176aa
commit
dc63324d9a
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "PHI Network v2",
|
||||
"chain": "PHI",
|
||||
"rpc": ["https://connect.phi.network", ""],
|
||||
"rpc": ["https://connect.phi.network"],
|
||||
"faucets": [],
|
||||
"nativeCurrency": {
|
||||
"name": "PHI",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "Bitcoin EVM",
|
||||
"chain": "Bitcoin EVM",
|
||||
"rpc": ["https://connect.bitcoinevm.com", ""],
|
||||
"rpc": ["https://connect.bitcoinevm.com"],
|
||||
"faucets": [],
|
||||
"nativeCurrency": {
|
||||
"name": "Bitcoin",
|
||||
|
|
|
@ -116,8 +116,13 @@ private fun createOutputFiles() {
|
|||
}
|
||||
|
||||
private fun doChecks(doRPCConnect: Boolean, doIconDownload: Boolean, verbose: Boolean) {
|
||||
allChainFiles.forEach {
|
||||
checkChain(it, doRPCConnect, verbose)
|
||||
allChainFiles.forEach { file ->
|
||||
try {
|
||||
checkChain(file, doRPCConnect, verbose)
|
||||
} catch (exception: Exception) {
|
||||
println("Problem with $file")
|
||||
throw exception
|
||||
}
|
||||
}
|
||||
|
||||
val allIcons = iconsPath.listFiles() ?: return
|
||||
|
@ -399,12 +404,16 @@ fun checkChain(chainFile: File, connectRPC: Boolean, verbose: Boolean = false) {
|
|||
|
||||
parseWithMoshi(chainFile)
|
||||
|
||||
if (connectRPC) {
|
||||
if (jsonObject["rpc"] is List<*>) {
|
||||
(jsonObject["rpc"] as List<*>).forEach {
|
||||
if (it !is String) {
|
||||
throw (RPCMustBeListOfStrings())
|
||||
} else {
|
||||
if (jsonObject["rpc"] !is List<*>) {
|
||||
throw (RPCMustBeList())
|
||||
} else {
|
||||
(jsonObject["rpc"] as List<*>).forEach {
|
||||
if (it !is String) {
|
||||
throw (RPCMustBeListOfStrings())
|
||||
} else if (it.isEmpty()) {
|
||||
throw (RPCCannotBeEmpty())
|
||||
} else {
|
||||
if (connectRPC) {
|
||||
var chainId: BigInteger? = null
|
||||
try {
|
||||
println("connecting to $it")
|
||||
|
@ -425,9 +434,6 @@ fun checkChain(chainFile: File, connectRPC: Boolean, verbose: Boolean = false) {
|
|||
}
|
||||
}
|
||||
}
|
||||
println()
|
||||
} else {
|
||||
throw (RPCMustBeList())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ class ShouldHaveNoExtraFields(fields: Set<String>) : Exception("should have no e
|
|||
class ShouldHaveNoMissingFields(fields: Set<String>) : Exception("missing field(s) $fields")
|
||||
class RPCMustBeList : Exception("rpc must be a list")
|
||||
class RPCMustBeListOfStrings : Exception("rpc must be a list of strings")
|
||||
class RPCCannotBeEmpty : Exception("rpc cannot be empty")
|
||||
class ENSMustBeObject: Exception("ens must be an object")
|
||||
class ENSMustHaveOnlyRegistry: Exception("ens can only have a registry currently")
|
||||
class ENSRegistryAddressMustBeValid: Exception("ens registry must have valid address")
|
||||
|
|
Loading…
Reference in New Issue
Block a user