From b5997f796cf4c838b4fde72327cd5fca9db783f8 Mon Sep 17 00:00:00 2001 From: ligi Date: Fri, 14 Jan 2022 20:46:22 +0100 Subject: [PATCH] Fun to filter EIP3091 explorers --- .../src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt | 4 +++- .../main/kotlin/org/ethereum/lists/chains/model/Explorer.kt | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/model/src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt b/model/src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt index 6cf42eb6..d815e5bd 100644 --- a/model/src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt +++ b/model/src/main/kotlin/org/ethereum/lists/chains/model/Chain.kt @@ -16,4 +16,6 @@ data class Chain( val explorers: List?, val infoURL: String, val title: String? -) \ No newline at end of file +) + +fun List.filterEIP3019Explorers() = map { it.copy(explorers = it.explorers?.filterEIP3019()) } \ No newline at end of file diff --git a/model/src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt b/model/src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt index 2e0d3362..977845f1 100644 --- a/model/src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt +++ b/model/src/main/kotlin/org/ethereum/lists/chains/model/Explorer.kt @@ -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, @@ -12,4 +13,6 @@ data class Explorer( val name: String, val url: String, val standard: ExplorerStandard -) \ No newline at end of file +) + +fun List.filterEIP3019() = filter { it.standard == EIP3091 } \ No newline at end of file