problem: unused options
This commit is contained in:
@@ -11,9 +11,6 @@ class UpstreamsConfig {
|
||||
var upstreams: MutableList<Upstream<*>> = ArrayList<Upstream<*>>()
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ class UpstreamsConfigReaderSpec extends Specification {
|
||||
with(get(0)) {
|
||||
chains == ["ethereum"]
|
||||
options.minPeers == 3
|
||||
options.disableSyncing
|
||||
}
|
||||
}
|
||||
act.upstreams.size() == 2
|
||||
|
||||
@@ -4,7 +4,6 @@ defaultOptions:
|
||||
- chains:
|
||||
- ethereum
|
||||
options:
|
||||
disable-syncing: true
|
||||
min-peers: 3
|
||||
|
||||
upstreams:
|
||||
|
||||
@@ -4,7 +4,6 @@ defaultOptions:
|
||||
- chains:
|
||||
- ethereum
|
||||
options:
|
||||
disable-syncing: true
|
||||
min-peers: 3
|
||||
|
||||
upstreams:
|
||||
|
||||
@@ -4,7 +4,6 @@ defaultOptions:
|
||||
- chains:
|
||||
- ethereum
|
||||
options:
|
||||
disable-syncing: true
|
||||
min-peers: 3
|
||||
|
||||
upstreams:
|
||||
|
||||
@@ -4,7 +4,6 @@ defaultOptions:
|
||||
- chains:
|
||||
- ethereum
|
||||
options:
|
||||
disable-syncing: true
|
||||
min-peers: 3
|
||||
|
||||
upstreams:
|
||||
|
||||
Reference in New Issue
Block a user