use of org.fisco.bcos.channel.test.contract.TableTest.InsertResultEventResponse in project web3sdk by FISCO-BCOS.
the class TableTestClient method insert.
private static void insert(String[] args, TableTest tabletest) {
if (args.length == 4) {
try {
String name = args[1];
int item_id = Integer.parseInt(args[2]);
String item_name = args[3];
RemoteCall<TransactionReceipt> insert = tabletest.insert(name, BigInteger.valueOf(item_id), item_name);
TransactionReceipt txReceipt = insert.send();
List<InsertResultEventResponse> insertResultEvents = tabletest.getInsertResultEvents(txReceipt);
if (insertResultEvents.size() > 0) {
for (int i = 0; i < insertResultEvents.size(); i++) {
InsertResultEventResponse insertResultEventResponse = insertResultEvents.get(i);
logger.info("insertCount = " + insertResultEventResponse.count.intValue());
System.out.println("insertCount = " + insertResultEventResponse.count.intValue());
}
} else {
System.out.println("t_test table does not exist.");
}
} catch (Exception e) {
System.out.println("insert transaction is abnormal, please check the environment");
}
} else {
System.out.println("\nPlease enter as follow example:\n 1 1 insert fruit 1 apple");
}
}
Aggregations