mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
Add Explorer field to model
This commit is contained in:
parent
5e113833a5
commit
ccbf55afd6
|
@ -138,8 +138,6 @@ fun checkIcon(icon: File) {
|
||||||
fun checkChain(chainFile: File, connectRPC: Boolean) {
|
fun checkChain(chainFile: File, connectRPC: Boolean) {
|
||||||
println("processing $chainFile")
|
println("processing $chainFile")
|
||||||
|
|
||||||
parseWithMoshi(chainFile)
|
|
||||||
|
|
||||||
val jsonObject = Klaxon().parseJsonObject(chainFile.reader())
|
val jsonObject = Klaxon().parseJsonObject(chainFile.reader())
|
||||||
val chainAsLong = getNumber(jsonObject, "chainId")
|
val chainAsLong = getNumber(jsonObject, "chainId")
|
||||||
|
|
||||||
|
@ -248,6 +246,8 @@ fun checkChain(chainFile: File, connectRPC: Boolean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parseWithMoshi(chainFile)
|
||||||
|
|
||||||
if (connectRPC) {
|
if (connectRPC) {
|
||||||
if (jsonObject["rpc"] is List<*>) {
|
if (jsonObject["rpc"] is List<*>) {
|
||||||
(jsonObject["rpc"] as List<*>).forEach {
|
(jsonObject["rpc"] as List<*>).forEach {
|
||||||
|
|
|
@ -9,5 +9,6 @@ data class Chain(
|
||||||
val networkId: Long,
|
val networkId: Long,
|
||||||
val rpc: List<String>,
|
val rpc: List<String>,
|
||||||
val faucets: List<String>,
|
val faucets: List<String>,
|
||||||
|
val explorers: List<Explorer>?,
|
||||||
val infoURL: String,
|
val infoURL: String,
|
||||||
)
|
)
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.ethereum.lists.chains.model
|
||||||
|
|
||||||
|
data class Explorer(
|
||||||
|
val name: String,
|
||||||
|
val url: String,
|
||||||
|
val standard: String
|
||||||
|
)
|
|
@ -172,7 +172,7 @@ class TheChainChecker {
|
||||||
|
|
||||||
@Test(expected = JsonEncodingException::class)
|
@Test(expected = JsonEncodingException::class)
|
||||||
fun shouldFailForExtraComma() {
|
fun shouldFailForExtraComma() {
|
||||||
val file = getFile("invalid/eip155-extracomma.json")
|
val file = getFile("invalid/extracomma/eip155-1.json")
|
||||||
|
|
||||||
checkChain(file, false)
|
checkChain(file, false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
|
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||||
"https://api.mycryptoapi.com/eth"
|
"https://api.mycryptoapi.com/eth"
|
||||||
],
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Ether",
|
||||||
|
"symbol": "ETH",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"infoURL": "https://ethereum.org",
|
"infoURL": "https://ethereum.org",
|
||||||
}
|
}
|
|
@ -9,6 +9,11 @@
|
||||||
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
|
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||||
"https://api.mycryptoapi.com/eth"
|
"https://api.mycryptoapi.com/eth"
|
||||||
],
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Görli Ether",
|
||||||
|
"symbol": "GOR",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"infoURL": "https://ethereum.org"
|
"infoURL": "https://ethereum.org"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user