mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
parent
6c3e788d32
commit
ff736c8d27
|
@ -9,7 +9,7 @@
|
|||
],
|
||||
"nativeCurrency": {
|
||||
"name": "MetaDot Token TestNet",
|
||||
"symbol": "MTT-test",
|
||||
"symbol": "MTTest",
|
||||
"decimals": 18
|
||||
},
|
||||
"infoURL": "https://metadot.network",
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"faucets": [],
|
||||
"nativeCurrency": {
|
||||
"name": "milkTAda",
|
||||
"symbol": "milkTAda",
|
||||
"symbol": "mTAda",
|
||||
"decimals": 18
|
||||
},
|
||||
"infoURL": "https://milkomeda.com",
|
||||
|
@ -24,4 +24,4 @@
|
|||
"standard": "none"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
],
|
||||
"nativeCurrency": {
|
||||
"name": "Lisinski Ether",
|
||||
"symbol": "LISINSKI",
|
||||
"symbol": "LISINS",
|
||||
"decimals": 18
|
||||
},
|
||||
"infoURL": "https://lisinski.online",
|
||||
"shortName": "lisinski",
|
||||
"chainId": 385,
|
||||
"networkId": 385
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,6 +171,29 @@ fun checkChain(chainFile: File, connectRPC: Boolean) {
|
|||
}
|
||||
}
|
||||
|
||||
jsonObject["nativeCurrency"]?.let {
|
||||
if (it !is JsonObject) {
|
||||
throw NativeCurrencyMustBeObject()
|
||||
}
|
||||
val symbol = it["symbol"]
|
||||
if (symbol !is String) {
|
||||
throw NativeCurrencySymbolMustBeString()
|
||||
}
|
||||
|
||||
if (symbol.length >= 7) {
|
||||
throw NativeCurrencySymbolMustHaveLessThan7Chars()
|
||||
}
|
||||
if (it.keys != setOf("symbol","decimals","name")) {
|
||||
throw NativeCurrencyCanOnlyHaveSymbolNameAndDecimals()
|
||||
}
|
||||
if (it["decimals"] !is Int) {
|
||||
throw NativeCurrencyDecimalMustBeInt()
|
||||
}
|
||||
if (it["name"] !is String) {
|
||||
throw NativeCurrencyNameMustBeString()
|
||||
}
|
||||
}
|
||||
|
||||
jsonObject["explorers"]?.let {
|
||||
if (it !is JsonArray<*>) {
|
||||
throw (ExplorersMustBeArray())
|
||||
|
|
|
@ -26,4 +26,10 @@ 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")
|
||||
class DeprecatedMustBeBoolean: Exception("deprecated must be boolean")
|
||||
class NativeCurrencyMustBeObject: Exception("Native currency must be object")
|
||||
class NativeCurrencySymbolMustBeString: Exception("Native currency symbol must be string")
|
||||
class NativeCurrencySymbolMustHaveLessThan7Chars: Exception("Native currency symbol must have less than 7 chars")
|
||||
class NativeCurrencyCanOnlyHaveSymbolNameAndDecimals: Exception("Native currency can only have symbol decimals and name")
|
||||
class NativeCurrencyDecimalMustBeInt: Exception("Native currency decimals must be int")
|
||||
class NativeCurrencyNameMustBeString: Exception("Native currency name must be string")
|
Loading…
Reference in New Issue
Block a user