mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
Cleanup
This commit is contained in:
parent
405f2a3497
commit
c27c776abb
|
@ -6,7 +6,6 @@ import org.kethereum.erc55.isValid
|
|||
import org.kethereum.model.Address
|
||||
import org.kethereum.rpc.HttpEthereumRPC
|
||||
import java.io.File
|
||||
import java.math.BigInteger
|
||||
|
||||
val mandatory_fields = listOf(
|
||||
"name",
|
||||
|
@ -94,17 +93,6 @@ fun checkChain(it: File, connectRPC: Boolean) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
fun String.tryBigint() = if (startsWith("0x")) {
|
||||
try {
|
||||
BigInteger(removePrefix("0x"), 16)
|
||||
} catch (e: NumberFormatException) {
|
||||
null
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
private fun getNumber(jsonObject: JsonObject, field: String): Long {
|
||||
return when (val chainId = jsonObject[field]) {
|
||||
is Int -> chainId.toLong()
|
||||
|
|
Loading…
Reference in New Issue
Block a user