Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding method to abi result object #334

Merged
merged 3 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ public ExecuteResult execute(AlgodClient client, int waitRounds) throws Exceptio
signedTxns.get(i).transactionID,
null,
null,
this.methodMap.get(i),
new Exception(resp.message()),
null
));
Expand All @@ -290,6 +291,7 @@ public ExecuteResult execute(AlgodClient client, int waitRounds) throws Exceptio
currentTxInfo.txn.transactionID,
null,
null,
this.methodMap.get(i),
null,
currentTxInfo
));
Expand All @@ -315,6 +317,7 @@ public ExecuteResult execute(AlgodClient client, int waitRounds) throws Exceptio
currentTxInfo.txn.transactionID,
abiEncoded,
decoded,
this.methodMap.get(i),
parseError,
currentTxInfo
));
Expand Down Expand Up @@ -349,14 +352,16 @@ public static class ReturnValue {
public String txID;
public byte[] rawValue;
public Object value;
public Method method;
public Exception parseError;
public PendingTransactionResponse txInfo;

public ReturnValue(String txID, byte[] rawValue, Object value,
Exception parseError, PendingTransactionResponse txInfo) {
public ReturnValue(String txID, byte[] rawValue, Object value, Method method,
Exception parseError,PendingTransactionResponse txInfo) {
barnjamin marked this conversation as resolved.
Show resolved Hide resolved
this.txID = txID;
this.rawValue = rawValue;
this.value = value;
this.method = method;
this.parseError = parseError;
this.txInfo = txInfo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class AtomicTxnComposer {
AtomicTransactionComposer.ExecuteResult execRes;
SplitAndProcessMethodArgs abiArgProcessor;
Long appID;
List<Method> composerMethods;
String nonce;

public AtomicTxnComposer(Stepdefs stepdefs, Applications apps, TransactionSteps steps) {
Expand Down Expand Up @@ -79,7 +78,6 @@ public void an_application_id(Integer int1) {
@Given("a new AtomicTransactionComposer")
public void a_new_atomic_transaction_composer() {
this.atc = new AtomicTransactionComposer();
composerMethods = new ArrayList<>();
}

@When("I make a transaction signer for the transient account.")
Expand Down Expand Up @@ -139,11 +137,10 @@ public void i_execute_the_current_transaction_group_with_the_composer() throws E
public void the_app_should_have_returned(String string) {
String[] splitEncoding = string.split(",");
assertThat(execRes.methodResults.size()).isEqualTo(splitEncoding.length);
assertThat(execRes.methodResults.size()).isEqualTo(composerMethods.size());

for (int i = 0; i < splitEncoding.length; i++) {
AtomicTransactionComposer.ReturnValue execRetVal = execRes.methodResults.get(i);
Method currMethod = composerMethods.get(i);
Method currMethod = execRetVal.method;
assertThat(execRetVal.parseError).isNull();

if (splitEncoding[i].isEmpty()) {
Expand Down Expand Up @@ -324,7 +321,6 @@ public void the_composer_should_have_a_status_of(String string) {
@When("I add a method call with the transient account, the current application, suggested params, on complete {string}, current transaction signer, current method arguments.")
public void i_add_a_method_call_with_the_signing_account_the_current_application_suggested_params_on_complete_current_transaction_signer_current_method_arguments(String onComplete) {
Address senderAddress = applications.transientAccount.transientAccount.getAddress();
composerMethods.add(method);

optionBuilder
.onComplete(Transaction.OnCompletion.String(onComplete))
Expand All @@ -345,7 +341,6 @@ public void i_add_a_method_call_with_the_signing_account_the_current_application
@When("I add a nonced method call with the transient account, the current application, suggested params, on complete {string}, current transaction signer, current method arguments.")
public void i_add_a_nonced_method_call_with_the_transient_account_the_current_application_suggested_params_on_complete_current_transaction_signer_current_method_arguments(String onComplete) {
Address senderAddress = applications.transientAccount.transientAccount.getAddress();
composerMethods.add(method);

optionBuilder
.onComplete(Transaction.OnCompletion.String(onComplete))
Expand Down Expand Up @@ -373,7 +368,6 @@ public void i_add_a_method_call_with_the_transient_account_the_current_applicati
} catch (Exception e) {
throw new IllegalArgumentException("cannot read resource from specified TEAL files");
}
composerMethods.add(method);

Address senderAddress = applications.transientAccount.transientAccount.getAddress();

Expand Down Expand Up @@ -410,7 +404,6 @@ public void i_add_a_method_call_with_the_transient_account_the_current_applicati
} catch (Exception e) {
throw new IllegalArgumentException("cannot read resource from specified TEAL files");
}
composerMethods.add(method);

Address senderAddress = applications.transientAccount.transientAccount.getAddress();

Expand Down