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) {
|
||||
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 {
|
||||
|
|
|
@ -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,
|
||||
)
|
|
@ -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)
|
||||
fun shouldFailForExtraComma() {
|
||||
val file = getFile("invalid/eip155-extracomma.json")
|
||||
val file = getFile("invalid/extracomma/eip155-1.json")
|
||||
|
||||
checkChain(file, false)
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user