From 39535f20f28906e5bc81866c61206f8408183c33 Mon Sep 17 00:00:00 2001 From: Cletitia Date: Fri, 13 Aug 2021 11:44:29 +0800 Subject: [PATCH 1/2] fix(core): fix the problem that the contract method without ABI cannot be called --- .../org/tron/trident/core/ApiWrapper.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) 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 From 05d8fa54a1bcf3442519d93227ab9cf54a7cfe1a Mon Sep 17 00:00:00 2001 From: Cletitia Date: Fri, 13 Aug 2021 11:45:34 +0800 Subject: [PATCH 2/2] v0.2.1 --- trident-java/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {