Skip to content

Commit

Permalink
muck up some changes, missing sig todo
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Apr 26, 2023
1 parent 00e5bbc commit 2b9ec82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 0 additions & 6 deletions algosdk/atomic_transaction_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,13 @@ def __init__(
decode_error: Optional[Exception],
tx_info: dict,
method: abi.Method,
missing_signature: bool,
) -> None:
self.tx_id = tx_id
self.raw_value = raw_value
self.return_value = return_value
self.decode_error = decode_error
self.tx_info = tx_info
self.method = method
self.missing_signature = missing_signature


class SimulateEvalOverrides:
Expand Down Expand Up @@ -299,7 +297,6 @@ class SimulateAtomicTransactionResponse:
def __init__(
self,
version: int,
would_succeed: bool,
failure_message: str,
failed_at: Optional[List[int]],
simulate_response: Dict[str, Any],
Expand All @@ -308,7 +305,6 @@ def __init__(
eval_overrides: Optional[SimulateEvalOverrides] = None,
) -> None:
self.version = version
self.would_succeed = would_succeed
self.failure_message = failure_message
self.failed_at = failed_at
self.simulate_response = simulate_response
Expand Down Expand Up @@ -788,13 +784,11 @@ def __report_simulation_response(self, simulation_result: Dict[str, Any]):
decode_error=result.decode_error,
tx_info=result.tx_info,
method=result.method,
missing_signature=sim_txn.get("missing-signature", False),
)
)

return SimulateAtomicTransactionResponse(
version=simulation_result.get("version", 0),
would_succeed=simulation_result.get("would-succeed", False),
failure_message=txn_group.get("failure-message", ""),
failed_at=txn_group.get("failed-at"),
simulate_response=simulation_result,
Expand Down
2 changes: 1 addition & 1 deletion algosdk/v2client/models/simulate_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ def dictify(self) -> Dict[str, Any]:
"txn-groups": [
txn_group.dictify() for txn_group in self.txn_groups
],
"lift-log-limits": self.lift_log_limits,
"allow-more-logging": self.lift_log_limits,
}
12 changes: 6 additions & 6 deletions tests/steps/other_v2_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +1442,12 @@ def simulate_transaction(context):
@then("the simulation should succeed without any failure message")
def simulate_transaction_succeed(context):
if hasattr(context, "simulate_response"):
assert context.simulate_response["would-succeed"] is True
assert len(context.simulate_response["failure-message"]) == 0
else:
assert context.atomic_transaction_composer_return.would_succeed is True
assert (
len(context.atomic_transaction_composer_return.failure_message)
== 0
)


@then("I simulate the current transaction group with the composer")
Expand All @@ -1470,7 +1473,6 @@ def simulate_atc_failure(context, group, path, message):
]
]
)
assert resp.would_succeed is False
assert fail_path == path
assert message in resp.failure_message

Expand Down Expand Up @@ -1524,10 +1526,8 @@ def check_missing_signatures(context, group, path):
group_idx: int = int(group)
tx_idxs: list[int] = [int(pe) for pe in path.split(",")]

assert resp["would-succeed"] is False

for tx_idx in tx_idxs:
missing_sig = resp["txn-groups"][group_idx]["txn-results"][tx_idx][
"missing-signature"
"failure-message"
]
assert missing_sig is True

0 comments on commit 2b9ec82

Please sign in to comment.