|
19 | 19 | import java.util.Collections;
|
20 | 20 | import java.util.List;
|
21 | 21 | import java.util.Map;
|
| 22 | +import java.util.concurrent.ScheduledExecutorService; |
22 | 23 | import java.util.stream.Collectors;
|
23 | 24 |
|
| 25 | +import io.reactivex.Flowable; |
| 26 | + |
24 | 27 | import org.web3j.crypto.Credentials;
|
25 | 28 | import org.web3j.protocol.Web3jService;
|
26 | 29 | import org.web3j.protocol.admin.methods.response.BooleanResponse;
|
|
36 | 39 | import org.web3j.protocol.besu.response.privacy.PrivateTransactionReceipt;
|
37 | 40 | import org.web3j.protocol.core.DefaultBlockParameter;
|
38 | 41 | import org.web3j.protocol.core.Request;
|
| 42 | +import org.web3j.protocol.core.methods.request.EthFilter; |
39 | 43 | import org.web3j.protocol.core.methods.request.Transaction;
|
40 | 44 | import org.web3j.protocol.core.methods.response.EthAccounts;
|
41 | 45 | import org.web3j.protocol.core.methods.response.EthCall;
|
|
44 | 48 | import org.web3j.protocol.core.methods.response.EthLog;
|
45 | 49 | import org.web3j.protocol.core.methods.response.EthSendTransaction;
|
46 | 50 | import org.web3j.protocol.core.methods.response.EthUninstallFilter;
|
| 51 | +import org.web3j.protocol.core.methods.response.Log; |
47 | 52 | import org.web3j.protocol.core.methods.response.MinerStartResponse;
|
48 | 53 | import org.web3j.protocol.eea.JsonRpc2_0Eea;
|
49 | 54 | import org.web3j.protocol.exceptions.TransactionException;
|
50 | 55 | import org.web3j.tx.response.PollingPrivateTransactionReceiptProcessor;
|
| 56 | +import org.web3j.utils.Async; |
51 | 57 | import org.web3j.utils.Base64String;
|
52 | 58 |
|
53 | 59 | import static java.util.Objects.requireNonNull;
|
54 | 60 |
|
55 | 61 | public class JsonRpc2_0Besu extends JsonRpc2_0Eea implements Besu {
|
56 |
| - public JsonRpc2_0Besu(Web3jService web3jService) { |
57 |
| - super(web3jService); |
| 62 | + |
| 63 | + private final JsonRpc2_0BesuRx besuRx; |
| 64 | + private final long blockTime; |
| 65 | + |
| 66 | + public JsonRpc2_0Besu(final Web3jService web3jService) { |
| 67 | + this(web3jService, DEFAULT_BLOCK_TIME, Async.defaultExecutorService()); |
| 68 | + } |
| 69 | + |
| 70 | + public JsonRpc2_0Besu( |
| 71 | + Web3jService web3jService, |
| 72 | + long pollingInterval, |
| 73 | + ScheduledExecutorService scheduledExecutorService) { |
| 74 | + super(web3jService, pollingInterval, scheduledExecutorService); |
| 75 | + this.besuRx = new JsonRpc2_0BesuRx(this, scheduledExecutorService); |
| 76 | + this.blockTime = pollingInterval; |
58 | 77 | }
|
59 | 78 |
|
60 | 79 | @Override
|
@@ -396,4 +415,9 @@ public Request<?, EthLog> privGetFilterLogs(String privacyGroupId, String filter
|
396 | 415 | web3jService,
|
397 | 416 | EthLog.class);
|
398 | 417 | }
|
| 418 | + |
| 419 | + @Override |
| 420 | + public Flowable<Log> privLogFlowable(final String privacyGroupId, final EthFilter ethFilter) { |
| 421 | + return besuRx.privLogFlowable(privacyGroupId, ethFilter, blockTime); |
| 422 | + } |
399 | 423 | }
|
0 commit comments