small after merge fixes: block by number finalized

This commit is contained in:
terminal
2022-09-19 16:59:22 +03:00
parent 48a5b3fbdf
commit 58cc10f3bb
2 changed files with 5 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ import io.emeraldpay.dshackle.upstream.Multistream
import io.emeraldpay.dshackle.upstream.MultistreamHolder import io.emeraldpay.dshackle.upstream.MultistreamHolder
import io.emeraldpay.dshackle.upstream.Selector import io.emeraldpay.dshackle.upstream.Selector
import io.emeraldpay.dshackle.upstream.calls.EthereumCallSelector import io.emeraldpay.dshackle.upstream.calls.EthereumCallSelector
import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
@@ -65,7 +65,7 @@ open class NativeCall(
if ((BlockchainType.from(chain) == BlockchainType.ETHEREUM_POS || BlockchainType.from(chain) == BlockchainType.ETHEREUM) && !ethereumCallSelectors.containsKey(chain) if ((BlockchainType.from(chain) == BlockchainType.ETHEREUM_POS || BlockchainType.from(chain) == BlockchainType.ETHEREUM) && !ethereumCallSelectors.containsKey(chain)
) { ) {
multistreamHolder.getUpstream(chain)?.let { up -> multistreamHolder.getUpstream(chain)?.let { up ->
val reader = up.cast(EthereumMultistream::class.java).getReader() val reader = up.cast(EthereumPosMultiStream::class.java).getReader()
ethereumCallSelectors[chain] = EthereumCallSelector(reader.heightByHash()) ethereumCallSelectors[chain] = EthereumCallSelector(reader.heightByHash())
} }
} }

View File

@@ -152,6 +152,9 @@ class LocalCallRouter(
blockRef == "earliest" -> { blockRef == "earliest" -> {
number = 0 number = 0
} }
blockRef == "finalized" -> {
return null
}
blockRef == "pending" -> { blockRef == "pending" -> {
return null return null
} }