From 62ec04f151ad99c0175dd4ff217ec4bdec2db264 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Tue, 13 Aug 2019 16:45:02 -0400 Subject: [PATCH] problem: unused options --- .../kotlin/io/emeraldpay/dshackle/config/UpstreamsConfig.kt | 5 ----- .../io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt | 3 --- .../dshackle/config/UpstreamsConfigReaderSpec.groovy | 1 - src/test/resources/upstreams-basic.yaml | 1 - src/test/resources/upstreams-ds.yaml | 1 - src/test/resources/upstreams-labels.yaml | 1 - src/test/resources/upstreams-options.yaml | 1 - 7 files changed, 13 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfig.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfig.kt index 688ceb55..6958721c 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfig.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfig.kt @@ -11,9 +11,6 @@ class UpstreamsConfig { var upstreams: MutableList> = ArrayList>() open class Options { - @Deprecated("remove it") - var quorum: Int = 1 - var disableSyncing: Boolean? = null var disableValidation: Boolean? = null var minPeers: Int? = 1 @@ -29,7 +26,6 @@ class UpstreamsConfig { return this } val copy = Options() - copy.disableSyncing = if (this.disableSyncing != null) this.disableSyncing else additional.disableSyncing copy.minPeers = if (this.minPeers != null) this.minPeers else additional.minPeers copy.disableValidation = if (this.disableValidation != null) this.disableValidation else additional.disableValidation return copy @@ -38,7 +34,6 @@ class UpstreamsConfig { companion object { fun getDefaults(): Options { val options = Options() - options.disableSyncing = true options.minPeers = 1 options.disableValidation = false return options diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt index 6039219d..f9808179 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt @@ -128,9 +128,6 @@ class UpstreamsConfigReader { internal fun readOptions(values: MappingNode): UpstreamsConfig.Options { val options = UpstreamsConfig.Options() - getValueAsBool(values, "disable-syncing")?.let { - options.disableSyncing = it - } getValueAsInt(values, "min-peers")?.let { options.minPeers = it } diff --git a/src/test/groovy/io/emeraldpay/dshackle/config/UpstreamsConfigReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/config/UpstreamsConfigReaderSpec.groovy index 11c376aa..791a5f16 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/config/UpstreamsConfigReaderSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/config/UpstreamsConfigReaderSpec.groovy @@ -19,7 +19,6 @@ class UpstreamsConfigReaderSpec extends Specification { with(get(0)) { chains == ["ethereum"] options.minPeers == 3 - options.disableSyncing } } act.upstreams.size() == 2 diff --git a/src/test/resources/upstreams-basic.yaml b/src/test/resources/upstreams-basic.yaml index 461b22fe..80960667 100644 --- a/src/test/resources/upstreams-basic.yaml +++ b/src/test/resources/upstreams-basic.yaml @@ -4,7 +4,6 @@ defaultOptions: - chains: - ethereum options: - disable-syncing: true min-peers: 3 upstreams: diff --git a/src/test/resources/upstreams-ds.yaml b/src/test/resources/upstreams-ds.yaml index 4575a5a4..7e72cc94 100644 --- a/src/test/resources/upstreams-ds.yaml +++ b/src/test/resources/upstreams-ds.yaml @@ -4,7 +4,6 @@ defaultOptions: - chains: - ethereum options: - disable-syncing: true min-peers: 3 upstreams: diff --git a/src/test/resources/upstreams-labels.yaml b/src/test/resources/upstreams-labels.yaml index dbfd9061..049693ad 100644 --- a/src/test/resources/upstreams-labels.yaml +++ b/src/test/resources/upstreams-labels.yaml @@ -4,7 +4,6 @@ defaultOptions: - chains: - ethereum options: - disable-syncing: true min-peers: 3 upstreams: diff --git a/src/test/resources/upstreams-options.yaml b/src/test/resources/upstreams-options.yaml index b012e381..4cc0b059 100644 --- a/src/test/resources/upstreams-options.yaml +++ b/src/test/resources/upstreams-options.yaml @@ -4,7 +4,6 @@ defaultOptions: - chains: - ethereum options: - disable-syncing: true min-peers: 3 upstreams: