org.fisco.bcos.web3j.tx.Contract Java Examples

The following examples show how to use org.fisco.bcos.web3j.tx.Contract. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<InsertResultEventResponse> insertResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, InsertResultEventResponse>() {
                        @Override
                        public InsertResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(INSERTRESULT_EVENT, log);
                            InsertResultEventResponse typedResponse =
                                    new InsertResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #2
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public Flowable<ErrorRepeatSignaturesEventEventResponse> errorRepeatSignaturesEventEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter).map(new io.reactivex.functions.Function<Log, ErrorRepeatSignaturesEventEventResponse>() {
        @Override
        public ErrorRepeatSignaturesEventEventResponse apply(Log log) {
            Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(ERRORREPEATSIGNATURESEVENT_EVENT, log);
            ErrorRepeatSignaturesEventEventResponse typedResponse = new ErrorRepeatSignaturesEventEventResponse();
            typedResponse.log = log;
            typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.id = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse.addr = (String) eventValues.getNonIndexedValues().get(5).getValue();
            return typedResponse;
        }
    });
}
 
Example #3
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public List<AddSignaturesEventEventResponse> getAddSignaturesEventEvents(TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(ADDSIGNATURESEVENT_EVENT, transactionReceipt);
    ArrayList<AddSignaturesEventEventResponse> responses = new ArrayList<AddSignaturesEventEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        AddSignaturesEventEventResponse typedResponse = new AddSignaturesEventEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
        typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
        typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #4
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<InsertResultEventResponse> insertResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, InsertResultEventResponse>() {
                        @Override
                        public InsertResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(INSERTRESULT_EVENT, log);
                            InsertResultEventResponse typedResponse =
                                    new InsertResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #5
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<CreateResultEventResponse> createResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, CreateResultEventResponse>() {
                        @Override
                        public CreateResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(CREATERESULT_EVENT, log);
                            CreateResultEventResponse typedResponse =
                                    new CreateResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #6
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<RemoveResultEventResponse> removeResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, RemoveResultEventResponse>() {
                        @Override
                        public RemoveResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(REMOVERESULT_EVENT, log);
                            RemoveResultEventResponse typedResponse =
                                    new RemoveResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #7
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<UpdateResultEventResponse> updateResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, UpdateResultEventResponse>() {
                        @Override
                        public UpdateResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(UPDATERESULT_EVENT, log);
                            UpdateResultEventResponse typedResponse =
                                    new UpdateResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #8
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public Flowable<NewSignaturesEventEventResponse> newSignaturesEventEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter).map(new io.reactivex.functions.Function<Log, NewSignaturesEventEventResponse>() {
        @Override
        public NewSignaturesEventEventResponse apply(Log log) {
            Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(NEWSIGNATURESEVENT_EVENT, log);
            NewSignaturesEventEventResponse typedResponse = new NewSignaturesEventEventResponse();
            typedResponse.log = log;
            typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
            typedResponse.addr = (String) eventValues.getNonIndexedValues().get(6).getValue();
            return typedResponse;
        }
    });
}
 
Example #9
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public List<ErrorNewSignaturesEventEventResponse> getErrorNewSignaturesEventEvents(TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(ERRORNEWSIGNATURESEVENT_EVENT, transactionReceipt);
    ArrayList<ErrorNewSignaturesEventEventResponse> responses = new ArrayList<ErrorNewSignaturesEventEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        ErrorNewSignaturesEventEventResponse typedResponse = new ErrorNewSignaturesEventEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
        typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
        typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
        typedResponse.addr = (String) eventValues.getNonIndexedValues().get(6).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #10
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public Flowable<ErrorNewSignaturesEventEventResponse> errorNewSignaturesEventEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter).map(new io.reactivex.functions.Function<Log, ErrorNewSignaturesEventEventResponse>() {
        @Override
        public ErrorNewSignaturesEventEventResponse apply(Log log) {
            Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(ERRORNEWSIGNATURESEVENT_EVENT, log);
            ErrorNewSignaturesEventEventResponse typedResponse = new ErrorNewSignaturesEventEventResponse();
            typedResponse.log = log;
            typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
            typedResponse.addr = (String) eventValues.getNonIndexedValues().get(6).getValue();
            return typedResponse;
        }
    });
}
 
Example #11
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public List<ErrorAddSignaturesEventEventResponse> getErrorAddSignaturesEventEvents(TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(ERRORADDSIGNATURESEVENT_EVENT, transactionReceipt);
    ArrayList<ErrorAddSignaturesEventEventResponse> responses = new ArrayList<ErrorAddSignaturesEventEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        ErrorAddSignaturesEventEventResponse typedResponse = new ErrorAddSignaturesEventEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
        typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
        typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
        typedResponse.addr = (String) eventValues.getNonIndexedValues().get(6).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #12
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public Flowable<ErrorAddSignaturesEventEventResponse> errorAddSignaturesEventEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter).map(new io.reactivex.functions.Function<Log, ErrorAddSignaturesEventEventResponse>() {
        @Override
        public ErrorAddSignaturesEventEventResponse apply(Log log) {
            Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(ERRORADDSIGNATURESEVENT_EVENT, log);
            ErrorAddSignaturesEventEventResponse typedResponse = new ErrorAddSignaturesEventEventResponse();
            typedResponse.log = log;
            typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
            typedResponse.addr = (String) eventValues.getNonIndexedValues().get(6).getValue();
            return typedResponse;
        }
    });
}
 
Example #13
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public List<AddRepeatSignaturesEventEventResponse> getAddRepeatSignaturesEventEvents(TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(ADDREPEATSIGNATURESEVENT_EVENT, transactionReceipt);
    ArrayList<AddRepeatSignaturesEventEventResponse> responses = new ArrayList<AddRepeatSignaturesEventEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        AddRepeatSignaturesEventEventResponse typedResponse = new AddRepeatSignaturesEventEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
        typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
        typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #14
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public Flowable<AddRepeatSignaturesEventEventResponse> addRepeatSignaturesEventEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter).map(new io.reactivex.functions.Function<Log, AddRepeatSignaturesEventEventResponse>() {
        @Override
        public AddRepeatSignaturesEventEventResponse apply(Log log) {
            Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(ADDREPEATSIGNATURESEVENT_EVENT, log);
            AddRepeatSignaturesEventEventResponse typedResponse = new AddRepeatSignaturesEventEventResponse();
            typedResponse.log = log;
            typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
            return typedResponse;
        }
    });
}
 
