Search in sources :

Example 1 with EthLog

use of org.bcos.web3j.protocol.core.methods.response.EthLog in project web3sdk by FISCO-BCOS.

the class Filter method pollFilter.

private void pollFilter(EthFilter ethFilter) {
    EthLog ethLog = null;
    try {
        ethLog = web3j.ethGetFilterChanges(filterId).send();
    } catch (IOException e) {
        throwException(e);
    }
    if (ethLog.hasError()) {
        throwException(ethFilter.getError());
    }
    process(ethLog.getLogs());
}
Also used : EthLog(org.bcos.web3j.protocol.core.methods.response.EthLog) IOException(java.io.IOException)

Example 2 with EthLog

use of org.bcos.web3j.protocol.core.methods.response.EthLog in project web3sdk by FISCO-BCOS.

the class Filter method getInitialFilterLogs.

private void getInitialFilterLogs() {
    try {
        Optional<Request<?, EthLog>> maybeRequest = this.getFilterLogs(this.filterId);
        EthLog ethLog;
        if (maybeRequest.isPresent()) {
            ethLog = maybeRequest.get().send();
        } else {
            ethLog = new EthLog();
            ethLog.setResult(Collections.emptyList());
        }
        process(ethLog.getLogs());
    } catch (IOException e) {
        throwException(e);
    }
}
Also used : Request(org.bcos.web3j.protocol.core.Request) EthLog(org.bcos.web3j.protocol.core.methods.response.EthLog) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)2 EthLog (org.bcos.web3j.protocol.core.methods.response.EthLog)2 Request (org.bcos.web3j.protocol.core.Request)1