use of org.fisco.bcos.web3j.tx.gas.ContractGasProvider in project web3sdk by FISCO-BCOS.
the class GMTableTestClient method testTableTest.
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void testTableTest(String[] args) throws Exception {
final Resource contractResource = new ClassPathResource("contract.properties");
PropertiesConfiguration prop = new PropertiesConfiguration(contractResource.getFile());
Object addressObj = prop.getProperty("crud_address");
if (addressObj != null) {
contractAddress = (String) addressObj;
} else {
deployTableTest();
}
ContractGasProvider contractGasProvider = new StaticGasProvider(gasPrice, gasLimit);
TableTest tabletest = TableTest.load(contractAddress, web3j, credentials, contractGasProvider);
// create table
if ("create".equals(args[0])) {
create(tabletest);
} else // insert
if ("insert".equals(args[0])) {
insert(args, tabletest);
} else // select
if ("select".equals(args[0])) {
select(args, tabletest);
} else // update
if ("update".equals(args[0])) {
update(args, tabletest);
} else // remove
if ("remove".equals(args[0])) {
remove(args, tabletest);
} else {
System.out.println("\nPlease choose follow commands:\n deploy, create, insert, select, update or remove");
}
}
Aggregations