mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
parent
5a7564fe61
commit
da94738893
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "Moonrock",
|
||||
"name": "Moonrock old",
|
||||
"chain": "MOON",
|
||||
"rpc": [],
|
||||
"faucets": [],
|
||||
|
@ -9,7 +9,8 @@
|
|||
"decimals": 18
|
||||
},
|
||||
"infoURL": "",
|
||||
"shortName": "mrock",
|
||||
"shortName": "mrock-old",
|
||||
"chainId": 1286,
|
||||
"networkId": 1286
|
||||
"networkId": 1286,
|
||||
"deprecated": true
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "SoterOne Mainnet",
|
||||
"name": "SoterOne Mainnet old",
|
||||
"chain": "SOTER",
|
||||
"rpc": [
|
||||
"https://rpc.soter.one"
|
||||
|
@ -12,7 +12,8 @@
|
|||
"decimals": 18
|
||||
},
|
||||
"infoURL": "https://www.soterone.com",
|
||||
"shortName": "SO1",
|
||||
"shortName": "SO1-old",
|
||||
"chainId": 218,
|
||||
"networkId": 218
|
||||
"networkId": 218,
|
||||
"deprecated": true
|
||||
}
|
|
@ -22,7 +22,8 @@ val optionalFields = listOf(
|
|||
"explorers",
|
||||
"title",
|
||||
"network",
|
||||
"parent"
|
||||
"parent",
|
||||
"deprecated"
|
||||
)
|
||||
|
||||
val moshi: Moshi = Moshi.Builder().build()
|
||||
|
|
|
@ -93,10 +93,8 @@ private fun doChecks(doRPCConnect: Boolean) {
|
|||
checkIcon(it)
|
||||
}
|
||||
|
||||
allFiles.filter { it.isDirectory }.forEach {
|
||||
if (it.name != "deprecated") {
|
||||
error("the only directory allowed is 'deprecated'")
|
||||
}
|
||||
allFiles.filter { it.isDirectory }.forEach { _ ->
|
||||
error("should not contain a directory")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +212,11 @@ fun checkChain(chainFile: File, connectRPC: Boolean) {
|
|||
throw ENSRegistryAddressMustBeValid()
|
||||
}
|
||||
}
|
||||
|
||||
jsonObject["deprecated"]?.let {
|
||||
if (it !is Boolean) {
|
||||
throw DeprecatedMustBeBoolean()
|
||||
}
|
||||
}
|
||||
jsonObject["parent"]?.let {
|
||||
if (it !is JsonObject) {
|
||||
throw ParentMustBeObject()
|
||||
|
|
|
@ -26,3 +26,4 @@ class ParentBridgeNoArray: Exception("parent bridge must be array")
|
|||
class BridgeNoObject: Exception("parent bridges must be array consisting of json objects")
|
||||
class BridgeOnlyURL: Exception("parent bridge only contain an URL")
|
||||
class ParentChainDoesNotExist(chain: String): Exception("Referenced parent chain ($chain) does not exist")
|
||||
class DeprecatedMustBeBoolean: Exception("deprecated must be boolean")
|
|
@ -221,6 +221,11 @@ class TheChainChecker {
|
|||
checkChain(getFile("invalid/explorermissingurl/eip155-1.json"), false)
|
||||
}
|
||||
|
||||
@Test(expected = DeprecatedMustBeBoolean::class)
|
||||
fun shouldFailOnInvalidDeprecation() {
|
||||
checkChain(getFile("invalid/invalid_deprecation/eip155-1.json"), false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun canParse2chains() {
|
||||
checkChain(getFile("valid/eip155-1.json"), false)
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "Ethereum Mainnet",
|
||||
"shortName": "eth",
|
||||
"chain": "ETH",
|
||||
"network": "mainnet",
|
||||
"chainId": 1,
|
||||
"networkId": 1,
|
||||
"rpc": [
|
||||
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||
"https://api.mycryptoapi.com/eth"
|
||||
],
|
||||
"faucets": [],
|
||||
"infoURL": "https://ethereum.org",
|
||||
"nativeCurrency": {
|
||||
"name": "Ether",
|
||||
"symbol": "ETH",
|
||||
"decimals": 18
|
||||
},
|
||||
"explorers": [],
|
||||
"deprecated": "yolo"
|
||||
}
|
|
@ -15,5 +15,6 @@
|
|||
"name": "Ether",
|
||||
"symbol": "ETH",
|
||||
"decimals": 18
|
||||
}
|
||||
},
|
||||
"deprecated": true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user