From f9db37cb9e48e431c107981ad522188e3961a302 Mon Sep 17 00:00:00 2001 From: terminal Date: Thu, 18 Aug 2022 21:08:04 +0400 Subject: [PATCH] fix linter errors again --- .../dshackle/upstream/CurrentMultistreamHolder.kt | 4 ++-- .../upstream/ethereum_pos/EthereumPosHeadLagObserver.kt | 4 ++-- .../upstream/ethereum_pos/EthereumPosMultiStream.kt | 6 +++--- .../dshackle/upstream/grpc/EthereumGrpcUpstream.kt | 9 +++++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt index 4de9bbef..fbf75e53 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CurrentMultistreamHolder.kt @@ -25,7 +25,7 @@ import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.calls.DefaultBitcoinMethods import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream -import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultistream +import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosUpstream import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstream import io.emeraldpay.grpc.BlockchainType @@ -74,7 +74,7 @@ open class CurrentMultistreamHolder( val up = change.upstream.cast(EthereumPosUpstream::class.java) val current = chainMapping[chain] val factory = Callable { - EthereumPosMultistream(chain, ArrayList(), cachesFactory.getCaches(chain)) + EthereumPosMultiStream(chain, ArrayList(), cachesFactory.getCaches(chain)) } processUpdate(change, up, current, factory) } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosHeadLagObserver.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosHeadLagObserver.kt index 87b4b42e..4b44c58c 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosHeadLagObserver.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosHeadLagObserver.kt @@ -7,13 +7,13 @@ import io.emeraldpay.dshackle.upstream.HeadLagObserver import io.emeraldpay.dshackle.upstream.Upstream import org.slf4j.LoggerFactory -class EthereumPostHeadLagObserver( +class EthereumPosHeadLagObserver( master: Head, followers: Collection ) : HeadLagObserver(master, followers, DistanceExtractor::extractPriorityDistance) { companion object { - private val log = LoggerFactory.getLogger(EthereumPostHeadLagObserver::class.java) + private val log = LoggerFactory.getLogger(EthereumPosHeadLagObserver::class.java) } override fun forkDistance(top: BlockContainer, curr: BlockContainer): Long { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt index 90679289..d263ff1c 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt @@ -34,14 +34,14 @@ import org.springframework.context.Lifecycle import reactor.core.publisher.Mono @Suppress("UNCHECKED_CAST") -open class EthereumPosMultistream( +open class EthereumPosMultiStream( chain: Chain, val upstreams: MutableList, caches: Caches ) : Multistream(chain, upstreams as MutableList, caches, CacheRequested(caches)), EthereumLikeMultistream { companion object { - private val log = LoggerFactory.getLogger(EthereumPosMultistream::class.java) + private val log = LoggerFactory.getLogger(EthereumPosMultiStream::class.java) } private var head: Head? = null @@ -108,7 +108,7 @@ open class EthereumPosMultistream( val newHead = MergedHead(heads, PriorityForkChoice()).apply { this.start() } - val lagObserver = EthereumPostHeadLagObserver(newHead, upstreams as Collection) + val lagObserver = EthereumPosHeadLagObserver(newHead, upstreams as Collection) this.lagObserver = lagObserver lagObserver.start() newHead diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt index fd0674ff..7f79bf95 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt @@ -24,7 +24,11 @@ import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.data.BlockId import io.emeraldpay.dshackle.reader.Reader import io.emeraldpay.dshackle.startup.QuorumForLabels -import io.emeraldpay.dshackle.upstream.* +import io.emeraldpay.dshackle.upstream.Capability +import io.emeraldpay.dshackle.upstream.Head +import io.emeraldpay.dshackle.upstream.Selector +import io.emeraldpay.dshackle.upstream.Upstream +import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstream import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice @@ -55,7 +59,8 @@ open class EthereumGrpcUpstream( "${parentId}_${chain.chainCode.lowercase(Locale.getDefault())}", UpstreamsConfig.Options.getDefaults(), role, - null, null + null, + null ), GrpcUpstream, Lifecycle {