Revert "Native subscribe filter"
This commit is contained in:
committed by
GitHub
parent
63d96904b3
commit
2cf8451e4a
@@ -18,7 +18,6 @@ package io.emeraldpay.dshackle.proxy
|
||||
import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp
|
||||
import io.emeraldpay.dshackle.rpc.NativeCall
|
||||
import io.emeraldpay.dshackle.rpc.NativeSubscribe
|
||||
import io.emeraldpay.dshackle.upstream.Selector
|
||||
import io.emeraldpay.etherjar.rpc.json.RequestJson
|
||||
import io.emeraldpay.grpc.Chain
|
||||
import io.micrometer.core.instrument.Counter
|
||||
@@ -109,7 +108,7 @@ class WebsocketHandlerSpec extends Specification {
|
||||
def response2 = [foo: 2]
|
||||
|
||||
def nativeSubscribe = Mock(NativeSubscribe) {
|
||||
1 * it.subscribe(Chain.ETHEREUM, "foo_test", null, Selector.empty) >> Flux.fromIterable([response1, response2])
|
||||
1 * it.subscribe(Chain.ETHEREUM, "foo_test", null) >> Flux.fromIterable([response1, response2])
|
||||
}
|
||||
def handler = new WebsocketHandler(
|
||||
new ReadRpcJson(), new WriteRpcJson(), Stub(NativeCall), nativeSubscribe, requestHandlerFactory, Stub(ProxyServer.RequestMetricsFactory)
|
||||
|
||||
@@ -18,7 +18,6 @@ package io.emeraldpay.dshackle.rpc
|
||||
import com.google.protobuf.ByteString
|
||||
import io.emeraldpay.api.proto.BlockchainOuterClass
|
||||
import io.emeraldpay.dshackle.test.MultistreamHolderMock
|
||||
import io.emeraldpay.dshackle.upstream.Selector
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumSubscribe
|
||||
@@ -34,7 +33,7 @@ class NativeSubscribeSpec extends Specification {
|
||||
def "Call with empty params when not provided"() {
|
||||
setup:
|
||||
def subscribe = Mock(EthereumSubscribe) {
|
||||
1 * it.subscribe("newHeads", null, _ as Selector.AnyLabelMatcher) >> Flux.just("{}")
|
||||
1 * it.subscribe("newHeads", null) >> Flux.just("{}")
|
||||
}
|
||||
def up = Mock(EthereumPosMultiStream) {
|
||||
1 * it.getSubscribe() >> subscribe
|
||||
@@ -66,7 +65,7 @@ class NativeSubscribeSpec extends Specification {
|
||||
params["topics"][0] == "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65"
|
||||
println("ok: $ok")
|
||||
ok
|
||||
}, _ as Selector.AnyLabelMatcher) >> Flux.just("{}")
|
||||
}) >> Flux.just("{}")
|
||||
}
|
||||
def up = Mock(EthereumPosMultiStream) {
|
||||
1 * it.getSubscribe() >> subscribe
|
||||
|
||||
@@ -4,7 +4,6 @@ import io.emeraldpay.api.proto.BlockchainOuterClass
|
||||
import io.emeraldpay.api.proto.Common
|
||||
import io.emeraldpay.dshackle.config.TokensConfig
|
||||
import io.emeraldpay.dshackle.upstream.MultistreamHolder
|
||||
import io.emeraldpay.dshackle.upstream.Selector
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.ERC20Balance
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream
|
||||
@@ -171,8 +170,7 @@ class TrackERC20AddressSpec extends Specification {
|
||||
def logs = Mock(ConnectLogs) {
|
||||
1 * start(
|
||||
[Address.from("0x54EedeAC495271d0F6B175474E89094C44Da98b9")],
|
||||
[Hex32.from("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")],
|
||||
Selector.empty
|
||||
[Hex32.from("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")]
|
||||
) >> { args ->
|
||||
println("ConnectLogs.start $args")
|
||||
Flux.fromIterable(events)
|
||||
|
||||
@@ -20,7 +20,6 @@ package io.emeraldpay.dshackle.test
|
||||
import io.emeraldpay.dshackle.cache.Caches
|
||||
import io.emeraldpay.dshackle.upstream.Head
|
||||
import io.emeraldpay.dshackle.upstream.Multistream
|
||||
import io.emeraldpay.dshackle.upstream.Selector
|
||||
import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinMultistream
|
||||
import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinRpcUpstream
|
||||
import io.emeraldpay.dshackle.upstream.calls.CallMethods
|
||||
@@ -143,14 +142,6 @@ class MultistreamHolderMock implements MultistreamHolder {
|
||||
}
|
||||
return super.getHead()
|
||||
}
|
||||
|
||||
@Override
|
||||
Head getHead(@NotNull Selector.Matcher mather) {
|
||||
if (customHead != null) {
|
||||
return customHead
|
||||
}
|
||||
return super.getHead(mather)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import io.emeraldpay.dshackle.data.BlockContainer
|
||||
import io.emeraldpay.dshackle.data.BlockId
|
||||
import io.emeraldpay.dshackle.data.TxId
|
||||
import io.emeraldpay.dshackle.upstream.Head
|
||||
import io.emeraldpay.dshackle.upstream.Selector
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream
|
||||
import io.emeraldpay.etherjar.domain.BlockHash
|
||||
import io.emeraldpay.etherjar.domain.TransactionId
|
||||
@@ -224,7 +223,7 @@ class ConnectBlockUpdatesSpec extends Specification {
|
||||
1 * getFlux() >> Flux.never()
|
||||
}
|
||||
def up = Mock(EthereumMultistream) {
|
||||
1 * getHead(Selector.empty) >> head
|
||||
1 * getHead() >> head
|
||||
}
|
||||
def connectBlockUpdates = new ConnectBlockUpdates(up)
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package io.emeraldpay.dshackle.upstream.ethereum.subscribe
|
||||
|
||||
import io.emeraldpay.dshackle.test.TestingCommons
|
||||
import io.emeraldpay.dshackle.upstream.Head
|
||||
import io.emeraldpay.dshackle.upstream.Selector
|
||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream
|
||||
import reactor.core.publisher.Flux
|
||||
import reactor.test.StepVerifier
|
||||
@@ -18,12 +17,12 @@ class ConnectNewHeadsSpec extends Specification {
|
||||
])
|
||||
}
|
||||
def up = Mock(EthereumMultistream) {
|
||||
1 * getHead(Selector.empty) >> head
|
||||
1 * getHead() >> head
|
||||
}
|
||||
ConnectNewHeads connectNewHeads = new ConnectNewHeads(up)
|
||||
when:
|
||||
def act1 = connectNewHeads.connect(Selector.empty)
|
||||
def act2 = connectNewHeads.connect(Selector.empty)
|
||||
def act1 = connectNewHeads.connect()
|
||||
def act2 = connectNewHeads.connect()
|
||||
then:
|
||||
StepVerifier.create(act1)
|
||||
.expectNextCount(1)
|
||||
|
||||
Reference in New Issue
Block a user