mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
Support slip44 and initial backfill (#76)
This commit is contained in:
parent
07b62b9258
commit
b1c93db236
|
@ -15,5 +15,6 @@
|
|||
"infoURL": "https://ethereum.org",
|
||||
"shortName": "eth",
|
||||
"chainId": 1,
|
||||
"networkId": 1
|
||||
"networkId": 1,
|
||||
"slip44": 60
|
||||
}
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://forum.poa.network/c/xdai-chain",
|
||||
"shortName": "xdai",
|
||||
"chainId": 100,
|
||||
"networkId": 100
|
||||
}
|
||||
"networkId": 100,
|
||||
"slip44": 700
|
||||
}
|
||||
|
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://einc.io",
|
||||
"shortName": "eti",
|
||||
"chainId": 101,
|
||||
"networkId": 1
|
||||
"networkId": 1,
|
||||
"slip44": 464
|
||||
}
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://metadium.com",
|
||||
"shortName": "meta",
|
||||
"chainId": 11,
|
||||
"networkId": 11
|
||||
"networkId": 11,
|
||||
"slip44": 961
|
||||
}
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://ether1.org",
|
||||
"shortName": "etho",
|
||||
"chainId": 1313114,
|
||||
"networkId": 1313114
|
||||
"networkId": 1313114,
|
||||
"slip44": 1313114
|
||||
}
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://atheios.com",
|
||||
"shortName": "ath",
|
||||
"chainId": 1620,
|
||||
"networkId": 11235813
|
||||
"networkId": 11235813,
|
||||
"slip44": 1620
|
||||
}
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://egem.io",
|
||||
"shortName": "egem",
|
||||
"chainId": 1987,
|
||||
"networkId": 1987
|
||||
"networkId": 1987,
|
||||
"slip44": 1987
|
||||
}
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://expanse.tech",
|
||||
"shortName": "exp",
|
||||
"chainId": 2,
|
||||
"networkId": 1
|
||||
"networkId": 1,
|
||||
"slip44": 40
|
||||
}
|
|
@ -14,5 +14,6 @@
|
|||
"infoURL": "https://ethereumclassic.org",
|
||||
"shortName": "etc",
|
||||
"chainId": 61,
|
||||
"networkId": 1
|
||||
"networkId": 1,
|
||||
"slip44": 61
|
||||
}
|
|
@ -17,5 +17,6 @@
|
|||
"infoURL": "https://aquachain.github.io",
|
||||
"shortName": "aqua",
|
||||
"chainId": 61717561,
|
||||
"networkId": 61717561
|
||||
"networkId": 61717561,
|
||||
"slip44": 61717561
|
||||
}
|
|
@ -6,7 +6,7 @@ import org.kethereum.rpc.HttpEthereumRPC
|
|||
import java.io.File
|
||||
import java.math.BigInteger
|
||||
|
||||
val all_fields = listOf(
|
||||
val mandatory_fields = listOf(
|
||||
"name",
|
||||
"shortName",
|
||||
"chain",
|
||||
|
@ -18,6 +18,9 @@ val all_fields = listOf(
|
|||
"infoURL",
|
||||
"nativeCurrency"
|
||||
)
|
||||
val optionalFields = listOf(
|
||||
"slip44"
|
||||
)
|
||||
|
||||
class FileNameMustMatchChainId : Exception("chainId must match the filename")
|
||||
class ExtensionMustBeJSON : Exception("filename extension must be json")
|
||||
|
@ -41,12 +44,12 @@ fun checkChain(it: File, connectRPC: Boolean) {
|
|||
|
||||
getNumber(jsonObject, "networkId")
|
||||
|
||||
val extraFields = jsonObject.map.keys.subtract(all_fields)
|
||||
val extraFields = jsonObject.map.keys.subtract(mandatory_fields).subtract(optionalFields)
|
||||
if (extraFields.isNotEmpty()) {
|
||||
throw ShouldHaveNoExtraFields(extraFields)
|
||||
}
|
||||
|
||||
val missingFields = all_fields.subtract(jsonObject.map.keys)
|
||||
val missingFields = mandatory_fields.subtract(jsonObject.map.keys)
|
||||
if (missingFields.isNotEmpty()) {
|
||||
throw ShouldHaveNoMissingFields(missingFields)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user