Example #15
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public List<NewSignaturesEventEventResponse> getNewSignaturesEventEvents(TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(NEWSIGNATURESEVENT_EVENT, transactionReceipt);
    ArrayList<NewSignaturesEventEventResponse> responses = new ArrayList<NewSignaturesEventEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        NewSignaturesEventEventResponse typedResponse = new NewSignaturesEventEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.id = (String) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
        typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
        typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(5).getValue();
        typedResponse.addr = (String) eventValues.getNonIndexedValues().get(6).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #16
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<UpdateResultEventResponse> updateResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, UpdateResultEventResponse>() {
                        @Override
                        public UpdateResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(UPDATERESULT_EVENT, log);
                            UpdateResultEventResponse typedResponse =
                                    new UpdateResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #17
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<SelectResultEventResponse> selectResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, SelectResultEventResponse>() {
                        @Override
                        public SelectResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(SELECTRESULT_EVENT, log);
                            SelectResultEventResponse typedResponse =
                                    new SelectResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.name =
                                    (byte[])
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            typedResponse.item_id =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(1).getValue();
                            typedResponse.item_name =
                                    (byte[])
                                            eventValues.getNonIndexedValues().get(2).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #18
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public List<SelectResultEventResponse> getSelectResultEvents(
        TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList =
            extractEventParametersWithLog(SELECTRESULT_EVENT, transactionReceipt);
    ArrayList<SelectResultEventResponse> responses =
            new ArrayList<SelectResultEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        SelectResultEventResponse typedResponse = new SelectResultEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.name = (byte[]) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.item_id =
                (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.item_name = (byte[]) eventValues.getNonIndexedValues().get(2).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #19
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<CreateResultEventResponse> createResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, CreateResultEventResponse>() {
                        @Override
                        public CreateResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(CREATERESULT_EVENT, log);
                            CreateResultEventResponse typedResponse =
                                    new CreateResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #20
Source File: OkD.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<InsertResultEventResponse> insertResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, InsertResultEventResponse>() {
                        @Override
                        public InsertResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(INSERTRESULT_EVENT, log);
                            InsertResultEventResponse typedResponse =
                                    new InsertResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #21
Source File: Ok.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<TransEventEventResponse> transEventEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, TransEventEventResponse>() {
                        @Override
                        public TransEventEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(TRANSEVENT_EVENT, log);
                            TransEventEventResponse typedResponse =
                                    new TransEventEventResponse();
                            typedResponse.log = log;
                            typedResponse.num =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #22
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<RemoveResultEventResponse> removeResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, RemoveResultEventResponse>() {
                        @Override
                        public RemoveResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(REMOVERESULT_EVENT, log);
                            RemoveResultEventResponse typedResponse =
                                    new RemoveResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #23
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<UpdateResultEventResponse> updateResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, UpdateResultEventResponse>() {
                        @Override
                        public UpdateResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(UPDATERESULT_EVENT, log);
                            UpdateResultEventResponse typedResponse =
                                    new UpdateResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #24
Source File: AbiUtil.java    From WeBASE-Front with Apache License 2.0 6 votes vote down vote up
/**
 * receiptParse.
 * 
 * @param receipt info
 * @param abiList info
 * @return
 */
public static Object receiptParse(TransactionReceipt receipt, List<AbiDefinition> abiList)
    throws FrontException {
    Map<String, Object> resultMap = new HashMap<>();
    List<Log> logList = receipt.getLogs();
    for (AbiDefinition abiDefinition : abiList) {
        String eventName = abiDefinition.getName();
        List<String> funcInputTypes = getFuncInputType(abiDefinition);
        List<TypeReference<?>> finalOutputs = outputFormat(funcInputTypes);
        Event event = new Event(eventName,finalOutputs);
        Object result = null;
        for (Log logInfo : logList) {
            EventValues eventValues = Contract.staticExtractEventParameters(event, logInfo);
            if (eventValues != null) {
                result = callResultParse(funcInputTypes, eventValues.getNonIndexedValues());
                break;
            }
        }
        if (result != null) {
            resultMap.put(eventName, result);
        }
    }
    return resultMap;
}
 
Example #25
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<SelectResultEventResponse> selectResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, SelectResultEventResponse>() {
                        @Override
                        public SelectResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(SELECTRESULT_EVENT, log);
                            SelectResultEventResponse typedResponse =
                                    new SelectResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.name =
                                    (byte[])
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            typedResponse.item_id =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(1).getValue();
                            typedResponse.item_name =
                                    (byte[])
                                            eventValues.getNonIndexedValues().get(2).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #26
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public List<SelectResultEventResponse> getSelectResultEvents(
        TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList =
            extractEventParametersWithLog(SELECTRESULT_EVENT, transactionReceipt);
    ArrayList<SelectResultEventResponse> responses =
            new ArrayList<SelectResultEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        SelectResultEventResponse typedResponse = new SelectResultEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.name = (byte[]) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.item_id =
                (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.item_name = (byte[]) eventValues.getNonIndexedValues().get(2).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #27
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<CreateResultEventResponse> createResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, CreateResultEventResponse>() {
                        @Override
                        public CreateResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(CREATERESULT_EVENT, log);
                            CreateResultEventResponse typedResponse =
                                    new CreateResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.count =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #28
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public List<ErrorRepeatSignaturesEventEventResponse> getErrorRepeatSignaturesEventEvents(TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(ERRORREPEATSIGNATURESEVENT_EVENT, transactionReceipt);
    ArrayList<ErrorRepeatSignaturesEventEventResponse> responses = new ArrayList<ErrorRepeatSignaturesEventEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        ErrorRepeatSignaturesEventEventResponse typedResponse = new ErrorRepeatSignaturesEventEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.evi = (String) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.id = (String) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.v = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.r = (byte[]) eventValues.getNonIndexedValues().get(3).getValue();
        typedResponse.s = (byte[]) eventValues.getNonIndexedValues().get(4).getValue();
        typedResponse.addr = (String) eventValues.getNonIndexedValues().get(5).getValue();
        responses.add(typedResponse);
    }
    return responses;
}
 
Example #29
Source File: MixContract.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public Flowable<ReadResultEventResponse> readResultEventFlowable(BcosFilter filter) {
    return web3j.logFlowable(filter)
            .map(
                    new io.reactivex.functions.Function<Log, ReadResultEventResponse>() {
                        @Override
                        public ReadResultEventResponse apply(Log log) {
                            Contract.EventValuesWithLog eventValues =
                                    extractEventParametersWithLog(READRESULT_EVENT, log);
                            ReadResultEventResponse typedResponse =
                                    new ReadResultEventResponse();
                            typedResponse.log = log;
                            typedResponse.name =
                                    (byte[])
                                            eventValues.getNonIndexedValues().get(0).getValue();
                            typedResponse.item_id =
                                    (BigInteger)
                                            eventValues.getNonIndexedValues().get(1).getValue();
                            typedResponse.item_name =
                                    (byte[])
                                            eventValues.getNonIndexedValues().get(2).getValue();
                            return typedResponse;
                        }
                    });
}
 
Example #30
Source File: MixContract.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public List<ReadResultEventResponse> getReadResultEvents(
        TransactionReceipt transactionReceipt) {
    List<Contract.EventValuesWithLog> valueList =
            extractEventParametersWithLog(READRESULT_EVENT, transactionReceipt);
    ArrayList<ReadResultEventResponse> responses =
            new ArrayList<ReadResultEventResponse>(valueList.size());
    for (Contract.EventValuesWithLog eventValues : valueList) {
        ReadResultEventResponse typedResponse = new ReadResultEventResponse();
        typedResponse.log = eventValues.getLog();
        typedResponse.name = (byte[]) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.item_id =
                (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.item_name = (byte[]) eventValues.getNonIndexedValues().get(2).getValue();
        responses.add(typedResponse);
    }
    return responses;
}