algorand-python-testing 0.3.0b10__tar.gz → 0.4.0b2__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.0b10 → algorand_python_testing-0.4.0b2}/CHANGELOG.md +34 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/PKG-INFO +12 -11
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/README.md +11 -10
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/avm-types.md +5 -6
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/pyproject.toml +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/__init__.py +0 -3
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/arc4.py +35 -68
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/context_helpers/ledger_context.py +73 -32
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/account.py +28 -26
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/application.py +16 -4
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/asset.py +18 -15
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/contract.py +5 -7
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/global_values.py +31 -3
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/misc.py +6 -20
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/primitives/biguint.py +5 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/primitives/bytes.py +5 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/primitives/string.py +5 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/utils.py +13 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/value_generators/avm.py +33 -21
- algorand_python_testing-0.4.0b2/tests/artifacts/Contains/contract.py +189 -0
- algorand_python_testing-0.4.0b2/tests/artifacts/Contains/data/MyContract.approval.teal +1479 -0
- algorand_python_testing-0.4.0b2/tests/artifacts/Contains/data/MyContract.clear.teal +7 -0
- algorand_python_testing-0.4.0b2/tests/artifacts/CreatedAppAsset/contract.py +31 -0
- algorand_python_testing-0.4.0b2/tests/artifacts/CreatedAppAsset/data/AppExpectingEffects.approval.teal +198 -0
- algorand_python_testing-0.4.0b2/tests/artifacts/CreatedAppAsset/data/AppExpectingEffects.arc32.json +77 -0
- algorand_python_testing-0.4.0b2/tests/artifacts/CreatedAppAsset/data/AppExpectingEffects.clear.teal +7 -0
- algorand_python_testing-0.4.0b2/tests/artifacts/CreatedAppAsset/other.py +7 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/contract.py +10 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/GlobalStateContract.approval.teal +173 -173
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/GlobalStateContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/ITxnOpsContract.approval.teal +21 -21
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/ITxnOpsContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/ITxnOpsContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/LocalStateContract.approval.teal +145 -145
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/LocalStateContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.approval.teal +143 -91
- algorand_python_testing-0.4.0b2/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +253 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppGlobalContract.approval.teal +39 -39
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppGlobalContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppGlobalContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppGlobalExContract.approval.teal +13 -13
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppGlobalExContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppLocalContract.approval.teal +55 -55
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppLocalContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppLocalContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppLocalExContract.approval.teal +13 -13
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppLocalExContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppLocalExContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppParamsContract.approval.teal +83 -83
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppParamsContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAppParamsContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAssetHoldingContract.approval.teal +14 -14
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAssetHoldingContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAssetParamsContract.approval.teal +110 -110
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAssetParamsContract.arc32.json +2 -2
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAssetParamsContract.clear.teal +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/models/test_asset.py +12 -11
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/models/test_contract.py +19 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/test_context.py +1 -1
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/test_op.py +76 -3
- algorand_python_testing-0.4.0b2/tests/utilities/__init__.py +0 -0
- algorand_python_testing-0.4.0b2/tests/value_generators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/value_generators/test_avm.py +6 -3
- algorand_python_testing-0.3.0b10/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +0 -253
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.coveragerc +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.editorconfig +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.github/pull_request_template.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.github/workflows/cd.yaml +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.github/workflows/ci.yaml +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.github/workflows/gh-pages.yaml +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.gitignore +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.pre-commit-config.yaml +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.vscode/extensions.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.vscode/launch.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/.vscode/settings.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/CONTRIBUTING.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/LICENSE +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/Makefile +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/_static/custom.css +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/algopy.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/api.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/conf.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/coverage.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/examples.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/faq.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/index.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/make.bat +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/arc4-types.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/concepts.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/contract-testing.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/index.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/opcodes.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/signature-testing.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/state-management.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/subroutines.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/transactions.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/README.md +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/auction/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/auction/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/auction/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/htlc_logicsig/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/htlc_logicsig/signature.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/htlc_logicsig/test_signature.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/marketplace/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/marketplace/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/marketplace/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/proof_of_attendance/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/proof_of_attendance/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/proof_of_attendance/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/scratch_storage/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/scratch_storage/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/scratch_storage/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/simple_voting/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/simple_voting/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/simple_voting/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/zk_whitelist/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/zk_whitelist/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/examples/zk_whitelist/test_contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/scripts/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/scripts/check_stubs_cov.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/scripts/refresh_test_artifacts.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/scripts/validate_examples.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/compiled.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/constants.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/context.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/context_helpers/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/context_helpers/context_storage.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/context_helpers/txn_context.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/decorators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/decorators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/decorators/subroutine.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/enums.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/itxn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/itxn_loader.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/logicsig.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/template_variable.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/txn_fields.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/models/unsigned_builtins.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/mutable.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/block.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/constants.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/crypto.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/itxn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/pure.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/op/txn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/primitives/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/primitives/uint64.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/protocols.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/state/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/state/box.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/state/global_state.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/state/local_state.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/state/utils.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/utilities/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/utilities/budget.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/utilities/log.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/value_generators/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/value_generators/arc4.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/value_generators/txn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy/arc4.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy/gtxn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy/itxn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy/op.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy/py.typed +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy_testing/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/templates/.macros.j2 +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/templates/.release_notes.md.j2 +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/templates/CHANGELOG.md.j2 +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/conftest.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_abi_call.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_address.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_arc4_method_signature.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_bool.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_dynamic_array.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_dynamic_bytes.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_emit.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_static_array.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_string.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_struct.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_tuple.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_ufixednxm.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/arc4/test_uintn.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4ABIMethod/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4ABIMethod/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4InnerTxns/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4InnerTxns/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4PrimitiveOps/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/BoxContract/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/BoxContract/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/BoxContract/data/BoxContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/BoxContract/data/BoxContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/BoxContract/data/BoxContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10/tests/artifacts/CryptoOps → algorand_python_testing-0.4.0b2/tests/artifacts/Contains}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10/tests/artifacts/GlobalStateValidator → algorand_python_testing-0.4.0b2/tests/artifacts/CreatedAppAsset}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10/tests/artifacts/MiscellaneousOps → algorand_python_testing-0.4.0b2/tests/artifacts/CryptoOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/CryptoOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/CryptoOps/data/CryptoOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/CryptoOps/data/CryptoOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10/tests/artifacts/PrimitiveOps → algorand_python_testing-0.4.0b2/tests/artifacts/GlobalStateValidator}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/GlobalStateValidator/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10/tests/artifacts/StateMutations → algorand_python_testing-0.4.0b2/tests/artifacts/MiscellaneousOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/MiscellaneousOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10/tests/artifacts/StateOps → algorand_python_testing-0.4.0b2/tests/artifacts/PrimitiveOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10/tests/artifacts → algorand_python_testing-0.4.0b2/tests/artifacts/StateMutations}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateMutations/data/Contract.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateMutations/data/Contract.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateMutations/data/Contract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateMutations/statemutations.py +0 -0
- {algorand_python_testing-0.3.0b10/tests/contexts → algorand_python_testing-0.4.0b2/tests/artifacts/StateOps}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAcctParamsGet.approval.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAcctParamsGet.arc32.json +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAcctParamsGet.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.clear.teal +0 -0
- {algorand_python_testing-0.3.0b10/tests/models → algorand_python_testing-0.4.0b2/tests/artifacts}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/common.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/conftest.py +0 -0
- {algorand_python_testing-0.3.0b10/tests/primitives → algorand_python_testing-0.4.0b2/tests/contexts}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10/tests/state → algorand_python_testing-0.4.0b2/tests/models}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/models/test_box.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/models/test_box_map.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/models/test_box_ref.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/models/test_uenumerate.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/models/test_urange.py +0 -0
- {algorand_python_testing-0.3.0b10/tests/utilities → algorand_python_testing-0.4.0b2/tests/primitives}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/primitives/conftest.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/primitives/test_biguint.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/primitives/test_bytes.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/primitives/test_string.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/primitives/test_uint64.py +0 -0
- {algorand_python_testing-0.3.0b10/tests/value_generators → algorand_python_testing-0.4.0b2/tests/state}/__init__.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/state/conftest.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/state/test_global_state.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/state/test_local_state.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/state/test_mutations.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/test_miscellaneous_op.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/util.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/utilities/conftest.py +0 -0
- {algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/tests/utilities/test_log.py +0 -0
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
|
+
## v0.4.0-beta.2 (2024-08-27)
|
|
3
|
+
|
|
4
|
+
## v0.4.0-beta.1 (2024-08-27)
|
|
5
|
+
|
|
6
|
+
### Feature
|
|
7
|
+
|
|
8
|
+
* add support for frozen on asset holdings, including a new ledger function `update_asset_holdings` for setting asset holding balances and frozen states ([`d777ca0`](https://github.com/algorandfoundation/algorand-python-testing/commit/d777ca0a318a8ade7a20363c9ce77fe8a8bf5d68))
|
|
9
|
+
|
|
10
|
+
* expand accepted types when interacting with accounts, applications and assets ([`f448a97`](https://github.com/algorandfoundation/algorand-python-testing/commit/f448a97cb154c9f90ecf42c599b240f12928af20))
|
|
11
|
+
|
|
12
|
+
wip
|
|
13
|
+
|
|
14
|
+
* replaced `account_exists` with `account_is_funded` as the later is more useful ([`4d08690`](https://github.com/algorandfoundation/algorand-python-testing/commit/4d086903eb93a70ce1d485cdd7b12d8472ef16db))
|
|
15
|
+
|
|
16
|
+
### Fix
|
|
17
|
+
|
|
18
|
+
* use correct type for Globals.caller_application_id ([`a30d85a`](https://github.com/algorandfoundation/algorand-python-testing/commit/a30d85a4416dfc2c5d901f3ace2265384ef60c01))
|
|
19
|
+
|
|
20
|
+
* do not allow specifying `address` for applications, it is derived from the app_id ([`00fe1bc`](https://github.com/algorandfoundation/algorand-python-testing/commit/00fe1bc8ea247dcc36b01154db36b984b151e396))
|
|
21
|
+
|
|
22
|
+
* do not treat asset and application ids as possible foreign array indexes ([`94a989f`](https://github.com/algorandfoundation/algorand-python-testing/commit/94a989f77169da2ae437c629cd5f4d8a872263f6))
|
|
23
|
+
|
|
24
|
+
* removed incorrect deduction in `algopy.op.balance` ([`76e67c5`](https://github.com/algorandfoundation/algorand-python-testing/commit/76e67c5e3dd1cda388a2a948d452ba89805add6a))
|
|
25
|
+
|
|
26
|
+
* ensure all comparable types return `NotImplemented` when a comparison is not possible ([`b055fa6`](https://github.com/algorandfoundation/algorand-python-testing/commit/b055fa68531e0b7923773ec10c2097a3d64b9dbe))
|
|
27
|
+
|
|
28
|
+
* `arc4_prefix` annotated to also accept `algopy.Bytes` ([`40328ca`](https://github.com/algorandfoundation/algorand-python-testing/commit/40328ca3701b3e255193e206e8a7b1bdb441a346))
|
|
29
|
+
|
|
30
|
+
### Documentation
|
|
31
|
+
|
|
32
|
+
* include usage of `algopy_testing_context` in README.md quick start ([`4702f60`](https://github.com/algorandfoundation/algorand-python-testing/commit/4702f60cfe7d09956a5ae6dbdcd72da29fdda808))
|
|
33
|
+
|
|
34
|
+
## v0.3.0 (2024-08-22)
|
|
35
|
+
|
|
2
36
|
## v0.3.0-beta.10 (2024-08-22)
|
|
3
37
|
|
|
4
38
|
## v0.3.0-beta.9 (2024-08-22)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: algorand-python-testing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0b2
|
|
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
|
|
@@ -55,17 +55,18 @@ Alternatively, if you want to start from scratch:
|
|
|
55
55
|
```python
|
|
56
56
|
from algopy_testing import algopy_testing_context
|
|
57
57
|
from your_contract import YourContract
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
def test_your_contract():
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
with algopy_testing_context() as context:
|
|
61
|
+
# Arrange
|
|
62
|
+
contract = YourContract()
|
|
63
|
+
expected_result = ... # Your expected result here
|
|
64
|
+
|
|
65
|
+
# Act
|
|
66
|
+
result = contract.your_method(context.any.uint64()) # Your test code here
|
|
67
|
+
|
|
68
|
+
# Assert
|
|
69
|
+
assert result == expected_result
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
5. Run your tests using your preferred Python testing framework (e.g., pytest, unittest)
|
|
@@ -32,17 +32,18 @@ Alternatively, if you want to start from scratch:
|
|
|
32
32
|
```python
|
|
33
33
|
from algopy_testing import algopy_testing_context
|
|
34
34
|
from your_contract import YourContract
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
def test_your_contract():
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
with algopy_testing_context() as context:
|
|
38
|
+
# Arrange
|
|
39
|
+
contract = YourContract()
|
|
40
|
+
expected_result = ... # Your expected result here
|
|
41
|
+
|
|
42
|
+
# Act
|
|
43
|
+
result = contract.your_method(context.any.uint64()) # Your test code here
|
|
44
|
+
|
|
45
|
+
# Assert
|
|
46
|
+
assert result == expected_result
|
|
46
47
|
```
|
|
47
48
|
|
|
48
49
|
5. Run your tests using your preferred Python testing framework (e.g., pytest, unittest)
|
{algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/docs/testing-guide/avm-types.md
RENAMED
|
@@ -103,7 +103,7 @@ asset = context.ledger.get_asset(asset_id=random_asset.id)
|
|
|
103
103
|
|
|
104
104
|
# Update an asset
|
|
105
105
|
context.ledger.update_asset(
|
|
106
|
-
|
|
106
|
+
random_asset,
|
|
107
107
|
name=..., # Optional: New asset name
|
|
108
108
|
total=..., # Optional: New total supply
|
|
109
109
|
decimals=..., # Optional: Number of decimals
|
|
@@ -130,7 +130,7 @@ account = algopy.Account(raw_address) # zero address by default
|
|
|
130
130
|
# Generate a random account
|
|
131
131
|
random_account = context.any.account(
|
|
132
132
|
address=str(raw_address), # Optional: Specify a custom address, defaults to a random address
|
|
133
|
-
opted_asset_balances
|
|
133
|
+
opted_asset_balances={}, # Optional: Specify opted asset balances as dict of assets to balance
|
|
134
134
|
opted_apps=[], # Optional: Specify opted apps as sequence of algopy.Application objects
|
|
135
135
|
balance=..., # Optional: Specify an initial balance
|
|
136
136
|
min_balance=..., # Optional: Specify a minimum balance
|
|
@@ -145,7 +145,7 @@ random_account = context.any.account(
|
|
|
145
145
|
# Generate a random account that is opted into a specific asset
|
|
146
146
|
mock_asset = context.any.asset()
|
|
147
147
|
mock_account = context.any.account(
|
|
148
|
-
opted_asset_balances={mock_asset
|
|
148
|
+
opted_asset_balances={mock_asset: 123}
|
|
149
149
|
)
|
|
150
150
|
|
|
151
151
|
# Get an account by address
|
|
@@ -153,7 +153,7 @@ account = context.ledger.get_account(str(mock_account))
|
|
|
153
153
|
|
|
154
154
|
# Update an account
|
|
155
155
|
context.ledger.update_account(
|
|
156
|
-
|
|
156
|
+
mock_account,
|
|
157
157
|
balance=..., # Optional: New balance
|
|
158
158
|
min_balance=..., # Optional: New minimum balance
|
|
159
159
|
auth_address=context.any.account(), # Optional: New auth address
|
|
@@ -181,7 +181,6 @@ application = algopy.Application()
|
|
|
181
181
|
|
|
182
182
|
# Generate a random application
|
|
183
183
|
random_app = context.any.application(
|
|
184
|
-
address=..., # Optional: Specify a custom address for the application
|
|
185
184
|
approval_program=algopy.Bytes(b''), # Optional: Specify a custom approval program
|
|
186
185
|
clear_state_program=algopy.Bytes(b''), # Optional: Specify a custom clear state program
|
|
187
186
|
global_num_uint=algopy.UInt64(1), # Optional: Number of global uint values
|
|
@@ -197,7 +196,7 @@ app = context.ledger.get_app(app_id=random_app.id)
|
|
|
197
196
|
|
|
198
197
|
# Update an application
|
|
199
198
|
context.ledger.update_app(
|
|
200
|
-
|
|
199
|
+
random_app,
|
|
201
200
|
approval_program=..., # Optional: New approval program
|
|
202
201
|
clear_state_program=..., # Optional: New clear state program
|
|
203
202
|
global_num_uint=..., # Optional: New number of global uint values
|
{algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/__init__.py
RENAMED
|
@@ -25,9 +25,6 @@ from _algopy_testing.value_generators.arc4 import ARC4ValueGenerator
|
|
|
25
25
|
from _algopy_testing.value_generators.avm import AVMValueGenerator
|
|
26
26
|
from _algopy_testing.value_generators.txn import TxnValueGenerator
|
|
27
27
|
|
|
28
|
-
# TODO: clean up and ensure only algopy_testing namespace specific user facing abstractions
|
|
29
|
-
# are exposed Only keep the _value_generators, ledger_context, txn_context,
|
|
30
|
-
# context, and arc4_prexif from utils (make utils private)
|
|
31
28
|
__all__ = [
|
|
32
29
|
"ARC4Contract",
|
|
33
30
|
"ARC4ValueGenerator",
|
{algorand_python_testing-0.3.0b10 → algorand_python_testing-0.4.0b2}/src/_algopy_testing/arc4.py
RENAMED
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import dataclasses
|
|
4
4
|
import decimal
|
|
5
|
+
import functools
|
|
5
6
|
import types
|
|
6
7
|
import typing
|
|
7
8
|
|
|
@@ -169,7 +170,8 @@ class _ABIEncoded(BytesBacked):
|
|
|
169
170
|
def __eq__(self, other: object) -> bool:
|
|
170
171
|
if isinstance(other, _ABIEncoded):
|
|
171
172
|
return self._type_info == other._type_info and self.bytes == other.bytes
|
|
172
|
-
|
|
173
|
+
else:
|
|
174
|
+
return NotImplemented
|
|
173
175
|
|
|
174
176
|
def __hash__(self) -> int:
|
|
175
177
|
return hash(self.bytes)
|
|
@@ -234,7 +236,11 @@ class String(_ABIEncoded):
|
|
|
234
236
|
return String(as_string(other) + self.native)
|
|
235
237
|
|
|
236
238
|
def __eq__(self, other: String | str) -> bool: # type: ignore[override]
|
|
237
|
-
|
|
239
|
+
try:
|
|
240
|
+
other_string = as_string(other)
|
|
241
|
+
except TypeError:
|
|
242
|
+
return NotImplemented
|
|
243
|
+
return self.native == other_string
|
|
238
244
|
|
|
239
245
|
def __bool__(self) -> bool:
|
|
240
246
|
"""Returns `True` if length is not zero."""
|
|
@@ -294,47 +300,12 @@ class _UIntN(_ABIEncoded, typing.Generic[_TBitSize], metaclass=_UIntNMeta):
|
|
|
294
300
|
bytes_value = int_to_bytes(value, self._type_info.max_bytes_len)
|
|
295
301
|
self._value = as_bytes(bytes_value)
|
|
296
302
|
|
|
297
|
-
def __eq__( # type: ignore[override]
|
|
298
|
-
self,
|
|
299
|
-
other: UIntN[_TBitSize] | BigUIntN[_TBitSize] | algopy.UInt64 | algopy.BigUInt | int,
|
|
300
|
-
) -> bool:
|
|
301
|
-
raise NotImplementedError
|
|
302
|
-
|
|
303
|
-
def __ne__( # type: ignore[override]
|
|
304
|
-
self,
|
|
305
|
-
other: UIntN[_TBitSize] | BigUIntN[_TBitSize] | algopy.UInt64 | algopy.BigUInt | int,
|
|
306
|
-
) -> bool:
|
|
307
|
-
raise NotImplementedError
|
|
308
|
-
|
|
309
|
-
def __le__(
|
|
310
|
-
self,
|
|
311
|
-
other: UIntN[_TBitSize] | BigUIntN[_TBitSize] | algopy.UInt64 | algopy.BigUInt | int,
|
|
312
|
-
) -> bool:
|
|
313
|
-
raise NotImplementedError
|
|
314
|
-
|
|
315
|
-
def __lt__(
|
|
316
|
-
self,
|
|
317
|
-
other: UIntN[_TBitSize] | BigUIntN[_TBitSize] | algopy.UInt64 | algopy.BigUInt | int,
|
|
318
|
-
) -> bool:
|
|
319
|
-
raise NotImplementedError
|
|
320
|
-
|
|
321
|
-
def __ge__(
|
|
322
|
-
self,
|
|
323
|
-
other: UIntN[_TBitSize] | BigUIntN[_TBitSize] | algopy.UInt64 | algopy.BigUInt | int,
|
|
324
|
-
) -> bool:
|
|
325
|
-
raise NotImplementedError
|
|
326
|
-
|
|
327
|
-
def __gt__(
|
|
328
|
-
self,
|
|
329
|
-
other: UIntN[_TBitSize] | BigUIntN[_TBitSize] | algopy.UInt64 | algopy.BigUInt | int,
|
|
330
|
-
) -> bool:
|
|
331
|
-
raise NotImplementedError
|
|
332
|
-
|
|
333
303
|
def __bool__(self) -> bool:
|
|
334
304
|
"""Returns `True` if not equal to zero."""
|
|
335
305
|
raise NotImplementedError
|
|
336
306
|
|
|
337
307
|
|
|
308
|
+
@functools.total_ordering
|
|
338
309
|
class UIntN(_UIntN, typing.Generic[_TBitSize]): # type: ignore[type-arg]
|
|
339
310
|
"""An ARC4 UInt consisting of the number of bits specified.
|
|
340
311
|
|
|
@@ -349,22 +320,18 @@ class UIntN(_UIntN, typing.Generic[_TBitSize]): # type: ignore[type-arg]
|
|
|
349
320
|
return algopy.UInt64(int.from_bytes(self._value))
|
|
350
321
|
|
|
351
322
|
def __eq__(self, other: object) -> bool:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
def __le__(self, other: object) -> bool:
|
|
358
|
-
return as_int64(self.native) <= as_int(other, max=None)
|
|
323
|
+
try:
|
|
324
|
+
other_int = as_int64(other)
|
|
325
|
+
except (TypeError, ValueError):
|
|
326
|
+
return NotImplemented
|
|
327
|
+
return as_int64(self.native) == other_int
|
|
359
328
|
|
|
360
329
|
def __lt__(self, other: object) -> bool:
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
def __gt__(self, other: object) -> bool:
|
|
367
|
-
return as_int64(self.native) > as_int(other, max=None)
|
|
330
|
+
try:
|
|
331
|
+
other_int = as_int64(other)
|
|
332
|
+
except (TypeError, ValueError):
|
|
333
|
+
return NotImplemented
|
|
334
|
+
return as_int64(self.native) < other_int
|
|
368
335
|
|
|
369
336
|
def __bool__(self) -> bool:
|
|
370
337
|
return bool(self.native)
|
|
@@ -376,6 +343,7 @@ class UIntN(_UIntN, typing.Generic[_TBitSize]): # type: ignore[type-arg]
|
|
|
376
343
|
return _arc4_repr(self)
|
|
377
344
|
|
|
378
345
|
|
|
346
|
+
@functools.total_ordering
|
|
379
347
|
class BigUIntN(_UIntN, typing.Generic[_TBitSize]): # type: ignore[type-arg]
|
|
380
348
|
"""An ARC4 UInt consisting of the number of bits specified.
|
|
381
349
|
|
|
@@ -390,22 +358,18 @@ class BigUIntN(_UIntN, typing.Generic[_TBitSize]): # type: ignore[type-arg]
|
|
|
390
358
|
return algopy.BigUInt.from_bytes(self._value)
|
|
391
359
|
|
|
392
360
|
def __eq__(self, other: object) -> bool:
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
def __le__(self, other: object) -> bool:
|
|
399
|
-
return as_int512(self.native) <= as_int(other, max=None)
|
|
361
|
+
try:
|
|
362
|
+
other_int = as_int512(other)
|
|
363
|
+
except (TypeError, ValueError):
|
|
364
|
+
return NotImplemented
|
|
365
|
+
return as_int512(self.native) == other_int
|
|
400
366
|
|
|
401
367
|
def __lt__(self, other: object) -> bool:
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
def __gt__(self, other: object) -> bool:
|
|
408
|
-
return as_int512(self.native) > as_int(other, max=None)
|
|
368
|
+
try:
|
|
369
|
+
other_int = as_int512(other)
|
|
370
|
+
except (TypeError, ValueError):
|
|
371
|
+
return NotImplemented
|
|
372
|
+
return as_int512(self.native) < other_int
|
|
409
373
|
|
|
410
374
|
def __bool__(self) -> bool:
|
|
411
375
|
return bool(self.native)
|
|
@@ -749,8 +713,11 @@ class Address(StaticArray[Byte, typing.Literal[32]]):
|
|
|
749
713
|
`Account` or `str`"""
|
|
750
714
|
if isinstance(other, Address | Account):
|
|
751
715
|
return self.bytes == other.bytes
|
|
752
|
-
|
|
753
|
-
|
|
716
|
+
elif isinstance(other, str):
|
|
717
|
+
other_bytes: bytes = algosdk.encoding.decode_address(other)
|
|
718
|
+
return self.bytes == other_bytes
|
|
719
|
+
else:
|
|
720
|
+
return NotImplemented
|
|
754
721
|
|
|
755
722
|
def __str__(self) -> str:
|
|
756
723
|
return str(self.native)
|
|
@@ -6,7 +6,12 @@ from collections import defaultdict
|
|
|
6
6
|
from _algopy_testing.constants import MAX_BOX_SIZE
|
|
7
7
|
from _algopy_testing.models.account import Account
|
|
8
8
|
from _algopy_testing.primitives.uint64 import UInt64
|
|
9
|
-
from _algopy_testing.utils import
|
|
9
|
+
from _algopy_testing.utils import (
|
|
10
|
+
as_bytes,
|
|
11
|
+
assert_address_is_valid,
|
|
12
|
+
convert_stack_to_native,
|
|
13
|
+
get_default_global_fields,
|
|
14
|
+
)
|
|
10
15
|
|
|
11
16
|
if typing.TYPE_CHECKING:
|
|
12
17
|
import algopy
|
|
@@ -58,37 +63,61 @@ class LedgerContext:
|
|
|
58
63
|
assert_address_is_valid(address)
|
|
59
64
|
return algopy.Account(address)
|
|
60
65
|
|
|
61
|
-
def
|
|
62
|
-
"""Check if an account
|
|
66
|
+
def account_is_funded(self, account: algopy.Account | str) -> bool:
|
|
67
|
+
"""Check if an account has funds.
|
|
63
68
|
|
|
64
69
|
Args:
|
|
65
70
|
address (str): The account address.
|
|
66
71
|
|
|
67
72
|
Returns:
|
|
68
|
-
bool: True if the account
|
|
73
|
+
bool: True if the account has an algo balance > 0, False otherwise.
|
|
69
74
|
"""
|
|
75
|
+
address = _get_address(account)
|
|
70
76
|
assert_address_is_valid(address)
|
|
71
|
-
return address
|
|
77
|
+
return self._account_data[address].fields["balance"] > 0
|
|
72
78
|
|
|
73
79
|
def update_account(
|
|
74
80
|
self,
|
|
75
|
-
|
|
76
|
-
opted_asset_balances: dict[int, algopy.UInt64] | None = None,
|
|
81
|
+
account: algopy.Account | str,
|
|
77
82
|
**account_fields: typing.Unpack[AccountFields],
|
|
78
83
|
) -> None:
|
|
79
84
|
"""Update account fields.
|
|
80
85
|
|
|
81
86
|
Args:
|
|
82
|
-
|
|
83
|
-
opted_asset_balances (dict[int, algopy.UInt64] | None): The opted asset balances .
|
|
87
|
+
account: The account.
|
|
84
88
|
**account_fields: The fields to update.
|
|
85
89
|
"""
|
|
90
|
+
address = _get_address(account)
|
|
86
91
|
assert_address_is_valid(address)
|
|
87
92
|
self._account_data[address].fields.update(account_fields)
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
def update_asset_holdings(
|
|
95
|
+
self,
|
|
96
|
+
asset: algopy.Asset | algopy.UInt64 | int,
|
|
97
|
+
account: algopy.Account | str,
|
|
98
|
+
*,
|
|
99
|
+
balance: algopy.UInt64 | int | None = None,
|
|
100
|
+
frozen: bool | None = None,
|
|
101
|
+
) -> None:
|
|
102
|
+
"""Update asset holdings for account, only specified values will be updated.
|
|
103
|
+
|
|
104
|
+
Account will also be opted-in to asset
|
|
105
|
+
"""
|
|
106
|
+
from _algopy_testing.models.account import AssetHolding
|
|
107
|
+
|
|
108
|
+
address = _get_address(account)
|
|
109
|
+
account_data = self._account_data[address]
|
|
110
|
+
asset_id = _get_asset_id(asset)
|
|
111
|
+
asset = self.get_asset(asset_id)
|
|
112
|
+
|
|
113
|
+
holdings = account_data.opted_assets.setdefault(
|
|
114
|
+
asset_id,
|
|
115
|
+
AssetHolding(balance=UInt64(), frozen=asset.default_frozen),
|
|
116
|
+
)
|
|
117
|
+
if balance is not None:
|
|
118
|
+
holdings.balance = UInt64(int(balance))
|
|
119
|
+
if frozen is not None:
|
|
120
|
+
holdings.frozen = frozen
|
|
92
121
|
|
|
93
122
|
def get_asset(self, asset_id: algopy.UInt64 | int) -> algopy.Asset:
|
|
94
123
|
"""Get an asset by ID.
|
|
@@ -104,13 +133,13 @@ class LedgerContext:
|
|
|
104
133
|
"""
|
|
105
134
|
import algopy
|
|
106
135
|
|
|
107
|
-
asset_id =
|
|
136
|
+
asset_id = _get_asset_id(asset_id)
|
|
108
137
|
if asset_id not in self._asset_data:
|
|
109
138
|
raise ValueError("Asset not found in testing context!")
|
|
110
139
|
|
|
111
140
|
return algopy.Asset(asset_id)
|
|
112
141
|
|
|
113
|
-
def asset_exists(self,
|
|
142
|
+
def asset_exists(self, asset: algopy.Asset | algopy.UInt64 | int) -> bool:
|
|
114
143
|
"""Check if an asset exists.
|
|
115
144
|
|
|
116
145
|
Args:
|
|
@@ -119,12 +148,12 @@ class LedgerContext:
|
|
|
119
148
|
Returns:
|
|
120
149
|
bool: True if the asset exists, False otherwise.
|
|
121
150
|
"""
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
asset_id = int(asset_id) if isinstance(asset_id, algopy.UInt64) else asset_id
|
|
151
|
+
asset_id = _get_asset_id(asset)
|
|
125
152
|
return asset_id in self._asset_data
|
|
126
153
|
|
|
127
|
-
def update_asset(
|
|
154
|
+
def update_asset(
|
|
155
|
+
self, asset: algopy.Asset | algopy.UInt64 | int, **asset_fields: typing.Unpack[AssetFields]
|
|
156
|
+
) -> None:
|
|
128
157
|
"""Update asset fields.
|
|
129
158
|
|
|
130
159
|
Args:
|
|
@@ -134,6 +163,7 @@ class LedgerContext:
|
|
|
134
163
|
Raises:
|
|
135
164
|
ValueError: If the asset is not found.
|
|
136
165
|
"""
|
|
166
|
+
asset_id = _get_asset_id(asset)
|
|
137
167
|
if asset_id not in self._asset_data:
|
|
138
168
|
raise ValueError("Asset not found in testing context!")
|
|
139
169
|
self._asset_data[asset_id].update(asset_fields)
|
|
@@ -154,28 +184,30 @@ class LedgerContext:
|
|
|
154
184
|
app_data = self._get_app_data(app_id)
|
|
155
185
|
return algopy.Application(app_data.app_id)
|
|
156
186
|
|
|
157
|
-
def app_exists(self,
|
|
187
|
+
def app_exists(self, app: algopy.Application | algopy.UInt64 | int) -> bool:
|
|
158
188
|
"""Check if an application exists.
|
|
159
189
|
|
|
160
190
|
Args:
|
|
161
|
-
app
|
|
191
|
+
app: The application to check.
|
|
162
192
|
|
|
163
193
|
Returns:
|
|
164
194
|
bool: True if the application exists, False otherwise.
|
|
165
195
|
"""
|
|
166
|
-
app_id = _get_app_id(
|
|
196
|
+
app_id = _get_app_id(app)
|
|
167
197
|
return app_id in self._app_data
|
|
168
198
|
|
|
169
199
|
def update_app(
|
|
170
|
-
self,
|
|
200
|
+
self,
|
|
201
|
+
app: algopy.Application | algopy.UInt64 | int,
|
|
202
|
+
**application_fields: typing.Unpack[ApplicationFields],
|
|
171
203
|
) -> None:
|
|
172
204
|
"""Update application fields.
|
|
173
205
|
|
|
174
206
|
Args:
|
|
175
|
-
|
|
207
|
+
app: The application to update.
|
|
176
208
|
**application_fields: The fields to update.
|
|
177
209
|
"""
|
|
178
|
-
app_data = self._get_app_data(
|
|
210
|
+
app_data = self._get_app_data(app)
|
|
179
211
|
app_data.fields.update(application_fields)
|
|
180
212
|
|
|
181
213
|
def get_global_state(
|
|
@@ -198,7 +230,7 @@ class LedgerContext:
|
|
|
198
230
|
self,
|
|
199
231
|
app: algopy.Contract | algopy.Application | algopy.UInt64 | int,
|
|
200
232
|
key: bytes | algopy.Bytes,
|
|
201
|
-
value: int | bytes | None,
|
|
233
|
+
value: algopy.Bytes | algopy.UInt64 | int | bytes | None,
|
|
202
234
|
) -> None:
|
|
203
235
|
"""Set global state for an application.
|
|
204
236
|
|
|
@@ -213,7 +245,7 @@ class LedgerContext:
|
|
|
213
245
|
if key_bytes in global_state:
|
|
214
246
|
del global_state[key_bytes]
|
|
215
247
|
else:
|
|
216
|
-
global_state[key_bytes] = value
|
|
248
|
+
global_state[key_bytes] = convert_stack_to_native(value)
|
|
217
249
|
|
|
218
250
|
def get_local_state(
|
|
219
251
|
self,
|
|
@@ -242,7 +274,7 @@ class LedgerContext:
|
|
|
242
274
|
app: algopy.Contract | algopy.Application | algopy.UInt64 | int,
|
|
243
275
|
account: algopy.Account | str,
|
|
244
276
|
key: algopy.Bytes | bytes,
|
|
245
|
-
value: int | bytes | None,
|
|
277
|
+
value: algopy.Bytes | algopy.UInt64 | int | bytes | None,
|
|
246
278
|
) -> None:
|
|
247
279
|
"""Set local state for an application and account.
|
|
248
280
|
|
|
@@ -260,7 +292,7 @@ class LedgerContext:
|
|
|
260
292
|
if composite_key in local_state:
|
|
261
293
|
del local_state[composite_key]
|
|
262
294
|
else:
|
|
263
|
-
local_state[composite_key] = value
|
|
295
|
+
local_state[composite_key] = convert_stack_to_native(value)
|
|
264
296
|
|
|
265
297
|
def get_box(
|
|
266
298
|
self,
|
|
@@ -372,16 +404,14 @@ class LedgerContext:
|
|
|
372
404
|
**global_fields: The fields to patch.
|
|
373
405
|
|
|
374
406
|
Raises:
|
|
375
|
-
|
|
407
|
+
ValueError: If invalid fields are provided.
|
|
376
408
|
"""
|
|
377
409
|
from _algopy_testing.op.global_values import GlobalFields
|
|
378
410
|
|
|
379
411
|
invalid_keys = global_fields.keys() - GlobalFields.__annotations__.keys()
|
|
380
412
|
|
|
381
413
|
if invalid_keys:
|
|
382
|
-
raise
|
|
383
|
-
f"Invalid field(s) found during patch for `Global`: {', '.join(invalid_keys)}"
|
|
384
|
-
)
|
|
414
|
+
raise ValueError(f"Invalid Global fields: {', '.join(invalid_keys)}")
|
|
385
415
|
|
|
386
416
|
self._global_fields.update(global_fields)
|
|
387
417
|
|
|
@@ -450,3 +480,14 @@ def _get_app_id(app: algopy.UInt64 | algopy.Application | algopy.Contract | int)
|
|
|
450
480
|
else:
|
|
451
481
|
raise TypeError("invalid type")
|
|
452
482
|
return app_id
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
def _get_address(account: algopy.Account | str) -> str:
|
|
486
|
+
return account if isinstance(account, str) else account.public_key
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
def _get_asset_id(asset: algopy.Asset | algopy.UInt64 | int) -> int:
|
|
490
|
+
from _algopy_testing.models import Asset
|
|
491
|
+
|
|
492
|
+
asset_id = asset.id if isinstance(asset, Asset) else asset
|
|
493
|
+
return int(asset_id)
|
|
@@ -33,39 +33,42 @@ class AccountFields(typing.TypedDict, total=False):
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def get_empty_account() -> AccountContextData:
|
|
36
|
-
zero = UInt64()
|
|
37
36
|
return AccountContextData(
|
|
38
37
|
fields={
|
|
39
|
-
"balance":
|
|
38
|
+
"balance": UInt64(),
|
|
40
39
|
"min_balance": UInt64(DEFAULT_ACCOUNT_MIN_BALANCE),
|
|
41
40
|
"auth_address": Account(),
|
|
42
|
-
"total_num_uint":
|
|
43
|
-
"total_num_byte_slice":
|
|
44
|
-
"total_extra_app_pages":
|
|
45
|
-
"total_apps_created":
|
|
46
|
-
"total_apps_opted_in":
|
|
47
|
-
"total_assets_created":
|
|
48
|
-
"total_assets":
|
|
49
|
-
"total_boxes":
|
|
50
|
-
"total_box_bytes":
|
|
51
|
-
}
|
|
41
|
+
"total_num_uint": UInt64(),
|
|
42
|
+
"total_num_byte_slice": UInt64(),
|
|
43
|
+
"total_extra_app_pages": UInt64(),
|
|
44
|
+
"total_apps_created": UInt64(),
|
|
45
|
+
"total_apps_opted_in": UInt64(),
|
|
46
|
+
"total_assets_created": UInt64(),
|
|
47
|
+
"total_assets": UInt64(),
|
|
48
|
+
"total_boxes": UInt64(),
|
|
49
|
+
"total_box_bytes": UInt64(),
|
|
50
|
+
},
|
|
52
51
|
)
|
|
53
52
|
|
|
54
53
|
|
|
54
|
+
@dataclasses.dataclass
|
|
55
|
+
class AssetHolding:
|
|
56
|
+
balance: algopy.UInt64
|
|
57
|
+
frozen: bool
|
|
58
|
+
|
|
59
|
+
|
|
55
60
|
@dataclasses.dataclass
|
|
56
61
|
class AccountContextData:
|
|
57
62
|
"""Stores account-related information.
|
|
58
63
|
|
|
59
64
|
Attributes:
|
|
60
|
-
|
|
61
|
-
opted_apps (dict[int, algopy.
|
|
65
|
+
opted_assets (dict[int, AssetHolding]): Mapping of asset IDs to holdings.
|
|
66
|
+
opted_apps (dict[int, algopy.Application]): Mapping of application IDs to instances.
|
|
62
67
|
fields (AccountFields): Additional account fields.
|
|
63
68
|
"""
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
68
|
-
opted_apps: dict[algopy.UInt64, algopy.Application] = dataclasses.field(default_factory=dict)
|
|
70
|
+
opted_assets: dict[int, AssetHolding] = dataclasses.field(default_factory=dict)
|
|
71
|
+
opted_apps: dict[int, algopy.Application] = dataclasses.field(default_factory=dict)
|
|
69
72
|
fields: AccountFields = dataclasses.field(default_factory=AccountFields) # type: ignore[arg-type]
|
|
70
73
|
|
|
71
74
|
|
|
@@ -96,7 +99,7 @@ class Account(BytesBacked):
|
|
|
96
99
|
from _algopy_testing.models import Application, Asset
|
|
97
100
|
|
|
98
101
|
if isinstance(asset_or_app, Asset):
|
|
99
|
-
return asset_or_app.id in self.data.
|
|
102
|
+
return asset_or_app.id in self.data.opted_assets
|
|
100
103
|
elif isinstance(asset_or_app, Application):
|
|
101
104
|
return asset_or_app.id in self.data.opted_apps
|
|
102
105
|
|
|
@@ -131,13 +134,12 @@ class Account(BytesBacked):
|
|
|
131
134
|
return self.public_key
|
|
132
135
|
|
|
133
136
|
def __eq__(self, other: object) -> bool:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return NotImplemented
|
|
137
|
+
if isinstance(other, Account):
|
|
138
|
+
return self._public_key == other._public_key
|
|
139
|
+
elif isinstance(other, str):
|
|
140
|
+
return self.public_key == other
|
|
141
|
+
else:
|
|
142
|
+
return NotImplemented
|
|
141
143
|
|
|
142
144
|
def __bool__(self) -> bool:
|
|
143
145
|
return bool(self._public_key) and self._public_key != algosdk.encoding.decode_address(
|