From 72ef25b3ddc1f879864d12b9ccb49b71f22872d4 Mon Sep 17 00:00:00 2001 From: Mike Sizov Date: Thu, 6 Jun 2024 21:35:05 +0700 Subject: [PATCH] Minor refactor --- .../dshackle/startup/configure/GenericUpstreamCreator.kt | 2 -- .../kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/startup/configure/GenericUpstreamCreator.kt b/src/main/kotlin/io/emeraldpay/dshackle/startup/configure/GenericUpstreamCreator.kt index 8e84ceac0..f92d86985 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/startup/configure/GenericUpstreamCreator.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/startup/configure/GenericUpstreamCreator.kt @@ -65,8 +65,6 @@ open class GenericUpstreamCreator( chainConfig, ) ?: return UpstreamCreationData.default() - val methods = buildMethods(config, chain) - val hashUrl = connection.let { if (it.connectorMode == GenericConnectorFactory.ConnectorMode.RPC_REQUESTS_WITH_MIXED_HEAD.name) it.rpc?.url ?: it.ws?.url else it.ws?.url ?: it.rpc?.url } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt index dceafb1ac..5742c7ce7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt @@ -72,7 +72,7 @@ abstract class Multistream( private var cacheSubscription: Disposable? = null @Volatile - private var callMethods: CallMethods? = null + private var callMethods: DisabledCallMethods? = null private var callMethodsFactory: Factory = Factory { return@Factory callMethods ?: throw FunctorException("Not initialized yet") } @@ -238,7 +238,7 @@ abstract class Multistream( this, multistreamUnavailableMethodDisableDuration, AggregatedCallMethods(it), - (callMethods!! as DisabledCallMethods).disabledMethods, + callMethods!!.disabledMethods, ) } }