Fun to filter EIP3091 explorers

This commit is contained in:
ligi 2022-01-14 20:46:22 +01:00
parent e07d0bd635
commit b5997f796c
No known key found for this signature in database
GPG Key ID: 8E81894010ABF23D
2 changed files with 7 additions and 2 deletions

View File

@ -17,3 +17,5 @@ data class Chain(
val infoURL: String,
val title: String?
)
fun List<Chain>.filterEIP3019Explorers() = map { it.copy(explorers = it.explorers?.filterEIP3019()) }

View File

@ -1,6 +1,7 @@
package org.ethereum.lists.chains.model
import com.squareup.moshi.JsonClass
import org.ethereum.lists.chains.model.ExplorerStandard.*
enum class ExplorerStandard {
EIP3091,
@ -13,3 +14,5 @@ data class Explorer(
val url: String,
val standard: ExplorerStandard
)
fun List<Explorer>.filterEIP3019() = filter { it.standard == EIP3091 }