diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt index e1bfee35..7a47fa86 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt @@ -56,7 +56,7 @@ open class EthereumEgressSubscription( const val METHOD_NEW_HEADS = "newHeads" const val METHOD_LOGS = "logs" const val METHOD_PENDING_TXES = "newPendingTransactions" - const val METHOD_PENDING_TXES_WITH_BODY = "newPendingTransactionsWithBody" + const val METHOD_DRPC_PENDING_TXES = "drpc_pendingTransactions" } private val newHeads = ConnectNewHeads(upstream, scheduler) @@ -73,7 +73,7 @@ open class EthereumEgressSubscription( listOf() } return if (pendingTxesSource != null) { - subs.plus(listOf(METHOD_PENDING_TXES, METHOD_PENDING_TXES_WITH_BODY)) + subs.plus(listOf(METHOD_PENDING_TXES, METHOD_DRPC_PENDING_TXES)) } else { subs } @@ -98,7 +98,7 @@ open class EthereumEgressSubscription( } if (topic == METHOD_PENDING_TXES) { return pendingTxesSource?.connect(matcher) ?: Flux.empty() - } else if (topic == METHOD_PENDING_TXES_WITH_BODY) { + } else if (topic == METHOD_DRPC_PENDING_TXES) { return pendingTxesSource?.connect(matcher)?.flatMap { txHash -> // Create request to get full transaction val request = ChainRequest( diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy index 3d16893f..f93c88a0 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy @@ -220,7 +220,7 @@ class EthereumEgressSubscriptionSpec extends Specification { up3.start() def ethereumSubscribe3 = new EthereumEgressSubscription(TestingCommons.multistream(up3) as GenericMultistream, Schedulers.boundedElastic(), Stub(PendingTxesSource)) then: - ethereumSubscribe3.getAvailableTopics().toSet() == [EthereumEgressSubscription.METHOD_LOGS, EthereumEgressSubscription.METHOD_NEW_HEADS, EthereumEgressSubscription.METHOD_PENDING_TXES, EthereumEgressSubscription.METHOD_PENDING_TXES_WITH_BODY].toSet() + ethereumSubscribe3.getAvailableTopics().toSet() == [EthereumEgressSubscription.METHOD_LOGS, EthereumEgressSubscription.METHOD_NEW_HEADS, EthereumEgressSubscription.METHOD_PENDING_TXES, EthereumEgressSubscription.METHOD_DRPC_PENDING_TXES].toSet() when: def up4 = TestingCommons.upstream(TestingCommons.api(), "eth_getBlockByNumber") up4.getConnectorMock().setLiveness(Flux.just(HeadLivenessState.OK))