mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
parent
e4b54eb55c
commit
e65a5dff3d
|
@ -9,7 +9,7 @@
|
||||||
],
|
],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"name": "MetaDot Token TestNet",
|
"name": "MetaDot Token TestNet",
|
||||||
"symbol": "MTT-test",
|
"symbol": "MTTest",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://metadot.network",
|
"infoURL": "https://metadot.network",
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"name": "milkTAda",
|
"name": "milkTAda",
|
||||||
"symbol": "milkTAda",
|
"symbol": "mTAda",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://milkomeda.com",
|
"infoURL": "https://milkomeda.com",
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
],
|
],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"name": "Lisinski Ether",
|
"name": "Lisinski Ether",
|
||||||
"symbol": "LISINSKI",
|
"symbol": "LISINS",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://lisinski.online",
|
"infoURL": "https://lisinski.online",
|
||||||
|
|
|
@ -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 {
|
jsonObject["explorers"]?.let {
|
||||||
if (it !is JsonArray<*>) {
|
if (it !is JsonArray<*>) {
|
||||||
throw (ExplorersMustBeArray())
|
throw (ExplorersMustBeArray())
|
||||||
|
|
|
@ -27,3 +27,9 @@ class BridgeNoObject: Exception("parent bridges must be array consisting of json
|
||||||
class BridgeOnlyURL: Exception("parent bridge only contain an URL")
|
class BridgeOnlyURL: Exception("parent bridge only contain an URL")
|
||||||
class ParentChainDoesNotExist(chain: String): Exception("Referenced parent chain ($chain) does not exist")
|
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