Add Explorer field to model

This commit is contained in:
ligi 2021-12-29 22:08:15 +01:00
parent 5e113833a5
commit ccbf55afd6
No known key found for this signature in database
GPG Key ID: 8E81894010ABF23D
6 changed files with 30 additions and 12 deletions

View File

@ -138,8 +138,6 @@ fun checkIcon(icon: File) {
fun checkChain(chainFile: File, connectRPC: Boolean) {
println("processing $chainFile")
parseWithMoshi(chainFile)
val jsonObject = Klaxon().parseJsonObject(chainFile.reader())
val chainAsLong = getNumber(jsonObject, "chainId")
@ -248,6 +246,8 @@ fun checkChain(chainFile: File, connectRPC: Boolean) {
}
parseWithMoshi(chainFile)
if (connectRPC) {
if (jsonObject["rpc"] is List<*>) {
(jsonObject["rpc"] as List<*>).forEach {

View File

@ -1,13 +1,14 @@
package org.ethereum.lists.chains.model
data class Chain(
val name: String,
val shortName: String,
val chain: String,
val network: String,
val chainId: Long,
val networkId: Long,
val rpc: List<String>,
val faucets: List<String>,
val infoURL: String,
val name: String,
val shortName: String,
val chain: String,
val network: String,
val chainId: Long,
val networkId: Long,
val rpc: List<String>,
val faucets: List<String>,
val explorers: List<Explorer>?,
val infoURL: String,
)

View File

@ -0,0 +1,7 @@
package org.ethereum.lists.chains.model
data class Explorer(
val name: String,
val url: String,
val standard: String
)

View File

@ -172,7 +172,7 @@ class TheChainChecker {
@Test(expected = JsonEncodingException::class)
fun shouldFailForExtraComma() {
val file = getFile("invalid/eip155-extracomma.json")
val file = getFile("invalid/extracomma/eip155-1.json")
checkChain(file, false)
}

View File

@ -9,6 +9,11 @@
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
"https://api.mycryptoapi.com/eth"
],
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"faucets": [],
"infoURL": "https://ethereum.org",
}

View File

@ -9,6 +9,11 @@
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
"https://api.mycryptoapi.com/eth"
],
"nativeCurrency": {
"name": "Görli Ether",
"symbol": "GOR",
"decimals": 18
},
"faucets": [],
"infoURL": "https://ethereum.org"
}