diff --git a/trident-java/build.gradle b/trident-java/build.gradle index 7fbc31c..35317d6 100644 --- a/trident-java/build.gradle +++ b/trident-java/build.gradle @@ -8,7 +8,7 @@ ext { } allprojects { - version '0.2.0' + version '0.2.1' group = 'org.tron.trident' repositories { diff --git a/trident-java/core/src/main/java/org/tron/trident/core/ApiWrapper.java b/trident-java/core/src/main/java/org/tron/trident/core/ApiWrapper.java index ed14669..330e667 100644 --- a/trident-java/core/src/main/java/org/tron/trident/core/ApiWrapper.java +++ b/trident-java/core/src/main/java/org/tron/trident/core/ApiWrapper.java @@ -1431,15 +1431,13 @@ private TransactionExtention callWithoutBroadcast(String ownerAddr, Contract cnt * @param contractAddr smart contract address. * @param function contract function. * @return TransactionExtention. - * @throws RuntimeException if function cannot be found in the contract. */ public TransactionExtention constantCall(String ownerAddr, String contractAddr, Function function) { Contract cntr = getContract(contractAddr); - if (isFuncInContract(cntr, function)) { - return callWithoutBroadcast(ownerAddr, cntr, function); - } else { - throw new RuntimeException("Function not found in the contract"); - } + + TransactionExtention txnExt = callWithoutBroadcast(ownerAddr, cntr, function); + + return txnExt; } /** @@ -1448,16 +1446,13 @@ public TransactionExtention constantCall(String ownerAddr, String contractAddr, * @param contractAddr smart contract address * @param function contract function * @return transaction builder. Users may set other fields, e.g. feeLimit - * @throws RuntimeException if function cannot be found in the contract */ public TransactionBuilder triggerCall(String ownerAddr, String contractAddr, Function function) { Contract cntr = getContract(contractAddr); - if (isFuncInContract(cntr, function)) { - TransactionExtention txnExt = callWithoutBroadcast(ownerAddr, cntr, function); - return new TransactionBuilder(txnExt.getTransaction()); - } else { - throw new RuntimeException("Function not found in the contract"); - } + + TransactionExtention txnExt = callWithoutBroadcast(ownerAddr, cntr, function); + + return new TransactionBuilder(txnExt.getTransaction()); } } \ No newline at end of file