fix linter errors again

This commit is contained in:
terminal
2022-08-18 21:08:04 +04:00
parent 550db9c510
commit f9db37cb9e
4 changed files with 14 additions and 9 deletions

View File

@@ -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<Multistream> {
EthereumPosMultistream(chain, ArrayList(), cachesFactory.getCaches(chain))
EthereumPosMultiStream(chain, ArrayList(), cachesFactory.getCaches(chain))
}
processUpdate(change, up, current, factory)
}

View File

@@ -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<Upstream>
) : 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 {

View File

@@ -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<EthereumPosUpstream>,
caches: Caches
) : Multistream(chain, upstreams as MutableList<Upstream>, 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<Upstream>)
val lagObserver = EthereumPosHeadLagObserver(newHead, upstreams as Collection<Upstream>)
this.lagObserver = lagObserver
lagObserver.start()
newHead

View File

@@ -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 {