From c6f22ce91af712d8fedc89dec2a01403b72eebfe Mon Sep 17 00:00:00 2001 From: terminal Date: Mon, 1 Aug 2022 13:51:16 +0400 Subject: [PATCH] fix some issues after merge --- .../io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt | 3 +-- .../dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt index 18bc1b82..6fd9b254 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/config/UpstreamsConfigReader.kt @@ -101,7 +101,7 @@ class UpstreamsConfigReader( val connConfigNode = getMapping(connNode, "grpc")!! val upstream = UpstreamsConfig.Upstream() readUpstreamCommon(upNode, upstream) - readUpstreamGrpc(upNode, upstream) + readUpstreamGrpc(upNode) if (isValid(upstream)) { config.upstreams.add(upstream) val connection = UpstreamsConfig.GrpcConnection() @@ -245,7 +245,6 @@ class UpstreamsConfigReader( internal fun readUpstreamGrpc( upNode: MappingNode, - upstream: UpstreamsConfig.Upstream ) { // Dshackle gRPC connection dispatches requests to different upstreams, which may // be on different blockchains, and each may have different set of labels. diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt index 3735c98a..1f0e7807 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt @@ -48,7 +48,7 @@ open class EthereumPosGrpcUpstream( private val parentId: String, role: UpstreamsConfig.UpstreamRole, private val chain: Chain, - remote: ReactorBlockchainGrpc.ReactorBlockchainStub, + private val remote: ReactorBlockchainGrpc.ReactorBlockchainStub, client: JsonRpcGrpcClient, nodeRating: Int ) : EthereumPosUpstream( @@ -121,6 +121,10 @@ open class EthereumPosGrpcUpstream( return upstreamStatus.getNodes() } + override fun getBlockchainApi(): ReactorBlockchainGrpc.ReactorBlockchainStub { + return remote + } + // ------------------------------------------------------------------------------------------ override fun getLabels(): Collection {