@Test public void testReplayBlocksObservable() throws Exception { List<EthBlock> ethBlocks = Arrays.asList(createBlock(0), createBlock(1), createBlock(2)); OngoingStubbing<EthBlock> stubbing = when(web3jService.send(any(Request.class), eq(EthBlock.class))); for (EthBlock ethBlock : ethBlocks) { stubbing = stubbing.thenReturn(ethBlock); } Observable<EthBlock> observable = web3j.replayBlocksObservable( new DefaultBlockParameterNumber(BigInteger.ZERO), new DefaultBlockParameterNumber(BigInteger.valueOf(2)), false); CountDownLatch transactionLatch = new CountDownLatch(ethBlocks.size()); CountDownLatch completedLatch = new CountDownLatch(1); List<EthBlock> results = new ArrayList<>(ethBlocks.size()); Subscription subscription = observable.subscribe( result -> { results.add(result); transactionLatch.countDown(); }, throwable -> fail(throwable.getMessage()), () -> completedLatch.countDown()); transactionLatch.await(1, TimeUnit.SECONDS); assertThat(results, equalTo(ethBlocks)); subscription.unsubscribe(); completedLatch.await(1, TimeUnit.SECONDS); assertTrue(subscription.isUnsubscribed()); }
public Observable<EthBlock> replayBlocksObservable( DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects) { return replayBlocksObservable(startBlock, endBlock, fullTransactionObjects, true); }
JsonRpc2_0Rx { public Observable<EthBlock> replayBlocksObservable( DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects) { return replayBlocksObservable(startBlock, endBlock, fullTransactionObjects, true); } }
JsonRpc2_0Rx { public Observable<EthBlock> replayBlocksObservable( DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects) { return replayBlocksObservable(startBlock, endBlock, fullTransactionObjects, true); } JsonRpc2_0Rx(Web3j web3j, ScheduledExecutorService scheduledExecutorService); }
JsonRpc2_0Rx { public Observable<EthBlock> replayBlocksObservable( DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects) { return replayBlocksObservable(startBlock, endBlock, fullTransactionObjects, true); } JsonRpc2_0Rx(Web3j web3j, ScheduledExecutorService scheduledExecutorService); Observable<String> ethBlockHashObservable(long pollingInterval); Observable<String> ethPendingTransactionHashObservable(long pollingInterval); Observable<Log> ethLogObservable(
            org.web3j.protocol.core.methods.request.EthFilter ethFilter, long pollingInterval); Observable<Transaction> transactionObservable(long pollingInterval); Observable<Transaction> pendingTransactionObservable(long pollingInterval); Observable<EthBlock> blockObservable(
            boolean fullTransactionObjects, long pollingInterval); Observable<EthBlock> replayBlocksObservable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock,
            boolean fullTransactionObjects); Observable<EthBlock> replayBlocksObservable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock,
            boolean fullTransactionObjects, boolean ascending); Observable<Transaction> replayTransactionsObservable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock); Observable<EthBlock> catchUpToLatestBlockObservable(
            DefaultBlockParameter startBlock, boolean fullTransactionObjects,
            Observable<EthBlock> onCompleteObservable); Observable<EthBlock> catchUpToLatestBlockObservable(
            DefaultBlockParameter startBlock, boolean fullTransactionObjects); Observable<Transaction> catchUpToLatestTransactionObservable(
            DefaultBlockParameter startBlock); Observable<EthBlock> catchUpToLatestAndSubscribeToNewBlocksObservable(
            DefaultBlockParameter startBlock, boolean fullTransactionObjects,
            long pollingInterval); Observable<Transaction> catchUpToLatestAndSubscribeToNewTransactionsObservable(
            DefaultBlockParameter startBlock, long pollingInterval); }
JsonRpc2_0Rx { public Observable<EthBlock> replayBlocksObservable( DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects) { return replayBlocksObservable(startBlock, endBlock, fullTransactionObjects, true); } JsonRpc2_0Rx(Web3j web3j, ScheduledExecutorService scheduledExecutorService); Observable<String> ethBlockHashObservable(long pollingInterval); Observable<String> ethPendingTransactionHashObservable(long pollingInterval); Observable<Log> ethLogObservable(
            org.web3j.protocol.core.methods.request.EthFilter ethFilter, long pollingInterval); Observable<Transaction> transactionObservable(long pollingInterval); Observable<Transaction> pendingTransactionObservable(long pollingInterval); Observable<EthBlock> blockObservable(
            boolean fullTransactionObjects, long pollingInterval); Observable<EthBlock> replayBlocksObservable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock,
            boolean fullTransactionObjects); Observable<EthBlock> replayBlocksObservable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock,
            boolean fullTransactionObjects, boolean ascending); Observable<Transaction> replayTransactionsObservable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock); Observable<EthBlock> catchUpToLatestBlockObservable(
            DefaultBlockParameter startBlock, boolean fullTransactionObjects,
            Observable<EthBlock> onCompleteObservable); Observable<EthBlock> catchUpToLatestBlockObservable(
            DefaultBlockParameter startBlock, boolean fullTransactionObjects); Observable<Transaction> catchUpToLatestTransactionObservable(
            DefaultBlockParameter startBlock); Observable<EthBlock> catchUpToLatestAndSubscribeToNewBlocksObservable(
            DefaultBlockParameter startBlock, boolean fullTransactionObjects,
            long pollingInterval); Observable<Transaction> catchUpToLatestAndSubscribeToNewTransactionsObservable(
            DefaultBlockParameter startBlock, long pollingInterval);  }