Remove oracle (#620)

This commit is contained in:
KirillPamPam
2025-01-16 14:02:14 +04:00
committed by GitHub
parent 872f900f8d
commit 35d311ef1b
33 changed files with 70 additions and 417 deletions

View File

@@ -392,7 +392,7 @@ class NativeCallSpec extends Specification {
def "Prepare call adds height selector for not-lagging quorum"() {
setup:
def methods = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
["foo_bar"] as Set, [] as Set, [] as Set, [] as Set
)
methods.setQuorum("foo_bar", "not_lagging")
@@ -434,7 +434,7 @@ class NativeCallSpec extends Specification {
def "Prepare call adds decorator for eth_newFilter"() {
setup:
def methods = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
["eth_newFilter"] as Set, [] as Set, [] as Set, [] as Set
)
methods.setQuorum("eth_newFilter", "always")
@@ -466,7 +466,7 @@ class NativeCallSpec extends Specification {
def "Prepare call adds decorator for eth_getFilterChanges"() {
setup:
def methods = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
["eth_getFilterChanges"] as Set, [] as Set, [] as Set, [] as Set
)
def multistream = new MultistreamHolderMock.EthereumMultistreamMock(Chain.ETHEREUM__MAINNET, TestingCommons.upstream())
@@ -497,7 +497,7 @@ class NativeCallSpec extends Specification {
def "Prepare call adds decorator for eth_uninstallFilter"() {
setup:
def methods = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
["eth_uninstallFilter"] as Set, [] as Set, [] as Set, [] as Set
)
def multistream = new MultistreamHolderMock.EthereumMultistreamMock(Chain.ETHEREUM__MAINNET, TestingCommons.upstream())
@@ -595,7 +595,7 @@ class NativeCallSpec extends Specification {
setup:
def quorum = new AlwaysQuorum()
def methods = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
[] as Set, [] as Set, ["filter"] as Set, [] as Set
)
def multistream = new MultistreamHolderMock.EthereumMultistreamMock(Chain.ETHEREUM__MAINNET, new ArrayList<GenericUpstream>())
@@ -628,7 +628,7 @@ class NativeCallSpec extends Specification {
setup:
def quorum = new AlwaysQuorum()
def methods = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
[] as Set, [] as Set, ["filter"] as Set, [] as Set
)
def multistream = new MultistreamHolderMock.EthereumMultistreamMock(Chain.ETHEREUM__MAINNET, new ArrayList<GenericUpstream>())

View File

@@ -38,7 +38,7 @@ class GenericUpstreamMock extends GenericUpstream {
static CallMethods allMethods() {
new AggregatedCallMethods([
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
new DefaultBitcoinMethods(true),
new DirectCallMethods(["eth_test"])
])

View File

@@ -52,8 +52,6 @@ class MultistreamHolderMock implements MultistreamHolder {
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(TestingCommons.tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
io.emeraldpay.dshackle.upstream.starknet.StarknetChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()),
null, Schedulers.immediate(),
TestingCommons.tracerMock()
)
upstreams[chain].addUpstream(up)
} else {
@@ -106,8 +104,8 @@ class MultistreamHolderMock implements MultistreamHolder {
super(chain, Schedulers.immediate(), null, upstreams, caches, Schedulers.boundedElastic(),
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(new BraveTracer(null, null, null)),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()), null, Schedulers.immediate(),
new BraveTracer(null, null, null))
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()),
)
}
EthereumMultistreamMock(@NotNull Chain chain, @NotNull List<GenericUpstream> upstreams) {

View File

@@ -102,9 +102,6 @@ class TestingCommons {
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()),
null,
Schedulers.immediate(),
tracerMock()
).tap {
it.processUpstreamsEvents(
new UpstreamChangeEvent(Chain.ETHEREUM__MAINNET, up, UpstreamChangeEvent.ChangeType.ADDED)
@@ -132,9 +129,7 @@ class TestingCommons {
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()),
null,
Schedulers.immediate(),
tracerMock())
)
}
static Multistream multistreamClassicWithoutUpstreams(Chain chain) {
@@ -142,9 +137,7 @@ class TestingCommons {
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()),
null,
Schedulers.immediate(),
tracerMock())
)
}
static FileResolver fileResolver() {

View File

@@ -37,7 +37,7 @@ import static java.util.List.of
class FilteredApisSpec extends Specification {
def ethereumTargets = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def ethereumTargets = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def "Verifies labels"() {
setup:

View File

@@ -57,7 +57,7 @@ class MultistreamSpec extends Specification {
Schedulers.boundedElastic(),
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(TestingCommons.tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()), null, Schedulers.immediate(), TestingCommons.tracerMock())
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()))
when:
aggr.onUpstreamsUpdated()
def act = aggr.getMethods()
@@ -192,7 +192,7 @@ class MultistreamSpec extends Specification {
Schedulers.boundedElastic(),
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(TestingCommons.tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()), null, Schedulers.immediate(), TestingCommons.tracerMock())
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()))
expect:
multistream.getHead(new Selector.LabelMatcher("provider", ["internal"])).is(up1.ethereumHeadMock)
@@ -265,7 +265,7 @@ class MultistreamSpec extends Specification {
Schedulers.boundedElastic(),
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(TestingCommons.tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()), null, Schedulers.immediate(), TestingCommons.tracerMock())
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()))
when:
ms.processUpstreamsEvents(
new UpstreamChangeEvent(Chain.ETHEREUM__MAINNET, up1, UpstreamChangeEvent.ChangeType.ADDED)
@@ -296,7 +296,7 @@ class MultistreamSpec extends Specification {
Schedulers.boundedElastic(),
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(TestingCommons.tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()), null, Schedulers.immediate(), TestingCommons.tracerMock())
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()))
def head1 = createBlock(250, "0x0d050c785de17179f935b9b93aca09c442964cc59972c71ae68e74731448401b")
def head2 = createBlock(270, "0x0d050c785de17179f935b9b93aca09c442964cc59972c71ae68e74731448402b")
def head3 = createBlock(100, "0x0d050c785de17179f935b9b93aca09c442964cc59972c71ae68e74731448412b")
@@ -331,7 +331,7 @@ class MultistreamSpec extends Specification {
Schedulers.boundedElastic(),
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(TestingCommons.tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()), null, Schedulers.immediate(), TestingCommons.tracerMock())
EthereumChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()))
multistream.processUpstreamsEvents(
new UpstreamChangeEvent(Chain.ETHEREUM__MAINNET, up1, UpstreamChangeEvent.ChangeType.ADDED)
)
@@ -369,7 +369,7 @@ class MultistreamSpec extends Specification {
Schedulers.boundedElastic(),
EthereumChainSpecific.INSTANCE.makeCachingReaderBuilder(TestingCommons.tracerMock()),
EthereumChainSpecific.INSTANCE.&localReaderBuilder,
StarknetChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()), null, Schedulers.immediate(), TestingCommons.tracerMock())
StarknetChainSpecific.INSTANCE.subscriptionBuilder(Schedulers.boundedElastic()))
}
@NotNull

View File

@@ -7,7 +7,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "eth_chainId is available"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
when:
def act = methods.isAvailable("eth_chainId")
then:
@@ -16,7 +16,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "eth_chainId is hardcoded"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
when:
def act = methods.isHardcoded("eth_chainId")
then:
@@ -25,7 +25,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "eth_chainId is not callable"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
when:
def act = methods.isCallable("eth_chainId")
then:
@@ -34,7 +34,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "Provides hardcoded correct chainId"() {
expect:
new String(new DefaultEthereumMethods(chain, false).executeHardcoded("eth_chainId")) == id
new String(new DefaultEthereumMethods(chain).executeHardcoded("eth_chainId")) == id
where:
chain | id
Chain.ETHEREUM__MAINNET | '"0x1"'
@@ -43,7 +43,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "Optimism chain unsupported methods"() {
setup:
def methods = new DefaultEthereumMethods(Chain.OPTIMISM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.OPTIMISM__MAINNET)
when:
def acc = methods.isAvailable("eth_getAccounts")
def trans = methods.isAvailable("eth_sendTransaction")
@@ -54,7 +54,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "Has supported specific methods"() {
expect:
new DefaultEthereumMethods(chain, false).getSupportedMethods().containsAll(methods)
new DefaultEthereumMethods(chain).getSupportedMethods().containsAll(methods)
where:
chain | methods
Chain.POLYGON__MAINNET | ["bor_getAuthor",
@@ -68,7 +68,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "Has no filter methods by default"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
when:
def act = methods.getSupportedMethods().findAll { it.containsIgnoreCase("filter") }
then:
@@ -77,7 +77,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "Has no trace methods by default"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
when:
def act = methods.getSupportedMethods().findAll { it.containsIgnoreCase("trace") }
then:
@@ -86,7 +86,7 @@ class DefaultEthereumMethodsSpec extends Specification {
def "Default eth methods are available"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
expect:
methods.isAvailable(method)
where:

View File

@@ -94,7 +94,7 @@ class ManagedCallMethodsSpec extends Specification {
def "Use custom quorum if provided"() {
setup:
def managed = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
["eth_test", "eth_foo", "eth_bar"] as Set,
[] as Set,
[] as Set,
@@ -120,7 +120,7 @@ class ManagedCallMethodsSpec extends Specification {
def "Doesn't reuse same instance"() {
def managed = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
["eth_test"] as Set,
[] as Set,
[] as Set,
@@ -145,7 +145,7 @@ class ManagedCallMethodsSpec extends Specification {
def "Test enable method group"() {
setup:
def managed = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
[] as Set,
[] as Set,
["filter"] as Set,
@@ -169,7 +169,7 @@ class ManagedCallMethodsSpec extends Specification {
def "Test enable method group minus one"() {
setup:
def managed = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
[] as Set,
["eth_newPendingTransactionFilter"] as Set,
["filter"] as Set,
@@ -193,7 +193,7 @@ class ManagedCallMethodsSpec extends Specification {
def "Test disabled group not disable enabled method"() {
setup:
def managed = new ManagedCallMethods(
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false),
new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET),
["eth_newPendingTransactionFilter"] as Set,
[] as Set,
[] as Set,

View File

@@ -45,7 +45,7 @@ class EthereumDirectReaderSpec extends Specification {
transactions = []
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -80,7 +80,7 @@ class EthereumDirectReaderSpec extends Specification {
transactions = []
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -107,7 +107,7 @@ class EthereumDirectReaderSpec extends Specification {
def "Produce empty result on non-existing block"() {
setup:
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -140,7 +140,7 @@ class EthereumDirectReaderSpec extends Specification {
transactions = []
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -172,7 +172,7 @@ class EthereumDirectReaderSpec extends Specification {
blockHash = BlockHash.from(hash1)
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -205,7 +205,7 @@ class EthereumDirectReaderSpec extends Specification {
blockHash = BlockHash.from(hash1)
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -238,7 +238,7 @@ class EthereumDirectReaderSpec extends Specification {
blockHash = BlockHash.from(hash1)
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -268,7 +268,7 @@ class EthereumDirectReaderSpec extends Specification {
blockHash = BlockHash.from(hash1)
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
def caches = Mock(Caches) {
// note that the Caches needs a Height value, otherwise it's not cached
@@ -297,7 +297,7 @@ class EthereumDirectReaderSpec extends Specification {
def "Produce empty on non-existing tx"() {
setup:
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
Stub(Multistream), Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -327,7 +327,7 @@ class EthereumDirectReaderSpec extends Specification {
}
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
up, Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -358,7 +358,7 @@ class EthereumDirectReaderSpec extends Specification {
}
}
def calls = Mock(Factory) {
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
1 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
up, Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()
@@ -392,7 +392,7 @@ class EthereumDirectReaderSpec extends Specification {
transactions = []
}
def calls = Mock(Factory) {
3 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
3 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
def result = Mono.just(
new RequestReader.Result(
@@ -432,7 +432,7 @@ class EthereumDirectReaderSpec extends Specification {
transactions = []
}
def calls = Mock(Factory) {
3 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
3 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
def result = Mono.just(
new RequestReader.Result(
@@ -469,7 +469,7 @@ class EthereumDirectReaderSpec extends Specification {
}
}
def calls = Mock(Factory) {
4 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
4 * create() >> new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
}
EthereumDirectReader reader = new EthereumDirectReader(
up, Caches.default(), new CurrentBlockCache(), calls, TestingCommons.tracerMock()

View File

@@ -25,17 +25,16 @@ class EthereumLocalReaderSpec extends Specification {
def "Calls hardcoded"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def router = new EthereumLocalReader(
new EthereumCachingReader(
TestingCommons.multistream(TestingCommons.api()),
Caches.default(),
ConstantFactory.constantFactory(new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)),
ConstantFactory.constantFactory(new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)),
TestingCommons.tracerMock()
),
methods,
new EmptyHead(),
null
)
when:
def act = router.read(new ChainRequest("eth_coinbase", new ListParams())).block(Duration.ofSeconds(1))
@@ -45,17 +44,16 @@ class EthereumLocalReaderSpec extends Specification {
def "Returns empty if nonce set"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def router = new EthereumLocalReader(
new EthereumCachingReader(
TestingCommons.multistream(TestingCommons.api()),
Caches.default(),
ConstantFactory.constantFactory(new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)),
ConstantFactory.constantFactory(new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)),
TestingCommons.tracerMock()
),
methods,
new EmptyHead(),
null
)
when:
def act = router.read(new ChainRequest("eth_getTransactionByHash", new ListParams(["test"]), 10))
@@ -78,8 +76,8 @@ class EthereumLocalReaderSpec extends Specification {
)
}
}
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def router = new EthereumLocalReader(reader, methods, head, null)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def router = new EthereumLocalReader(reader, methods, head)
when:
def act = router.getBlockByNumber(["latest", false], Selector.UpstreamFilter.default)
@@ -106,8 +104,8 @@ class EthereumLocalReaderSpec extends Specification {
)
}
}
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def router = new EthereumLocalReader(reader, methods, head, null)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def router = new EthereumLocalReader(reader, methods, head)
when:
def act = router.getBlockByNumber(["earliest", false], Selector.UpstreamFilter.default)
@@ -134,8 +132,8 @@ class EthereumLocalReaderSpec extends Specification {
)
}
}
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def router = new EthereumLocalReader(reader, methods, head, null)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def router = new EthereumLocalReader(reader, methods, head)
when:
def act = router.getBlockByNumber(["0x123ef", false], Selector.UpstreamFilter.default)
@@ -160,8 +158,8 @@ class EthereumLocalReaderSpec extends Specification {
)
}
}
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def router = new EthereumLocalReader(reader, methods, head, null)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def router = new EthereumLocalReader(reader, methods, head)
when:
def act = router.read(
@@ -188,8 +186,8 @@ class EthereumLocalReaderSpec extends Specification {
_ * txByHashAsCont(Selector.UpstreamFilter.default) >> new EmptyReader<>()
_ * blocksByHeightAsCont(Selector.UpstreamFilter.default) >> new EmptyReader<>()
}
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET, false)
def router = new EthereumLocalReader(reader, methods, head, null)
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
def router = new EthereumLocalReader(reader, methods, head)
when:
def act = router.getBlockByNumber(["0x0", true], Selector.UpstreamFilter.default)

View File

@@ -180,9 +180,6 @@ class ReloadConfigTest {
cs.makeCachingReaderBuilder(mock<Tracer>()),
cs::localReaderBuilder,
cs.subscriptionBuilder(Schedulers.boundedElastic()),
null,
Schedulers.fromExecutor(Executors.newFixedThreadPool(6)),
mock<Tracer>(),
)
}