Skip to content

Commit

Permalink
chore: updating py-algorand-sdk to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
negar-abbasi committed Sep 19, 2023
1 parent 7be1379 commit 364fff4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
py-algorand-sdk = "^2.2.0"
py-algorand-sdk = "^2.4.0"
deprecated = "^1.2.14"

[tool.poetry.group.dev.dependencies]
Expand Down
21 changes: 21 additions & 0 deletions src/algokit_utils/application_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
from algosdk.constants import APP_PAGE_MAX_SIZE
from algosdk.logic import get_application_address
from algosdk.source_map import SourceMap
from algosdk.transaction import SignedTransaction
from algosdk.v2client.models import SimulateTraceConfig, SimulateRequest, SimulateRequestTransactionGroup

import algokit_utils.application_specification as au_spec
import algokit_utils.deploy as au_deploy
Expand Down Expand Up @@ -879,6 +881,14 @@ def _simulate_readonly_call(

return TransactionResponse.from_atr(simulate_response)

def _simulate_response(self, atc: AtomicTransactionComposer, algod_client) -> None:
trace_config = SimulateTraceConfig(enable=True, stack_change=True, scratch_change=True)
unsigned_txn_groups = atc.build_group()
txn_group = SimulateRequestTransactionGroup(txns=unsigned_txn_groups)
simulate_request = SimulateRequest(txn_groups=txn_group, allow_more_logs=True, allow_empty_signatures=True, exec_trace_config=trace_config)
simulate_response = atc.simulate(algod_client, simulate_request)


def _load_reference_and_check_app_id(self) -> None:
self._load_app_reference()
self._check_app_id()
Expand Down Expand Up @@ -1258,6 +1268,17 @@ def execute_atc_with_logic_error(
except Exception as ex:
logic_error = _try_convert_to_logic_error(ex, approval_program, approval_source_map)
if logic_error and config.debug:
# trace_config = SimulateTraceConfig(enable=True, stack_change=True, scratch_change=True)
# simulate_request = SimulateRequest(txn_groups=[], allow_more_logs=True, exec_trace_config=trace_config)
# simulate_response = atc.simulate(algod_client, simulate_request)
# e = []
# if simulate_response.failure_message:
# for _ in simulate_response.tx_ids:
# e.append(simulate_response.exec_trace_config)
# e.append(simulate_response.abi_results)
# e.append(simulate_response.failure_message)
# raise e or Exception("\n".join(e)) from ex

simulate_response = atc.simulate(algod_client)
if simulate_response.failure_message:
raise _try_convert_to_logic_error(
Expand Down

0 comments on commit 364fff4

Please sign in to comment.