algorand-python-testing 0.3.0b8__tar.gz → 0.3.0b10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.github/workflows/ci.yaml +3 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.github/workflows/gh-pages.yaml +3 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/CHANGELOG.md +4 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/PKG-INFO +1 -1
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/api.md +10 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/conf.py +10 -0
- algorand_python_testing-0.3.0b10/docs/faq.md +61 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/index.md +1 -17
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/pyproject.toml +5 -3
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/context_storage.py +5 -2
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/ledger_context.py +21 -21
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/txn_context.py +9 -5
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/account.py +1 -1
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/application.py +8 -16
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/asset.py +10 -29
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/global_values.py +2 -4
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/misc.py +7 -9
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utils.py +22 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/avm.py +7 -7
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/test_asset.py +1 -3
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/test_context.py +44 -7
- algorand_python_testing-0.3.0b8/docs/glossary.md +0 -8
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.coveragerc +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.editorconfig +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.github/pull_request_template.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.github/workflows/cd.yaml +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.gitignore +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.pre-commit-config.yaml +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.vscode/extensions.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.vscode/launch.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/.vscode/settings.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/CONTRIBUTING.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/LICENSE +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/README.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/Makefile +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/_static/custom.css +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/algopy.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/coverage.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/examples.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/make.bat +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/arc4-types.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/avm-types.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/concepts.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/contract-testing.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/index.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/opcodes.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/signature-testing.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/state-management.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/subroutines.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/docs/testing-guide/transactions.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/README.md +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/auction/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/auction/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/auction/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/htlc_logicsig/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/htlc_logicsig/signature.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/htlc_logicsig/test_signature.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/marketplace/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/marketplace/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/marketplace/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/proof_of_attendance/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/proof_of_attendance/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/proof_of_attendance/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/scratch_storage/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/scratch_storage/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/scratch_storage/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/simple_voting/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/simple_voting/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/simple_voting/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/zk_whitelist/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/zk_whitelist/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/examples/zk_whitelist/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/scripts/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/scripts/check_stubs_cov.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/scripts/refresh_test_artifacts.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/scripts/validate_examples.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/compiled.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/constants.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/decorators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/decorators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/decorators/subroutine.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/enums.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/itxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/itxn_loader.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/logicsig.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/template_variable.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/txn_fields.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/unsigned_builtins.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/mutable.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/block.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/constants.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/crypto.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/itxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/pure.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/txn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/biguint.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/bytes.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/string.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/uint64.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/protocols.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/box.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/global_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/local_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/utils.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utilities/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utilities/budget.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utilities/log.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/txn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy/arc4.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy/itxn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy/op.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy/py.typed +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy_testing/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/templates/.macros.j2 +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/templates/.release_notes.md.j2 +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/templates/CHANGELOG.md.j2 +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_abi_call.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_address.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_arc4_method_signature.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_bool.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_dynamic_array.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_dynamic_bytes.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_emit.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_static_array.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_string.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_struct.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_tuple.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_ufixednxm.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/arc4/test_uintn.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/data/BoxContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/data/BoxContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/data/BoxContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/data/CryptoOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/data/CryptoOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/data/Contract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/data/Contract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/data/Contract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/statemutations.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/GlobalStateContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/GlobalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/ITxnOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/ITxnOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/ITxnOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/LocalStateContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/LocalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGet.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGet.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGet.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalExContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalExContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalExContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalExContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalExContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppParamsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppParamsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetHoldingContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetHoldingContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetParamsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetParamsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/artifacts/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/common.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/contexts/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/test_box.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/test_box_map.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/test_box_ref.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/test_uenumerate.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/models/test_urange.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/primitives/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/primitives/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/primitives/test_biguint.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/primitives/test_bytes.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/primitives/test_string.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/primitives/test_uint64.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/state/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/state/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/state/test_global_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/state/test_local_state.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/state/test_mutations.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/test_miscellaneous_op.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/test_op.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/util.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/utilities/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/utilities/conftest.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/utilities/test_log.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/value_generators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/tests/value_generators/test_avm.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: algorand-python-testing
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.0b10
|
|
4
4
|
Summary: Algorand Python testing library
|
|
5
5
|
Project-URL: Documentation, https://github.com/algorandfoundation/puya/tree/main/algopy_testing#README.md
|
|
6
6
|
Project-URL: Issues, https://github.com/algorandfoundation/puya/issues
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# API Reference
|
|
2
2
|
|
|
3
|
+
An overview of the `algorand-python-testing`'s `algopy_testing` module - covering the main classes and functions.
|
|
4
|
+
|
|
5
|
+
```{hint}
|
|
6
|
+
Spotted a typo in documentation? This project is open source, please submit an issue or a PR on [GitHub](https://github.com/algorand/algorand-python-testing).
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```{warning}
|
|
10
|
+
Note, assume `_algopy_testing` to refer to `algopy_testing` namespace in the auto-generated class documentation above. To be patched in near future.
|
|
11
|
+
```
|
|
12
|
+
|
|
3
13
|
## Contexts
|
|
4
14
|
|
|
5
15
|
```{autodoc2-summary}
|
|
@@ -84,3 +84,13 @@ doctest_test_doctest_blocks = "default"
|
|
|
84
84
|
sphinxmermaid_mermaid_init = {
|
|
85
85
|
"theme": "dark",
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
# Ignore specific warning types
|
|
89
|
+
# TODO : remove upon refining autodoc2 (or finding alternative to sphinx)
|
|
90
|
+
suppress_warnings = [
|
|
91
|
+
"myst.xref_missing",
|
|
92
|
+
"autodoc2.dup_item",
|
|
93
|
+
"ref.python", # Ignore Python reference warnings
|
|
94
|
+
"ref.class", # Ignore class reference warnings
|
|
95
|
+
"ref.obj", # Ignore object reference warnings
|
|
96
|
+
]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# FAQ
|
|
2
|
+
|
|
3
|
+
## What is a Test Context?
|
|
4
|
+
|
|
5
|
+
A Test Context is a context manager that provides a simulated Algorand environment for testing Python smart contracts. It allows developers to create and manipulate a virtual Algorand ecosystem for testing purposes. For more details, see the [Test Context section](testing-guide/concepts.md#test-context) in our documentation.
|
|
6
|
+
|
|
7
|
+
## What is the Algorand Virtual Machine (AVM)?
|
|
8
|
+
|
|
9
|
+
The Algorand Virtual Machine (AVM) is the runtime environment for Algorand smart contracts. It executes the compiled code of smart contracts on the Algorand blockchain. To learn more about the AVM, visit the [official Algorand documentation](https://developer.algorand.org/docs/get-details/dapps/avm/).
|
|
10
|
+
|
|
11
|
+
## What are Operational Codes in Algorand?
|
|
12
|
+
|
|
13
|
+
Operational Codes, or opcodes, are AVM instructions that are executed directly by the AVM. In the context of Algorand Python testing, these opcodes are provided by `algopy` stubs and are either emulated, implemented, or mocked by `algorand-python-testing`. For a comprehensive list of opcodes, refer to the [Algorand Developer Documentation](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/?from_query=OPcodes#template-modal-overlay).
|
|
14
|
+
|
|
15
|
+
## What are Value Generators?
|
|
16
|
+
|
|
17
|
+
Value Generators are helper methods that generate randomized values for testing when the specific value of the tested type is not important. In the context of Algorand Python testing, these are represented by property on the context manager, accessed via `any.*` (or `any.arc4.*`, `any.txn.*`. in the case of ARC 4 types). To understand how to use Value Generators effectively, check out our [Value Generators section](testing-guide/concepts.md#value-generators) in the documentation.
|
|
18
|
+
|
|
19
|
+
## What are the limitations of the Algorand Python Testing framework?
|
|
20
|
+
|
|
21
|
+
The Algorand Python Testing framework emulates the Algorand Virtual Machine (AVM) for unit testing Algorand Python smart contracts without interacting with the real Algorand Network. However, it has some limitations due to its scope and purpose:
|
|
22
|
+
|
|
23
|
+
1. Simplified balance tracking and transaction validation
|
|
24
|
+
2. No consensus mechanism or AVM network operations simulation
|
|
25
|
+
3. Absence of a strict opcode budget system
|
|
26
|
+
4. Certain cryptographic operations are mocked or simplified
|
|
27
|
+
5. No state proof generation or verification
|
|
28
|
+
|
|
29
|
+
For scenarios where these limitations are crucial, it's recommended to pair this framework with integration testing. If you have a solid reason to justify introducing new emulated behaviour, please open an issue or contribute to the project on [Github](https://github.com/algorandfoundation/algorand-python-testing).
|
|
30
|
+
|
|
31
|
+
## How does balance tracking work in the testing framework?
|
|
32
|
+
|
|
33
|
+
The framework uses simplified balance tracking and transaction validation. For scenarios where precise balance or fee verification is important, it's recommended to complement unit tests with integration testing.
|
|
34
|
+
|
|
35
|
+
## Does the framework simulate the entire AVM network?
|
|
36
|
+
|
|
37
|
+
No, the framework does not simulate the entire AVM network or consensus mechanism. It focuses on emulating the parts of the AVM relevant to unit testing smart contracts.
|
|
38
|
+
|
|
39
|
+
## How does the framework handle opcode budgets?
|
|
40
|
+
|
|
41
|
+
The framework does not implement a strict opcode budget system. For scenarios where validating opcode budget is crucial, it's recommended to use integration testing alongside this framework.
|
|
42
|
+
|
|
43
|
+
## Are all cryptographic operations fully implemented?
|
|
44
|
+
|
|
45
|
+
Some cryptographic operations are mocked or simplified in the framework. For a detailed list of which operations are mocked, refer to the _mockable_ types under the [coverage](./coverage.md) section.
|
|
46
|
+
|
|
47
|
+
## Can I use this framework for security-critical validations?
|
|
48
|
+
|
|
49
|
+
While this framework is useful for unit testing and local development, it should not be the only tool used for security-critical validations or performance benchmarking. It's designed to approximate AVM behavior for common scenarios. Always complement your testing with additional integration testing options available in `algokit`, where you can test against real localnet or testnet environments.
|
|
50
|
+
|
|
51
|
+
## Is there an example of how to use this framework alongside integration tests?
|
|
52
|
+
|
|
53
|
+
Yes, the `algokit-python-template`, accessible via `algokit init`, provides a working example of how to structure `algorand-python-testing` along with regular integration tests against localnet.
|
|
54
|
+
|
|
55
|
+
```{hint}
|
|
56
|
+
An `algokit-python-template` accessible via `algokit init -t python`, provides a comprehensive and customizable working example of how to structure `algorand-python-testing` along with regular integration tests against localnet.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Is it compatible with `pytest`?
|
|
60
|
+
|
|
61
|
+
Yes, it is compatible with `pytest` and _any_ other python testing framework as its agnostic of the testing framework as long as its python. If you spot incompatibility with a certain tool, please open an issue or contribute to the project on [Github](https://github.com/algorandfoundation/algorand-python-testing).
|
|
@@ -13,18 +13,6 @@ The `algorand-python-testing` package provides:
|
|
|
13
13
|
- An offline testing environment that simulates core AVM functionality
|
|
14
14
|
- A familiar Pythonic experience, compatible with testing frameworks like [pytest](https://docs.pytest.org/en/latest/), [unittest](https://docs.python.org/3/library/unittest.html), and [hypothesis](https://hypothesis.readthedocs.io/en/latest/)
|
|
15
15
|
|
|
16
|
-
```{testsetup}
|
|
17
|
-
import algopy
|
|
18
|
-
import algopy_testing
|
|
19
|
-
from algopy_testing import algopy_testing_context
|
|
20
|
-
|
|
21
|
-
# Create the context manager for snippets below
|
|
22
|
-
ctx_manager = algopy_testing_context()
|
|
23
|
-
|
|
24
|
-
# Enter the context
|
|
25
|
-
context = ctx_manager.__enter__()
|
|
26
|
-
```
|
|
27
|
-
|
|
28
16
|
## Quick Start
|
|
29
17
|
|
|
30
18
|
`algopy` is a prerequisite for `algorand-python-testing`, providing stubs and type annotations for Algorand Python syntax. It enhances code completion and type checking when writing smart contracts. Note that this code isn't directly executable in standard Python interpreters; it's compiled by `puya` into TEAL for Algorand Network deployment.
|
|
@@ -188,11 +176,7 @@ hidden: true
|
|
|
188
176
|
testing-guide/index
|
|
189
177
|
examples
|
|
190
178
|
coverage
|
|
191
|
-
|
|
179
|
+
faq
|
|
192
180
|
api
|
|
193
181
|
algopy
|
|
194
182
|
```
|
|
195
|
-
|
|
196
|
-
```{testcleanup}
|
|
197
|
-
ctx_manager.__exit__(None, None, None)
|
|
198
|
-
```
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "algorand-python-testing"
|
|
7
|
-
version = "0.3.0-beta.
|
|
7
|
+
version = "0.3.0-beta.10"
|
|
8
8
|
description = 'Algorand Python testing library'
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -150,8 +150,10 @@ post-install-commands = [
|
|
|
150
150
|
]
|
|
151
151
|
|
|
152
152
|
[tool.hatch.envs.docs.scripts]
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
test = "sphinx-build -b doctest docs docs/_build -W --keep-going -n -E"
|
|
154
|
+
clear = "rm -rf docs/_build"
|
|
155
|
+
build = "hatch run docs:clear && sphinx-build docs docs/_build -W --keep-going -n -E"
|
|
156
|
+
dev = "hatch run docs:test && sphinx-autobuild docs docs/_build"
|
|
155
157
|
|
|
156
158
|
# Examples environment
|
|
157
159
|
[tool.hatch.envs.examples]
|
|
@@ -78,13 +78,13 @@ class _InternalContext:
|
|
|
78
78
|
|
|
79
79
|
def get_asset_data(self, asset_id: int | algopy.UInt64) -> AssetFields:
|
|
80
80
|
try:
|
|
81
|
-
return self.ledger.
|
|
81
|
+
return self.ledger._asset_data[int(asset_id)]
|
|
82
82
|
except KeyError:
|
|
83
83
|
raise ValueError("Unknown asset, check correct testing context is active") from None
|
|
84
84
|
|
|
85
85
|
def get_account_data(self, account_public_key: str) -> AccountContextData:
|
|
86
86
|
try:
|
|
87
|
-
return self.ledger.
|
|
87
|
+
return self.ledger._account_data[account_public_key]
|
|
88
88
|
except KeyError:
|
|
89
89
|
raise ValueError("Unknown account, check correct testing context is active") from None
|
|
90
90
|
|
|
@@ -104,6 +104,9 @@ def algopy_testing_context(
|
|
|
104
104
|
"""
|
|
105
105
|
from _algopy_testing.context import AlgopyTestContext
|
|
106
106
|
|
|
107
|
+
if _var.get(None) is not None:
|
|
108
|
+
raise RuntimeError("Nested `algopy_testing_context`s are not allowed.")
|
|
109
|
+
|
|
107
110
|
token = _var.set(
|
|
108
111
|
AlgopyTestContext(
|
|
109
112
|
default_sender=default_sender,
|
|
@@ -23,25 +23,25 @@ class LedgerContext:
|
|
|
23
23
|
def __init__(self) -> None:
|
|
24
24
|
from _algopy_testing.models.account import AccountContextData, get_empty_account
|
|
25
25
|
|
|
26
|
-
self.
|
|
27
|
-
self.
|
|
28
|
-
self.
|
|
29
|
-
self.
|
|
30
|
-
self.
|
|
26
|
+
self._account_data = defaultdict[str, AccountContextData](get_empty_account)
|
|
27
|
+
self._app_data: dict[int, ApplicationContextData] = {}
|
|
28
|
+
self._asset_data: dict[int, AssetFields] = {}
|
|
29
|
+
self._blocks: dict[int, dict[str, int]] = {}
|
|
30
|
+
self._global_fields: GlobalFields = get_default_global_fields()
|
|
31
31
|
|
|
32
32
|
self._asset_id = iter(range(1001, 2**64))
|
|
33
33
|
self._app_id = iter(range(1001, 2**64))
|
|
34
34
|
|
|
35
|
-
def
|
|
35
|
+
def _get_next_asset_id(self) -> int:
|
|
36
36
|
while True:
|
|
37
37
|
asset_id = next(self._asset_id)
|
|
38
|
-
if asset_id not in self.
|
|
38
|
+
if asset_id not in self._asset_data:
|
|
39
39
|
return asset_id
|
|
40
40
|
|
|
41
|
-
def
|
|
41
|
+
def _get_next_app_id(self) -> int:
|
|
42
42
|
while True:
|
|
43
43
|
app_id = next(self._app_id)
|
|
44
|
-
if app_id not in self.
|
|
44
|
+
if app_id not in self._app_data:
|
|
45
45
|
return app_id
|
|
46
46
|
|
|
47
47
|
def get_account(self, address: str) -> algopy.Account:
|
|
@@ -68,7 +68,7 @@ class LedgerContext:
|
|
|
68
68
|
bool: True if the account exists, False otherwise.
|
|
69
69
|
"""
|
|
70
70
|
assert_address_is_valid(address)
|
|
71
|
-
return address in self.
|
|
71
|
+
return address in self._account_data
|
|
72
72
|
|
|
73
73
|
def update_account(
|
|
74
74
|
self,
|
|
@@ -84,11 +84,11 @@ class LedgerContext:
|
|
|
84
84
|
**account_fields: The fields to update.
|
|
85
85
|
"""
|
|
86
86
|
assert_address_is_valid(address)
|
|
87
|
-
self.
|
|
87
|
+
self._account_data[address].fields.update(account_fields)
|
|
88
88
|
|
|
89
89
|
if opted_asset_balances is not None:
|
|
90
90
|
for asset_id, balance in opted_asset_balances.items():
|
|
91
|
-
self.
|
|
91
|
+
self._account_data[address].opted_asset_balances[UInt64(asset_id)] = balance
|
|
92
92
|
|
|
93
93
|
def get_asset(self, asset_id: algopy.UInt64 | int) -> algopy.Asset:
|
|
94
94
|
"""Get an asset by ID.
|
|
@@ -105,7 +105,7 @@ class LedgerContext:
|
|
|
105
105
|
import algopy
|
|
106
106
|
|
|
107
107
|
asset_id = int(asset_id) if isinstance(asset_id, algopy.UInt64) else asset_id
|
|
108
|
-
if asset_id not in self.
|
|
108
|
+
if asset_id not in self._asset_data:
|
|
109
109
|
raise ValueError("Asset not found in testing context!")
|
|
110
110
|
|
|
111
111
|
return algopy.Asset(asset_id)
|
|
@@ -122,7 +122,7 @@ class LedgerContext:
|
|
|
122
122
|
import algopy
|
|
123
123
|
|
|
124
124
|
asset_id = int(asset_id) if isinstance(asset_id, algopy.UInt64) else asset_id
|
|
125
|
-
return asset_id in self.
|
|
125
|
+
return asset_id in self._asset_data
|
|
126
126
|
|
|
127
127
|
def update_asset(self, asset_id: int, **asset_fields: typing.Unpack[AssetFields]) -> None:
|
|
128
128
|
"""Update asset fields.
|
|
@@ -134,9 +134,9 @@ class LedgerContext:
|
|
|
134
134
|
Raises:
|
|
135
135
|
ValueError: If the asset is not found.
|
|
136
136
|
"""
|
|
137
|
-
if asset_id not in self.
|
|
137
|
+
if asset_id not in self._asset_data:
|
|
138
138
|
raise ValueError("Asset not found in testing context!")
|
|
139
|
-
self.
|
|
139
|
+
self._asset_data[asset_id].update(asset_fields)
|
|
140
140
|
|
|
141
141
|
def get_app(
|
|
142
142
|
self, app_id: algopy.Contract | algopy.Application | algopy.UInt64 | int
|
|
@@ -164,7 +164,7 @@ class LedgerContext:
|
|
|
164
164
|
bool: True if the application exists, False otherwise.
|
|
165
165
|
"""
|
|
166
166
|
app_id = _get_app_id(app_id)
|
|
167
|
-
return app_id in self.
|
|
167
|
+
return app_id in self._app_data
|
|
168
168
|
|
|
169
169
|
def update_app(
|
|
170
170
|
self, app_id: int, **application_fields: typing.Unpack[ApplicationFields]
|
|
@@ -343,7 +343,7 @@ class LedgerContext:
|
|
|
343
343
|
seed (algopy.UInt64 | int): The block seed.
|
|
344
344
|
timestamp (algopy.UInt64 | int): The block timestamp.
|
|
345
345
|
"""
|
|
346
|
-
self.
|
|
346
|
+
self._blocks[index] = {"seed": int(seed), "timestamp": int(timestamp)}
|
|
347
347
|
|
|
348
348
|
def get_block_content(self, index: int, key: str) -> int:
|
|
349
349
|
"""Get block content.
|
|
@@ -358,7 +358,7 @@ class LedgerContext:
|
|
|
358
358
|
Raises:
|
|
359
359
|
ValueError: If the block content is not found.
|
|
360
360
|
"""
|
|
361
|
-
content = self.
|
|
361
|
+
content = self._blocks.get(index, {}).get(key, None)
|
|
362
362
|
if content is None:
|
|
363
363
|
raise KeyError(
|
|
364
364
|
f"Block content for index {index} and key {key} not found in testing context!"
|
|
@@ -383,7 +383,7 @@ class LedgerContext:
|
|
|
383
383
|
f"Invalid field(s) found during patch for `Global`: {', '.join(invalid_keys)}"
|
|
384
384
|
)
|
|
385
385
|
|
|
386
|
-
self.
|
|
386
|
+
self._global_fields.update(global_fields)
|
|
387
387
|
|
|
388
388
|
def _get_app_data(
|
|
389
389
|
self, app: algopy.UInt64 | algopy.Application | algopy.Contract | int
|
|
@@ -401,7 +401,7 @@ class LedgerContext:
|
|
|
401
401
|
"""
|
|
402
402
|
app_id = _get_app_id(app)
|
|
403
403
|
try:
|
|
404
|
-
return self.
|
|
404
|
+
return self._app_data[app_id]
|
|
405
405
|
except KeyError:
|
|
406
406
|
raise ValueError("Unknown app id, is there an active transaction?") from None
|
|
407
407
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import contextlib
|
|
4
|
+
import time
|
|
4
5
|
import typing
|
|
5
6
|
|
|
6
7
|
import algosdk
|
|
@@ -144,6 +145,8 @@ class TransactionContext:
|
|
|
144
145
|
:param active_txn_overrides: Overrides for active txn
|
|
145
146
|
:return: None
|
|
146
147
|
"""
|
|
148
|
+
if self._active_group is not None:
|
|
149
|
+
raise RuntimeError("Nested `create_group` calls are not allowed.")
|
|
147
150
|
if gtxns and active_txn_overrides:
|
|
148
151
|
raise ValueError("cannot specified gtxns and active_txn_overrides at the same time")
|
|
149
152
|
if active_txn_index is not None and not gtxns:
|
|
@@ -163,18 +166,18 @@ class TransactionContext:
|
|
|
163
166
|
last_app_call_txn = app_calls[-1]._txns[-1]
|
|
164
167
|
active_txn_index = processed_gtxns.index(last_app_call_txn)
|
|
165
168
|
|
|
166
|
-
|
|
167
|
-
active_group = self._active_group = TransactionGroup(
|
|
169
|
+
new_group = TransactionGroup(
|
|
168
170
|
txns=processed_gtxns,
|
|
169
171
|
active_txn_index=active_txn_index,
|
|
170
172
|
active_txn_overrides=typing.cast(dict[str, typing.Any], active_txn_overrides),
|
|
171
173
|
)
|
|
174
|
+
self._active_group = new_group
|
|
172
175
|
try:
|
|
173
176
|
yield
|
|
174
177
|
finally:
|
|
175
|
-
if
|
|
176
|
-
self._groups.append(
|
|
177
|
-
self._active_group =
|
|
178
|
+
if new_group.txns:
|
|
179
|
+
self._groups.append(new_group)
|
|
180
|
+
self._active_group = None
|
|
178
181
|
|
|
179
182
|
@contextlib.contextmanager
|
|
180
183
|
def _get_or_create_group(self) -> Iterator[TransactionGroup]:
|
|
@@ -207,6 +210,7 @@ class TransactionGroup:
|
|
|
207
210
|
active_txn_index: int | None = None,
|
|
208
211
|
active_txn_overrides: dict[str, typing.Any] | None = None,
|
|
209
212
|
):
|
|
213
|
+
self._latest_timestamp = int(time.time())
|
|
210
214
|
self._set_txn_group(txns, active_txn_index)
|
|
211
215
|
self._itxn_groups: list[Sequence[InnerTransactionResultType]] = []
|
|
212
216
|
self._constructing_itxn_group: list[InnerTransaction] = []
|
|
@@ -82,7 +82,7 @@ class Account(BytesBacked):
|
|
|
82
82
|
def data(self) -> AccountContextData:
|
|
83
83
|
from _algopy_testing.context_helpers import lazy_context
|
|
84
84
|
|
|
85
|
-
return lazy_context.
|
|
85
|
+
return lazy_context.get_account_data(self.public_key)
|
|
86
86
|
|
|
87
87
|
@property
|
|
88
88
|
def balance(self) -> algopy.UInt64:
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import inspect
|
|
4
3
|
import typing
|
|
5
4
|
|
|
6
5
|
from _algopy_testing.primitives import UInt64
|
|
7
6
|
from _algopy_testing.protocols import UInt64Backed
|
|
8
|
-
from _algopy_testing.utils import as_int64
|
|
7
|
+
from _algopy_testing.utils import as_int64, resolve_app_index
|
|
9
8
|
|
|
10
9
|
if typing.TYPE_CHECKING:
|
|
11
10
|
from collections.abc import Sequence
|
|
@@ -70,22 +69,15 @@ class Application(UInt64Backed):
|
|
|
70
69
|
def fields(self) -> ApplicationFields:
|
|
71
70
|
from _algopy_testing.context_helpers import lazy_context
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
raise ValueError("cannot access properties of an app with an id of 0") from None
|
|
75
|
-
return lazy_context.get_app_data(self._id).fields
|
|
72
|
+
return lazy_context.get_app_data(resolve_app_index(self._id)).fields
|
|
76
73
|
|
|
77
74
|
def __getattr__(self, name: str) -> typing.Any:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
f"Make sure to patch the field '{name}' using your `AlgopyTestContext` "
|
|
85
|
-
"instance."
|
|
86
|
-
)
|
|
87
|
-
return value
|
|
88
|
-
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
|
|
75
|
+
try:
|
|
76
|
+
return self.fields[name] # type: ignore[literal-required]
|
|
77
|
+
except KeyError:
|
|
78
|
+
raise AttributeError(
|
|
79
|
+
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
80
|
+
) from None
|
|
89
81
|
|
|
90
82
|
def __eq__(self, other: object) -> bool:
|
|
91
83
|
if isinstance(other, Application):
|
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
from _algopy_testing.protocols import UInt64Backed
|
|
6
|
+
from _algopy_testing.utils import resolve_asset_index
|
|
6
7
|
|
|
7
8
|
if typing.TYPE_CHECKING:
|
|
8
9
|
import algopy
|
|
@@ -65,39 +66,19 @@ class Asset(UInt64Backed):
|
|
|
65
66
|
"Please mock this method using your python testing framework of choice."
|
|
66
67
|
)
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
@property
|
|
70
|
+
def fields(self) -> AssetFields:
|
|
69
71
|
from _algopy_testing.context_helpers import lazy_context
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
# check if its not 0 (which means its not
|
|
73
|
-
# instantiated/opted-in yet, and instantiated directly
|
|
74
|
-
# without invoking any_asset).
|
|
75
|
-
if self.id == 0:
|
|
76
|
-
# Handle dunder methods specially
|
|
77
|
-
if name.startswith("__") and name.endswith("__"):
|
|
78
|
-
return getattr(type(self), name)
|
|
79
|
-
# For non-dunder attributes, check in __dict__
|
|
80
|
-
if name in self.__dict__:
|
|
81
|
-
return self.__dict__[name]
|
|
82
|
-
raise AttributeError(
|
|
83
|
-
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
raise ValueError(
|
|
87
|
-
"`algopy.Asset` is not present in the test context! "
|
|
88
|
-
"Use `context.add_asset()` or `context.any.asset()` to add the asset to "
|
|
89
|
-
"your test setup."
|
|
90
|
-
)
|
|
73
|
+
return lazy_context.get_asset_data(resolve_asset_index(self.id))
|
|
91
74
|
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
def __getattr__(self, name: str) -> typing.Any:
|
|
76
|
+
try:
|
|
77
|
+
return self.fields[name] # type: ignore[literal-required]
|
|
78
|
+
except KeyError:
|
|
94
79
|
raise AttributeError(
|
|
95
|
-
f"
|
|
96
|
-
|
|
97
|
-
"instance."
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
return return_value
|
|
80
|
+
f"'{self.__class__.__name__}' object has no attribute '{name}'"
|
|
81
|
+
) from None
|
|
101
82
|
|
|
102
83
|
def __eq__(self, other: object) -> bool:
|
|
103
84
|
if isinstance(other, Asset):
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import time
|
|
4
3
|
import typing
|
|
5
4
|
from typing import TypedDict, TypeVar
|
|
6
5
|
|
|
@@ -38,7 +37,7 @@ class GlobalFields(TypedDict, total=False):
|
|
|
38
37
|
class _Global:
|
|
39
38
|
@property
|
|
40
39
|
def _fields(self) -> GlobalFields:
|
|
41
|
-
return lazy_context.ledger.
|
|
40
|
+
return lazy_context.ledger._global_fields
|
|
42
41
|
|
|
43
42
|
@property
|
|
44
43
|
def current_application_address(self) -> algopy.Account:
|
|
@@ -60,8 +59,7 @@ class _Global:
|
|
|
60
59
|
try:
|
|
61
60
|
return self._fields["latest_timestamp"]
|
|
62
61
|
except KeyError:
|
|
63
|
-
|
|
64
|
-
return UInt64(int(time.time()))
|
|
62
|
+
return UInt64(lazy_context.active_group._latest_timestamp)
|
|
65
63
|
|
|
66
64
|
@property
|
|
67
65
|
def group_size(self) -> algopy.UInt64:
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/misc.py
RENAMED
|
@@ -10,7 +10,11 @@ from _algopy_testing.enums import TransactionType
|
|
|
10
10
|
from _algopy_testing.models import Account, Application, Asset
|
|
11
11
|
from _algopy_testing.primitives.bytes import Bytes
|
|
12
12
|
from _algopy_testing.primitives.uint64 import UInt64
|
|
13
|
-
from _algopy_testing.utils import
|
|
13
|
+
from _algopy_testing.utils import (
|
|
14
|
+
raise_mocked_function_error,
|
|
15
|
+
resolve_app_index,
|
|
16
|
+
resolve_asset_index,
|
|
17
|
+
)
|
|
14
18
|
|
|
15
19
|
if typing.TYPE_CHECKING:
|
|
16
20
|
import algopy
|
|
@@ -23,10 +27,7 @@ def err() -> None:
|
|
|
23
27
|
def _get_app(app: algopy.Application | algopy.UInt64 | int) -> Application:
|
|
24
28
|
if isinstance(app, Application):
|
|
25
29
|
return app
|
|
26
|
-
|
|
27
|
-
return lazy_context.ledger.get_app(app)
|
|
28
|
-
txn = lazy_context.active_group.active_txn
|
|
29
|
-
return txn.apps(app)
|
|
30
|
+
return lazy_context.ledger.get_app(resolve_app_index(app))
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
def _get_account(acc: algopy.Account | algopy.UInt64 | int) -> Account:
|
|
@@ -39,10 +40,7 @@ def _get_account(acc: algopy.Account | algopy.UInt64 | int) -> Account:
|
|
|
39
40
|
def _get_asset(asset: algopy.Asset | algopy.UInt64 | int) -> Asset:
|
|
40
41
|
if isinstance(asset, Asset):
|
|
41
42
|
return asset
|
|
42
|
-
|
|
43
|
-
return lazy_context.ledger.get_asset(asset)
|
|
44
|
-
txn = lazy_context.active_group.active_txn
|
|
45
|
-
return txn.assets(asset)
|
|
43
|
+
return lazy_context.ledger.get_asset(resolve_asset_index(asset))
|
|
46
44
|
|
|
47
45
|
|
|
48
46
|
def _get_bytes(b: algopy.Bytes | bytes) -> bytes:
|
{algorand_python_testing-0.3.0b8 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utils.py
RENAMED
|
@@ -29,6 +29,28 @@ if TYPE_CHECKING:
|
|
|
29
29
|
from _algopy_testing.op.global_values import GlobalFields
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
def resolve_app_index(app_id_or_index: algopy.UInt64 | int) -> int:
|
|
33
|
+
from _algopy_testing.context_helpers import lazy_context
|
|
34
|
+
|
|
35
|
+
if app_id_or_index >= 1001:
|
|
36
|
+
app_id = app_id_or_index
|
|
37
|
+
else:
|
|
38
|
+
txn = lazy_context.active_group.active_txn
|
|
39
|
+
app_id = txn.apps(app_id_or_index).id
|
|
40
|
+
return int(app_id)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def resolve_asset_index(asset_id_or_index: algopy.UInt64 | int) -> int:
|
|
44
|
+
from _algopy_testing.context_helpers import lazy_context
|
|
45
|
+
|
|
46
|
+
if asset_id_or_index >= 1001:
|
|
47
|
+
asset_id = asset_id_or_index
|
|
48
|
+
else:
|
|
49
|
+
txn = lazy_context.active_group.active_txn
|
|
50
|
+
asset_id = txn.assets(asset_id_or_index).id
|
|
51
|
+
return int(asset_id)
|
|
52
|
+
|
|
53
|
+
|
|
32
54
|
def generate_random_int(min_value: int, max_value: int) -> int:
|
|
33
55
|
return secrets.randbelow(max_value - min_value + 1) + min_value
|
|
34
56
|
|
|
@@ -98,7 +98,7 @@ class AVMValueGenerator:
|
|
|
98
98
|
new_account_address = address or algosdk.account.generate_account()[1]
|
|
99
99
|
new_account = algopy.Account(new_account_address)
|
|
100
100
|
# defaultdict of account_data ensures we get a new initialized account
|
|
101
|
-
account_data = lazy_context.
|
|
101
|
+
account_data = lazy_context.get_account_data(new_account_address)
|
|
102
102
|
# update so defaults are preserved
|
|
103
103
|
account_data.fields.update(account_fields)
|
|
104
104
|
# can set these since it is a new account
|
|
@@ -112,14 +112,14 @@ class AVMValueGenerator:
|
|
|
112
112
|
r"""Generate and add a new asset with a unique ID."""
|
|
113
113
|
import algopy
|
|
114
114
|
|
|
115
|
-
if asset_id and asset_id in lazy_context.ledger.
|
|
115
|
+
if asset_id and asset_id in lazy_context.ledger._asset_data:
|
|
116
116
|
raise ValueError("Asset with such ID already exists in testing context!")
|
|
117
117
|
|
|
118
118
|
for key in asset_fields:
|
|
119
119
|
if key not in AssetFields.__annotations__:
|
|
120
120
|
raise AttributeError(f"Invalid field '{key}' for Asset")
|
|
121
121
|
|
|
122
|
-
new_asset = algopy.Asset(asset_id or lazy_context.ledger.
|
|
122
|
+
new_asset = algopy.Asset(asset_id or lazy_context.ledger._get_next_asset_id())
|
|
123
123
|
default_asset_fields = {
|
|
124
124
|
"total": lazy_context.any.uint64(),
|
|
125
125
|
"decimals": lazy_context.any.uint64(1, 6),
|
|
@@ -135,7 +135,7 @@ class AVMValueGenerator:
|
|
|
135
135
|
"reserve": algopy.Account(algosdk.constants.ZERO_ADDRESS),
|
|
136
136
|
}
|
|
137
137
|
merged_fields = dict(ChainMap(asset_fields, default_asset_fields)) # type: ignore[arg-type]
|
|
138
|
-
lazy_context.ledger.
|
|
138
|
+
lazy_context.ledger._asset_data[int(new_asset.id)] = AssetFields(**merged_fields) # type: ignore[typeddict-item]
|
|
139
139
|
return new_asset
|
|
140
140
|
|
|
141
141
|
def application( # type: ignore[misc]
|
|
@@ -147,9 +147,9 @@ class AVMValueGenerator:
|
|
|
147
147
|
) -> algopy.Application:
|
|
148
148
|
r"""Generate and add a new application with a unique ID."""
|
|
149
149
|
|
|
150
|
-
new_app_id = id if id is not None else lazy_context.ledger.
|
|
150
|
+
new_app_id = id if id is not None else lazy_context.ledger._get_next_app_id()
|
|
151
151
|
|
|
152
|
-
if new_app_id in lazy_context.ledger.
|
|
152
|
+
if new_app_id in lazy_context.ledger._app_data:
|
|
153
153
|
raise ValueError(
|
|
154
154
|
f"Application id {new_app_id} has already been configured in test context!"
|
|
155
155
|
)
|
|
@@ -184,7 +184,7 @@ class AVMValueGenerator:
|
|
|
184
184
|
raise TypeError(f"incorrect type for {field!r}")
|
|
185
185
|
app_fields[field] = value # type: ignore[literal-required]
|
|
186
186
|
|
|
187
|
-
lazy_context.ledger.
|
|
187
|
+
lazy_context.ledger._app_data[new_app_id] = ApplicationContextData(
|
|
188
188
|
fields=app_fields,
|
|
189
189
|
app_id=new_app_id,
|
|
190
190
|
logs=logs or [],
|