This commit is contained in:
ligi 2020-11-13 01:34:13 +01:00
parent 405f2a3497
commit c27c776abb
No known key found for this signature in database
GPG Key ID: 8E81894010ABF23D

View File

@ -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()