diff --git a/src/main/java/com/algorand/algosdk/v2/client/model/SimulateRequest.java b/src/main/java/com/algorand/algosdk/v2/client/model/SimulateRequest.java index 9dd56f67b..f098aebd3 100644 --- a/src/main/java/com/algorand/algosdk/v2/client/model/SimulateRequest.java +++ b/src/main/java/com/algorand/algosdk/v2/client/model/SimulateRequest.java @@ -43,6 +43,13 @@ public class SimulateRequest extends PathResponse { @JsonProperty("extra-opcode-budget") public Long extraOpcodeBudget; + /** + * If true, signers for transactions that are missing signatures will be fixed + * during evaluation. + */ + @JsonProperty("fix-signers") + public Boolean fixSigners; + /** * If provided, specifies the round preceding the simulation. State changes through * this round will be used to run this simulation. Usually only the 4 most recent @@ -70,6 +77,7 @@ public boolean equals(Object o) { if (!Objects.deepEquals(this.allowUnnamedResources, other.allowUnnamedResources)) return false; if (!Objects.deepEquals(this.execTraceConfig, other.execTraceConfig)) return false; if (!Objects.deepEquals(this.extraOpcodeBudget, other.extraOpcodeBudget)) return false; + if (!Objects.deepEquals(this.fixSigners, other.fixSigners)) return false; if (!Objects.deepEquals(this.round, other.round)) return false; if (!Objects.deepEquals(this.txnGroups, other.txnGroups)) return false; diff --git a/src/main/java/com/algorand/algosdk/v2/client/model/SimulateTransactionResult.java b/src/main/java/com/algorand/algosdk/v2/client/model/SimulateTransactionResult.java index 921f018b2..ac906ba17 100644 --- a/src/main/java/com/algorand/algosdk/v2/client/model/SimulateTransactionResult.java +++ b/src/main/java/com/algorand/algosdk/v2/client/model/SimulateTransactionResult.java @@ -1,7 +1,9 @@ package com.algorand.algosdk.v2.client.model; +import java.security.NoSuchAlgorithmException; import java.util.Objects; +import com.algorand.algosdk.crypto.Address; import com.algorand.algosdk.v2.client.common.PathResponse; import com.fasterxml.jackson.annotation.JsonProperty; @@ -24,6 +26,24 @@ public class SimulateTransactionResult extends PathResponse { @JsonProperty("exec-trace") public SimulationTransactionExecTrace execTrace; + /** + * The account that needed to sign this transaction when no signature was provided + * and the provided signer was incorrect. + */ + @JsonProperty("fixed-signer") + public void fixedSigner(String fixedSigner) throws NoSuchAlgorithmException { + this.fixedSigner = new Address(fixedSigner); + } + @JsonProperty("fixed-signer") + public String fixedSigner() throws NoSuchAlgorithmException { + if (this.fixedSigner != null) { + return this.fixedSigner.encodeAsString(); + } else { + return null; + } + } + public Address fixedSigner; + /** * Budget used during execution of a logic sig transaction. */ @@ -60,6 +80,7 @@ public boolean equals(Object o) { SimulateTransactionResult other = (SimulateTransactionResult) o; if (!Objects.deepEquals(this.appBudgetConsumed, other.appBudgetConsumed)) return false; if (!Objects.deepEquals(this.execTrace, other.execTrace)) return false; + if (!Objects.deepEquals(this.fixedSigner, other.fixedSigner)) return false; if (!Objects.deepEquals(this.logicSigBudgetConsumed, other.logicSigBudgetConsumed)) return false; if (!Objects.deepEquals(this.txnResult, other.txnResult)) return false; if (!Objects.deepEquals(this.unnamedResourcesAccessed, other.unnamedResourcesAccessed)) return false; diff --git a/src/main/java/com/algorand/algosdk/v2/client/model/SimulationEvalOverrides.java b/src/main/java/com/algorand/algosdk/v2/client/model/SimulationEvalOverrides.java index aa5b03251..2ef5fca42 100644 --- a/src/main/java/com/algorand/algosdk/v2/client/model/SimulationEvalOverrides.java +++ b/src/main/java/com/algorand/algosdk/v2/client/model/SimulationEvalOverrides.java @@ -31,6 +31,13 @@ public class SimulationEvalOverrides extends PathResponse { @JsonProperty("extra-opcode-budget") public Long extraOpcodeBudget; + /** + * If true, signers for transactions that are missing signatures will be fixed + * during evaluation. + */ + @JsonProperty("fix-signers") + public Boolean fixSigners; + /** * The maximum log calls one can make during simulation */ @@ -53,6 +60,7 @@ public boolean equals(Object o) { if (!Objects.deepEquals(this.allowEmptySignatures, other.allowEmptySignatures)) return false; if (!Objects.deepEquals(this.allowUnnamedResources, other.allowUnnamedResources)) return false; if (!Objects.deepEquals(this.extraOpcodeBudget, other.extraOpcodeBudget)) return false; + if (!Objects.deepEquals(this.fixSigners, other.fixSigners)) return false; if (!Objects.deepEquals(this.maxLogCalls, other.maxLogCalls)) return false; if (!Objects.deepEquals(this.maxLogSize, other.maxLogSize)) return false;