algorand-python-testing 0.5.0__tar.gz → 0.6.0__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.5.0 → algorand_python_testing-0.6.0}/.github/workflows/cd.yaml +3 -12
- algorand_python_testing-0.6.0/.github/workflows/ci.yaml +77 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/CHANGELOG.md +41 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/PKG-INFO +3 -2
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/coverage.md +4 -1
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/concepts.md +5 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/pyproject.toml +28 -8
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/scripts/refresh_test_artifacts.py +4 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/scripts/validate_examples.py +3 -1
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/arc4.py +42 -2
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/decorators/arc4.py +1 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/account.py +3 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/contract.py +2 -2
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/pure.py +1 -1
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/primitives/array.py +3 -0
- algorand_python_testing-0.6.0/src/_algopy_testing/serialize.py +151 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/state/box.py +44 -4
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/state/global_state.py +6 -7
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/state/local_state.py +3 -3
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/state/utils.py +10 -2
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/utilities/__init__.py +2 -1
- algorand_python_testing-0.6.0/src/_algopy_testing/utilities/size_of.py +9 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/utils.py +20 -2
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy/__init__.py +2 -1
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_tuple.py +15 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4ABIMethod/contract.py +2 -1
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.approval.teal +25 -14
- algorand_python_testing-0.6.0/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +253 -0
- algorand_python_testing-0.6.0/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc56.json +432 -0
- algorand_python_testing-0.6.0/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc56.json +107 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.approval.teal +6 -6
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc56.json +1586 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/Contract.approval.teal +12 -17
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/Contract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/Arrays/data/Contract.arc56.json +347 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/ImmutableArrayContract.approval.teal +251 -251
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/ImmutableArrayContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/Arrays/data/ImmutableArrayContract.arc56.json +718 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/StaticSizeContract.approval.teal +21 -32
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/StaticSizeContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/Arrays/data/StaticSizeContract.arc56.json +271 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/immutable.py +1 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/BoxContract/data/BoxContract.approval.teal +6 -20
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/BoxContract/data/BoxContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/BoxContract/data/BoxContract.arc56.json +143 -0
- algorand_python_testing-0.6.0/tests/artifacts/CreatedAppAsset/data/AppCall.arc56.json +102 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/data/AppExpectingEffects.approval.teal +1 -1
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/data/AppExpectingEffects.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/CreatedAppAsset/data/AppExpectingEffects.arc56.json +189 -0
- algorand_python_testing-0.6.0/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc56.json +480 -0
- algorand_python_testing-0.6.0/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc56.json +117 -0
- algorand_python_testing-0.6.0/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc56.json +1090 -0
- algorand_python_testing-0.6.0/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc56.json +1740 -0
- algorand_python_testing-0.6.0/tests/artifacts/StateMutations/data/StateMutations.arc56.json +264 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/contract.py +15 -1
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/GlobalStateContract.approval.teal +320 -175
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +563 -0
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/GlobalStateContract.arc56.json +865 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/ITxnOpsContract.approval.teal +21 -21
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/ITxnOpsContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/ITxnOpsContract.arc56.json +102 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/LocalStateContract.approval.teal +261 -176
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +381 -0
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/LocalStateContract.arc56.json +618 -0
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc56.json +512 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppGlobalContract.approval.teal +40 -40
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppGlobalContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAppGlobalContract.arc56.json +272 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppGlobalExContract.approval.teal +13 -13
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc56.json +104 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppLocalContract.approval.teal +51 -51
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppLocalContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAppLocalContract.arc56.json +350 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppLocalExContract.approval.teal +8 -8
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppLocalExContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAppLocalExContract.arc56.json +118 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppParamsContract.approval.teal +72 -72
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppParamsContract.arc32.json +1 -1
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAppParamsContract.arc56.json +319 -0
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc56.json +138 -0
- algorand_python_testing-0.6.0/tests/artifacts/StateOps/data/StateAssetParamsContract.arc56.json +394 -0
- algorand_python_testing-0.6.0/tests/artifacts/Tuples/contract.py +11 -0
- algorand_python_testing-0.6.0/tests/artifacts/Tuples/data/TuplesContract.approval.teal +42 -0
- algorand_python_testing-0.6.0/tests/artifacts/Tuples/data/TuplesContract.arc32.json +50 -0
- algorand_python_testing-0.6.0/tests/artifacts/Tuples/data/TuplesContract.arc56.json +102 -0
- algorand_python_testing-0.6.0/tests/artifacts/Tuples/data/TuplesContract.clear.teal +7 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/common.py +4 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/models/test_box.py +186 -35
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/models/test_box_map.py +89 -57
- algorand_python_testing-0.6.0/tests/state/test_global_state.py +310 -0
- algorand_python_testing-0.6.0/tests/state/test_local_state.py +181 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/test_miscellaneous_op.py +2 -2
- algorand_python_testing-0.6.0/tests/utilities/test_size_of.py +65 -0
- algorand_python_testing-0.6.0/tests/value_generators/__init__.py +0 -0
- algorand_python_testing-0.5.0/.github/workflows/ci.yaml +0 -47
- algorand_python_testing-0.5.0/src/_algopy_testing/serialize.py +0 -158
- algorand_python_testing-0.5.0/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +0 -253
- algorand_python_testing-0.5.0/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +0 -528
- algorand_python_testing-0.5.0/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +0 -359
- algorand_python_testing-0.5.0/tests/state/test_global_state.py +0 -133
- algorand_python_testing-0.5.0/tests/state/test_local_state.py +0 -49
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.coveragerc +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.editorconfig +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.github/dependabot.yml +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.github/pull_request_template.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.github/workflows/gh-pages.yaml +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.gitignore +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.pre-commit-config.yaml +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.vscode/extensions.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.vscode/launch.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/.vscode/settings.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/CONTRIBUTING.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/LICENSE +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/README.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/Makefile +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/_static/custom.css +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/algopy.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/api.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/conf.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/examples.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/faq.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/index.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/make.bat +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/arc4-types.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/avm-types.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/contract-testing.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/index.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/opcodes.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/signature-testing.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/state-management.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/subroutines.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/transactions.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/README.md +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/auction/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/auction/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/auction/test_contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/htlc_logicsig/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/htlc_logicsig/signature.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/htlc_logicsig/test_signature.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/marketplace/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/marketplace/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/marketplace/test_contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/proof_of_attendance/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/proof_of_attendance/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/proof_of_attendance/test_contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/scratch_storage/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/scratch_storage/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/scratch_storage/test_contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/simple_voting/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/simple_voting/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/simple_voting/test_contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/zk_whitelist/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/zk_whitelist/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/examples/zk_whitelist/test_contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/scripts/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/scripts/check_stubs_cov.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/compiled.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/constants.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/context.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/context_helpers/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/context_helpers/context_storage.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/context_helpers/ledger_context.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/context_helpers/txn_context.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/decorators/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/decorators/subroutine.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/enums.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/gtxn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/itxn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/itxn_loader.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/application.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/asset.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/logicsig.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/template_variable.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/txn_fields.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/models/unsigned_builtins.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/mutable.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/block.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/constants.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/crypto.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/global_values.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/itxn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/misc.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/txn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/primitives/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/primitives/biguint.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/primitives/bytes.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/primitives/string.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/primitives/uint64.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/protocols.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/state/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/utilities/budget.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/utilities/log.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/value_generators/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/value_generators/arc4.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/value_generators/avm.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/value_generators/txn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy/arc4.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy/gtxn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy/itxn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy/op.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy/py.typed +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy_testing/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/algopy_testing/py.typed +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/templates/.macros.j2 +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/templates/.release_notes.md.j2 +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/templates/CHANGELOG.md.j2 +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/conftest.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_abi_call.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_address.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_arc4_method_signature.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_bool.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_dynamic_array.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_dynamic_bytes.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_emit.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_static_array.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_string.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_struct.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_ufixednxm.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/arc4/test_uintn.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4ABIMethod/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4InnerTxns/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4InnerTxns/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4PrimitiveOps/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/Contract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/ImmutableArrayContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/data/StaticSizeContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/static_size.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Arrays/uint64.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/BoxContract/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/BoxContract/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/BoxContract/data/BoxContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Contains/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Contains/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Contains/data/MyContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/Contains/data/MyContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/data/AppCall.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/data/AppCall.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/data/AppCall.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/data/AppExpectingEffects.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CreatedAppAsset/other.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CryptoOps/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CryptoOps/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CryptoOps/data/CryptoOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/CryptoOps/data/CryptoOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/GlobalStateValidator/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/GlobalStateValidator/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/MiscellaneousOps/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/MiscellaneousOps/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/PrimitiveOps/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/PrimitiveOps/contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/data/Contract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/data/Contract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/data/Contract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/data/StateMutations.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/data/StateMutations.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/data/StateMutations.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateMutations/statemutations.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/GlobalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/ITxnOpsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/LocalStateContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAcctParamsGet.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAcctParamsGet.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAcctParamsGet.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppGlobalContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppGlobalExContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppLocalContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppLocalExContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAppParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAssetHoldingContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAssetHoldingContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAssetParamsContract.approval.teal +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAssetParamsContract.arc32.json +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/artifacts/StateOps/data/StateAssetParamsContract.clear.teal +0 -0
- {algorand_python_testing-0.5.0/tests/artifacts → algorand_python_testing-0.6.0/tests/artifacts/Tuples}/__init__.py +0 -0
- {algorand_python_testing-0.5.0/tests/contexts → algorand_python_testing-0.6.0/tests/artifacts}/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/conftest.py +0 -0
- {algorand_python_testing-0.5.0/tests/models → algorand_python_testing-0.6.0/tests/contexts}/__init__.py +0 -0
- {algorand_python_testing-0.5.0/tests/primitives → algorand_python_testing-0.6.0/tests/models}/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/models/test_asset.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/models/test_box_ref.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/models/test_contract.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/models/test_uenumerate.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/models/test_urange.py +0 -0
- {algorand_python_testing-0.5.0/tests/state → algorand_python_testing-0.6.0/tests/primitives}/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/primitives/conftest.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/primitives/test_biguint.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/primitives/test_bytes.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/primitives/test_string.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/primitives/test_uint64.py +0 -0
- {algorand_python_testing-0.5.0/tests/utilities → algorand_python_testing-0.6.0/tests/state}/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/state/conftest.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/state/test_mutations.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/test_array.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/test_context.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/test_op.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/util.py +0 -0
- {algorand_python_testing-0.5.0/tests/value_generators → algorand_python_testing-0.6.0/tests/utilities}/__init__.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/utilities/conftest.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/utilities/test_log.py +0 -0
- {algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/tests/value_generators/test_avm.py +0 -0
|
@@ -65,8 +65,8 @@ jobs:
|
|
|
65
65
|
- name: Check pre-commits (examples)
|
|
66
66
|
run: hatch run examples:check
|
|
67
67
|
|
|
68
|
-
- name:
|
|
69
|
-
run: hatch build
|
|
68
|
+
- name: Build wheels
|
|
69
|
+
run: hatch build
|
|
70
70
|
|
|
71
71
|
- name: Run tests (codebase)
|
|
72
72
|
run: hatch run tests
|
|
@@ -74,17 +74,8 @@ jobs:
|
|
|
74
74
|
- name: Run tests (examples)
|
|
75
75
|
run: hatch run examples:tests
|
|
76
76
|
|
|
77
|
-
- name: Python Semantic Release
|
|
78
|
-
id: semantic-release
|
|
79
|
-
if: ${{ github.ref == 'refs/heads/main' }}
|
|
80
|
-
uses: python-semantic-release/python-semantic-release@master
|
|
81
|
-
with:
|
|
82
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
83
|
-
prerelease: ${{ env.PRERELEASE == 'true' }}
|
|
84
|
-
root_options: $DRY_RUN
|
|
85
|
-
|
|
86
77
|
- name: Publish to PyPI
|
|
87
|
-
if: ${{ !inputs.dry_run
|
|
78
|
+
if: ${{ !inputs.dry_run }}
|
|
88
79
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
89
80
|
with:
|
|
90
81
|
packages-dir: dist
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Check Python Code (algopy_testing)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
pull_request:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: "0 8 * * 1" # Each monday 8 AM UTC
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check-python:
|
|
11
|
+
runs-on: "ubuntu-latest"
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout source code
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Python 3.12
|
|
17
|
+
uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.12"
|
|
20
|
+
cache: "pip"
|
|
21
|
+
|
|
22
|
+
- name: Install hatch
|
|
23
|
+
run: pip install hatch
|
|
24
|
+
|
|
25
|
+
- name: Start LocalNet
|
|
26
|
+
run: pipx install algokit && algokit localnet start
|
|
27
|
+
|
|
28
|
+
- name: Check pre-commits
|
|
29
|
+
run: hatch run check
|
|
30
|
+
|
|
31
|
+
- name: Check pre-commits (examples)
|
|
32
|
+
run: hatch run examples:check
|
|
33
|
+
|
|
34
|
+
- name: Validate examples folder
|
|
35
|
+
run: hatch run validate_examples
|
|
36
|
+
|
|
37
|
+
- name: Check wheels can be built
|
|
38
|
+
run: hatch build
|
|
39
|
+
|
|
40
|
+
- name: Check doctests
|
|
41
|
+
run: hatch run docs:test
|
|
42
|
+
|
|
43
|
+
test-python-matrix:
|
|
44
|
+
runs-on: "ubuntu-latest"
|
|
45
|
+
strategy:
|
|
46
|
+
matrix:
|
|
47
|
+
python-version: ["3.12", "3.13"]
|
|
48
|
+
steps:
|
|
49
|
+
- name: Checkout source code
|
|
50
|
+
uses: actions/checkout@v4
|
|
51
|
+
|
|
52
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
53
|
+
uses: actions/setup-python@v5
|
|
54
|
+
with:
|
|
55
|
+
python-version: ${{ matrix.python-version }}
|
|
56
|
+
cache: "pip"
|
|
57
|
+
|
|
58
|
+
- name: Install hatch
|
|
59
|
+
run: pip install hatch
|
|
60
|
+
|
|
61
|
+
- name: Start LocalNet
|
|
62
|
+
run: pipx install algokit && algokit localnet start
|
|
63
|
+
|
|
64
|
+
- name: Run tests with Python ${{ matrix.python-version }}
|
|
65
|
+
run: hatch run test.py${{ matrix.python-version }}:ci
|
|
66
|
+
|
|
67
|
+
- name: Run examples tests with Python ${{ matrix.python-version }}
|
|
68
|
+
run: hatch run examples.py${{ matrix.python-version }}:tests
|
|
69
|
+
|
|
70
|
+
- name: Upload coverage artifacts
|
|
71
|
+
uses: actions/upload-artifact@v4
|
|
72
|
+
if: ${{ matrix.python-version == '3.13' }}
|
|
73
|
+
with:
|
|
74
|
+
name: coverage-reports
|
|
75
|
+
path: |
|
|
76
|
+
./coverage.xml
|
|
77
|
+
retention-days: 14
|
|
@@ -1,4 +1,45 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## v0.6.0 (2025-10-20)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add mock implementations for validation functionality ([`ccde074`](https://github.com/algorandfoundation/algorand-python-testing/commit/ccde0740889bd68ef0fba418182d71ac0fc9f76a))
|
|
8
|
+
|
|
9
|
+
### Documentation
|
|
10
|
+
|
|
11
|
+
* add note about data validation in the testing library ([`bc47a68`](https://github.com/algorandfoundation/algorand-python-testing/commit/bc47a6838cf00907f2a718ddb8cb45fe97947d77))
|
|
12
|
+
|
|
13
|
+
* add missing native types in coverage table ([`a95116c`](https://github.com/algorandfoundation/algorand-python-testing/commit/a95116c567dc77cfcf4f7ec517df60bb3d9d1eb5))
|
|
14
|
+
|
|
15
|
+
## v0.6.0-beta.3 (2025-05-16)
|
|
16
|
+
|
|
17
|
+
### Bug fixes
|
|
18
|
+
|
|
19
|
+
* fixes type checking of tuples with primitive types ([`e971ad6`](https://github.com/algorandfoundation/algorand-python-testing/commit/e971ad6b125f269cd0874c09d58d8962f7622f8d))
|
|
20
|
+
|
|
21
|
+
Adds checks to ensure that type validation applies to classes only.
|
|
22
|
+
|
|
23
|
+
## v0.6.0-beta.2 (2025-05-15)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* add stubs for box create function ([`1fe6fe5`](https://github.com/algorandfoundation/algorand-python-testing/commit/1fe6fe55358630a6abea2f69406821cb6031a4d5))
|
|
28
|
+
|
|
29
|
+
## v0.6.0-beta.1 (2025-05-09)
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* add stub implementation of algopy.size_of function for calculating static storage size of types ([`98e6816`](https://github.com/algorandfoundation/algorand-python-testing/commit/98e6816a48f1cff206f2c99d1384af1855d352c2))
|
|
34
|
+
|
|
35
|
+
### Bug fixes
|
|
36
|
+
|
|
37
|
+
* ensure size_of is exported from algopy module ([`01c055a`](https://github.com/algorandfoundation/algorand-python-testing/commit/01c055a4d2bd1fe17324bd91f7a83810900baa4e))
|
|
38
|
+
|
|
39
|
+
### Documentation
|
|
40
|
+
|
|
41
|
+
* include size_of in coverage doc ([`2c73646`](https://github.com/algorandfoundation/algorand-python-testing/commit/2c7364626357844437fd80b6039c112a87b277bb))
|
|
42
|
+
|
|
2
43
|
## v0.5.0 (2025-02-20)
|
|
3
44
|
|
|
4
45
|
## v0.5.0-beta.1 (2025-02-19)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: algorand-python-testing
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
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
|
|
@@ -12,9 +12,10 @@ Classifier: Development Status :: 4 - Beta
|
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
16
|
Classifier: Topic :: Software Development :: Testing
|
|
16
17
|
Requires-Python: >=3.12
|
|
17
|
-
Requires-Dist: algorand-python
|
|
18
|
+
Requires-Dist: algorand-python<3,>=2.0
|
|
18
19
|
Requires-Dist: coincurve>=19.0.1
|
|
19
20
|
Requires-Dist: ecdsa>=0.17.0
|
|
20
21
|
Requires-Dist: pycryptodomex<4,>=3.6.0
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
See which `algorand-python` stubs are implemented by the `algorand-python-testing` library. See the [Concepts](testing-guide/concepts.md#types-of-algopy-stub-implementations) section for more details on the implementation categories. Refer to the [`algorand-python` stubs API](api.md) for the full list of the stubs for which the `algorand-python-testing` library provides implementations referenced in the table below.
|
|
4
4
|
|
|
5
5
|
| Name | Implementation type |
|
|
6
|
-
|
|
6
|
+
|---------------------------------------------|---------------------|
|
|
7
7
|
| algopy.Account | Emulated |
|
|
8
8
|
| algopy.Application | Emulated |
|
|
9
9
|
| algopy.Asset | Emulated |
|
|
10
|
+
| algopy.Array | Native |
|
|
10
11
|
| algopy.BigUInt | Native |
|
|
11
12
|
| algopy.Box | Emulated |
|
|
12
13
|
| algopy.BoxMap | Emulated |
|
|
@@ -18,6 +19,7 @@ See which `algorand-python` stubs are implemented by the `algorand-python-testin
|
|
|
18
19
|
| algopy.Contract | Emulated |
|
|
19
20
|
| algopy.Global | Emulated |
|
|
20
21
|
| algopy.GlobalState | Emulated |
|
|
22
|
+
| algopy.ImmutableArray | Native |
|
|
21
23
|
| algopy.LocalState | Emulated |
|
|
22
24
|
| algopy.LogicSig | Emulated |
|
|
23
25
|
| algopy.OnCompleteAction | Native |
|
|
@@ -33,6 +35,7 @@ See which `algorand-python` stubs are implemented by the `algorand-python-testin
|
|
|
33
35
|
| algopy.ensure_budget | Emulated |
|
|
34
36
|
| algopy.log | Emulated |
|
|
35
37
|
| algopy.logicsig | Emulated |
|
|
38
|
+
| algopy.size_of | Emulated |
|
|
36
39
|
| algopy.subroutine | Native |
|
|
37
40
|
| algopy.uenumerate | Native |
|
|
38
41
|
| algopy.urange | Native |
|
{algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/docs/testing-guide/concepts.md
RENAMED
|
@@ -56,3 +56,8 @@ As explained in the [introduction](index.md), `algorand-python-testing` _injects
|
|
|
56
56
|
|
|
57
57
|
For a full list of all public `algopy` types and their corresponding implementation category, refer to the [Coverage](coverage.md) section.
|
|
58
58
|
```
|
|
59
|
+
|
|
60
|
+
## Data Validation
|
|
61
|
+
|
|
62
|
+
Algorand Python and the puya compiler have functionality to perform validation of transaction inputs via the `--validate-abi-args`, `--validate-abi-return` CLI arguments, `arc4.abimethod(validate_encoding=...)` decorator and `.validate()` methods.
|
|
63
|
+
The Algorand Python Testing library does *NOT* implement this validation behaviour, as you should test invalid inputs using an integrated test against a real Algorand network.
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "algorand-python-testing"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.6.0"
|
|
8
8
|
description = 'Algorand Python testing library'
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -18,6 +18,7 @@ classifiers = [
|
|
|
18
18
|
"Topic :: Software Development :: Testing",
|
|
19
19
|
"Programming Language :: Python",
|
|
20
20
|
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
21
22
|
]
|
|
22
23
|
dependencies = [
|
|
23
24
|
# ==========================================================================
|
|
@@ -29,7 +30,7 @@ dependencies = [
|
|
|
29
30
|
"pynacl>=1.4.0,<2",
|
|
30
31
|
"ecdsa>=0.17.0",
|
|
31
32
|
"coincurve>=19.0.1",
|
|
32
|
-
"algorand-python>=2.0"
|
|
33
|
+
"algorand-python>=2.0,<3"
|
|
33
34
|
]
|
|
34
35
|
|
|
35
36
|
[project.urls]
|
|
@@ -43,16 +44,13 @@ allow-direct-references = true
|
|
|
43
44
|
[tool.hatch.build.targets.wheel]
|
|
44
45
|
packages = ["src/algopy", 'src/algopy_testing', 'src/_algopy_testing']
|
|
45
46
|
|
|
46
|
-
[[tool.hatch.envs.all.matrix]]
|
|
47
|
-
python = ["3.12"]
|
|
48
|
-
|
|
49
47
|
# default dev environment
|
|
50
48
|
[tool.hatch.envs.default]
|
|
51
49
|
type = "virtual"
|
|
52
50
|
path = ".venv"
|
|
53
51
|
python = "3.12"
|
|
54
52
|
dependencies = [
|
|
55
|
-
"puyapy>=3.0",
|
|
53
|
+
"puyapy>=3.0,<5",
|
|
56
54
|
"pytest>=7.4",
|
|
57
55
|
"pytest-mock>=3.10.0",
|
|
58
56
|
"pytest-xdist[psutil]>=3.3",
|
|
@@ -121,9 +119,29 @@ path = ".venv.cicd"
|
|
|
121
119
|
dependencies = [
|
|
122
120
|
"python-semantic-release>=9.8.5",
|
|
123
121
|
]
|
|
122
|
+
|
|
124
123
|
[tool.hatch.envs.cicd.scripts]
|
|
125
124
|
clean_dist = "rm -rf dist"
|
|
126
125
|
|
|
126
|
+
# Testing environment with matrix
|
|
127
|
+
[tool.hatch.envs.test]
|
|
128
|
+
dependencies = [
|
|
129
|
+
"pytest>=7.4",
|
|
130
|
+
"pytest-mock>=3.10.0",
|
|
131
|
+
"pytest-xdist[psutil]>=3.3",
|
|
132
|
+
"pytest-cov>=4.1.0",
|
|
133
|
+
"py-algorand-sdk>=2.4.0",
|
|
134
|
+
"algokit-utils>=3.0.0",
|
|
135
|
+
"puyapy>=3.0,<5",
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
[tool.hatch.envs.test.scripts]
|
|
139
|
+
run = "pytest --cov=src --cov-report=xml {args}"
|
|
140
|
+
ci = "pytest --cov=src --cov-report=xml --cov-report=term"
|
|
141
|
+
|
|
142
|
+
[[tool.hatch.envs.test.matrix]]
|
|
143
|
+
python = ["3.12", "3.13"]
|
|
144
|
+
|
|
127
145
|
# docs environment
|
|
128
146
|
[tool.hatch.envs.docs]
|
|
129
147
|
path = ".venv.docs"
|
|
@@ -159,14 +177,13 @@ dev = "hatch run docs:test && sphinx-autobuild docs docs/_build"
|
|
|
159
177
|
[tool.hatch.envs.examples]
|
|
160
178
|
type = "virtual"
|
|
161
179
|
path = ".venv.examples"
|
|
162
|
-
python = "3.12"
|
|
163
180
|
dev-mode = true
|
|
164
181
|
skip-install = false
|
|
165
182
|
post-install-commands = [
|
|
166
183
|
"hatch run examples:reload_algopy_testing",
|
|
167
184
|
]
|
|
168
185
|
dependencies = [
|
|
169
|
-
"algorand-python>=1.2",
|
|
186
|
+
"algorand-python>=1.2,<3",
|
|
170
187
|
"pytest>=7.4",
|
|
171
188
|
"pytest-mock>=3.10.0",
|
|
172
189
|
"pytest-xdist[psutil]>=3.3",
|
|
@@ -188,6 +205,9 @@ check = [
|
|
|
188
205
|
"hatch run mypy examples",
|
|
189
206
|
]
|
|
190
207
|
|
|
208
|
+
[[tool.hatch.envs.examples.matrix]]
|
|
209
|
+
python = ["3.12", "3.13"]
|
|
210
|
+
|
|
191
211
|
# tool configurations
|
|
192
212
|
[tool.black]
|
|
193
213
|
line-length = 99
|
{algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/scripts/refresh_test_artifacts.py
RENAMED
|
@@ -31,6 +31,10 @@ def compile_contract(folder: Path) -> None:
|
|
|
31
31
|
str(contract_path),
|
|
32
32
|
"--out-dir",
|
|
33
33
|
"data",
|
|
34
|
+
# testing library does not perform ABI validation
|
|
35
|
+
# so ensure compiled contracts also do not, so behaviour matches
|
|
36
|
+
"--no-validate-abi-args",
|
|
37
|
+
"--no-validate-abi-return",
|
|
34
38
|
]
|
|
35
39
|
subprocess.run(
|
|
36
40
|
compile_cmd,
|
{algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/scripts/validate_examples.py
RENAMED
|
@@ -70,9 +70,11 @@ def generate_client(folder: Path) -> None:
|
|
|
70
70
|
text=True,
|
|
71
71
|
)
|
|
72
72
|
except subprocess.CalledProcessError as e:
|
|
73
|
-
|
|
73
|
+
output = e.stdout + e.stderr
|
|
74
|
+
if "No app specs" in output:
|
|
74
75
|
logger.warning(f"No app spec found for: {folder}, skipping...")
|
|
75
76
|
else:
|
|
77
|
+
logger.exception(output)
|
|
76
78
|
raise
|
|
77
79
|
|
|
78
80
|
|
|
@@ -172,6 +172,9 @@ class _ABIEncoded(BytesBacked):
|
|
|
172
172
|
|
|
173
173
|
return algopy.Bytes(self._value)
|
|
174
174
|
|
|
175
|
+
def validate(self) -> None:
|
|
176
|
+
pass
|
|
177
|
+
|
|
175
178
|
def __eq__(self, other: object) -> bool:
|
|
176
179
|
if isinstance(other, _ABIEncoded):
|
|
177
180
|
return self._type_info == other._type_info and self.bytes == other.bytes
|
|
@@ -742,7 +745,9 @@ class Address(StaticArray[Byte, typing.Literal[32]]):
|
|
|
742
745
|
|
|
743
746
|
|
|
744
747
|
class _DynamicArrayTypeInfo(_TypeInfo):
|
|
745
|
-
|
|
748
|
+
_subclass_type: Callable[[], type] | None
|
|
749
|
+
|
|
750
|
+
def __init__(self, item_type: _TypeInfo) -> None:
|
|
746
751
|
self.item_type = item_type
|
|
747
752
|
|
|
748
753
|
@property
|
|
@@ -888,9 +893,20 @@ class DynamicArray( # TODO: inherit from StaticArray?
|
|
|
888
893
|
return f"{_arc4_type_repr(type(self))}({', '.join(items)})"
|
|
889
894
|
|
|
890
895
|
|
|
896
|
+
class _DynamicBytesTypeInfo(_DynamicArrayTypeInfo):
|
|
897
|
+
def __init__(self) -> None:
|
|
898
|
+
super().__init__(Byte._type_info)
|
|
899
|
+
|
|
900
|
+
@property
|
|
901
|
+
def typ(self) -> type:
|
|
902
|
+
return DynamicBytes
|
|
903
|
+
|
|
904
|
+
|
|
891
905
|
class DynamicBytes(DynamicArray[Byte]):
|
|
892
906
|
"""A variable sized array of bytes."""
|
|
893
907
|
|
|
908
|
+
_type_info: _DynamicBytesTypeInfo = _DynamicBytesTypeInfo()
|
|
909
|
+
|
|
894
910
|
@typing.overload
|
|
895
911
|
def __init__(self, *values: Byte | UInt8 | int): ...
|
|
896
912
|
|
|
@@ -996,6 +1012,12 @@ class Tuple(
|
|
|
996
1012
|
)
|
|
997
1013
|
self._value = _encode(items)
|
|
998
1014
|
|
|
1015
|
+
def __bool__(self) -> bool:
|
|
1016
|
+
try:
|
|
1017
|
+
return bool(self.native)
|
|
1018
|
+
except ValueError:
|
|
1019
|
+
return False
|
|
1020
|
+
|
|
999
1021
|
def __len__(self) -> int:
|
|
1000
1022
|
return len(self.native)
|
|
1001
1023
|
|
|
@@ -1103,6 +1125,8 @@ class Struct(MutableBytes, _ABIEncoded, metaclass=_StructMeta): # type: ignore[
|
|
|
1103
1125
|
def from_bytes(cls, value: algopy.Bytes | bytes, /) -> typing.Self:
|
|
1104
1126
|
tuple_type = _tuple_type_from_struct(cls)
|
|
1105
1127
|
tuple_value = tuple_type.from_bytes(value)
|
|
1128
|
+
if not tuple_value:
|
|
1129
|
+
return typing.cast(typing.Self, tuple_value)
|
|
1106
1130
|
return cls(*tuple_value.native)
|
|
1107
1131
|
|
|
1108
1132
|
@property
|
|
@@ -1256,10 +1280,20 @@ def _compress_multiple_bool(value_list: list[Bool]) -> int:
|
|
|
1256
1280
|
return result
|
|
1257
1281
|
|
|
1258
1282
|
|
|
1283
|
+
def get_max_bytes_static_len(type_info: _TypeInfo) -> int | None:
|
|
1284
|
+
return _get_max_bytes_len_impl(type_info, static_size_only=True)
|
|
1285
|
+
|
|
1286
|
+
|
|
1259
1287
|
def _get_max_bytes_len(type_info: _TypeInfo) -> int:
|
|
1288
|
+
return _get_max_bytes_len_impl(type_info) or 0
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
def _get_max_bytes_len_impl(type_info: _TypeInfo, *, static_size_only: bool = False) -> int | None:
|
|
1260
1292
|
size = 0
|
|
1261
1293
|
if isinstance(type_info, _DynamicArrayTypeInfo):
|
|
1262
1294
|
size += _ABI_LENGTH_SIZE
|
|
1295
|
+
if static_size_only:
|
|
1296
|
+
return None
|
|
1263
1297
|
elif isinstance(type_info, _TupleTypeInfo | _StructTypeInfo | _StaticArrayTypeInfo):
|
|
1264
1298
|
i = 0
|
|
1265
1299
|
if isinstance(type_info, _TupleTypeInfo | _StructTypeInfo):
|
|
@@ -1276,12 +1310,18 @@ def _get_max_bytes_len(type_info: _TypeInfo) -> int:
|
|
|
1276
1310
|
if bool_num % 8 != 0:
|
|
1277
1311
|
size += 1
|
|
1278
1312
|
else:
|
|
1279
|
-
child_byte_size =
|
|
1313
|
+
child_byte_size = _get_max_bytes_len_impl(
|
|
1314
|
+
child_types[i], static_size_only=static_size_only
|
|
1315
|
+
)
|
|
1316
|
+
if child_byte_size is None:
|
|
1317
|
+
return None
|
|
1280
1318
|
size += child_byte_size
|
|
1281
1319
|
i += 1
|
|
1282
1320
|
elif isinstance(type_info, _UIntTypeInfo):
|
|
1283
1321
|
size = type_info.max_bytes_len
|
|
1284
1322
|
|
|
1323
|
+
elif static_size_only:
|
|
1324
|
+
return None
|
|
1285
1325
|
return size
|
|
1286
1326
|
|
|
1287
1327
|
|
|
@@ -147,6 +147,7 @@ def abimethod( # noqa: PLR0913
|
|
|
147
147
|
allow_actions: Sequence[_AllowActions] = ("NoOp",),
|
|
148
148
|
readonly: bool = False,
|
|
149
149
|
default_args: Mapping[str, str | object] | None = None,
|
|
150
|
+
validate_encoding: typing.Literal["unsafe_disabled", "args"] = "args", # noqa: ARG001
|
|
150
151
|
) -> Callable[[Callable[_P, _R]], Callable[_P, _R]] | Callable[_P, _R]:
|
|
151
152
|
from _algopy_testing.utilities.log import log
|
|
152
153
|
|
|
@@ -128,6 +128,9 @@ class Account(BytesBacked):
|
|
|
128
128
|
def public_key(self) -> str:
|
|
129
129
|
return algosdk.encoding.encode_address(self._public_key) # type: ignore[no-any-return]
|
|
130
130
|
|
|
131
|
+
def validate(self) -> None:
|
|
132
|
+
pass
|
|
133
|
+
|
|
131
134
|
def __getattr__(self, name: str) -> typing.Any:
|
|
132
135
|
try:
|
|
133
136
|
return self.data.fields[name] # type: ignore[literal-required]
|
|
@@ -201,12 +201,12 @@ def _get_state_totals(contract: Contract, cls_state_totals: StateTotals) -> _Sta
|
|
|
201
201
|
|
|
202
202
|
global_bytes = global_uints = local_bytes = local_uints = 0
|
|
203
203
|
for type_ in get_global_states(contract).values():
|
|
204
|
-
if issubclass(type_, UInt64 | UInt64Backed | bool):
|
|
204
|
+
if isinstance(type_, type) and issubclass(type_, UInt64 | UInt64Backed | bool):
|
|
205
205
|
global_uints += 1
|
|
206
206
|
else:
|
|
207
207
|
global_bytes += 1
|
|
208
208
|
for type_ in get_local_states(contract).values():
|
|
209
|
-
if issubclass(type_, UInt64 | UInt64Backed | bool):
|
|
209
|
+
if isinstance(type_, type) and issubclass(type_, UInt64 | UInt64Backed | bool):
|
|
210
210
|
local_uints += 1
|
|
211
211
|
else:
|
|
212
212
|
local_bytes += 1
|
{algorand_python_testing-0.5.0 → algorand_python_testing-0.6.0}/src/_algopy_testing/op/pure.py
RENAMED
|
@@ -31,7 +31,7 @@ def bsqrt(a: BigUInt | int, /) -> BigUInt:
|
|
|
31
31
|
def btoi(a: Bytes | bytes, /) -> UInt64:
|
|
32
32
|
a_bytes = as_bytes(a)
|
|
33
33
|
if len(a_bytes) > 8:
|
|
34
|
-
raise ValueError(f"btoi arg too long, got
|
|
34
|
+
raise ValueError(f"btoi arg too long, got {len(a_bytes)} bytes")
|
|
35
35
|
return UInt64(int.from_bytes(a_bytes))
|
|
36
36
|
|
|
37
37
|
|
|
@@ -102,6 +102,9 @@ class ImmutableArray(Serializable, typing.Generic[_T], metaclass=_ImmutableArray
|
|
|
102
102
|
def from_bytes(cls, value: bytes, /) -> typing.Self:
|
|
103
103
|
return deserialize_from_bytes(cls, value)
|
|
104
104
|
|
|
105
|
+
def validate(self) -> None:
|
|
106
|
+
pass
|
|
107
|
+
|
|
105
108
|
|
|
106
109
|
class Array(Reversible[_T]):
|
|
107
110
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import dataclasses
|
|
2
|
+
import functools
|
|
3
|
+
import inspect
|
|
4
|
+
import typing
|
|
5
|
+
from collections.abc import Callable, Sequence
|
|
6
|
+
|
|
7
|
+
from _algopy_testing.primitives.uint64 import UInt64
|
|
8
|
+
|
|
9
|
+
if typing.TYPE_CHECKING:
|
|
10
|
+
from _algopy_testing.arc4 import _ABIEncoded
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
_T = typing.TypeVar("_T")
|
|
14
|
+
_U = typing.TypeVar("_U")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclasses.dataclass(frozen=True)
|
|
18
|
+
class _Serializer(typing.Generic[_T, _U]):
|
|
19
|
+
arc4_type: type[_U]
|
|
20
|
+
native_to_arc4: Callable[[_T], _U]
|
|
21
|
+
arc4_to_native: Callable[[_U], _T]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def identity(i: _T) -> _T:
|
|
25
|
+
return i
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_native_to_arc4_serializer(typ: type) -> _Serializer[typing.Any, typing.Any]:
|
|
29
|
+
from _algopy_testing import arc4
|
|
30
|
+
from _algopy_testing.primitives import ImmutableArray
|
|
31
|
+
from _algopy_testing.protocols import UInt64Backed
|
|
32
|
+
|
|
33
|
+
origin_type = typing.get_origin(typ)
|
|
34
|
+
if origin_type is tuple:
|
|
35
|
+
return _get_tuple_serializer(typing.get_args(typ))
|
|
36
|
+
elif isinstance(typ, type):
|
|
37
|
+
if issubclass(typ, arc4._ABIEncoded):
|
|
38
|
+
return _Serializer(arc4_type=typ, native_to_arc4=identity, arc4_to_native=identity)
|
|
39
|
+
for native_type, simple_arc4_type in _simple_native_to_arc4_type_map().items():
|
|
40
|
+
if issubclass(typ, native_type):
|
|
41
|
+
return _Serializer(
|
|
42
|
+
arc4_type=simple_arc4_type,
|
|
43
|
+
native_to_arc4=simple_arc4_type,
|
|
44
|
+
arc4_to_native=lambda n: n.native,
|
|
45
|
+
)
|
|
46
|
+
if issubclass(typ, UInt64Backed):
|
|
47
|
+
return _Serializer(
|
|
48
|
+
arc4_type=arc4.UInt64,
|
|
49
|
+
native_to_arc4=lambda n: arc4.UInt64(n.int_),
|
|
50
|
+
arc4_to_native=lambda a: typ.from_int(a.native),
|
|
51
|
+
)
|
|
52
|
+
if typing.NamedTuple in getattr(typ, "__orig_bases__", []):
|
|
53
|
+
tuple_fields = tuple(inspect.get_annotations(typ).values())
|
|
54
|
+
if any(isinstance(f, str) for f in tuple_fields):
|
|
55
|
+
raise TypeError("string annotations in typing.NamedTuple fields are not supported")
|
|
56
|
+
return _get_tuple_serializer(tuple_fields)
|
|
57
|
+
if issubclass(typ, ImmutableArray):
|
|
58
|
+
native_element_type = typ._element_type
|
|
59
|
+
element_serializer = get_native_to_arc4_serializer(native_element_type)
|
|
60
|
+
arc4_element_type = element_serializer.arc4_type
|
|
61
|
+
arc4_type = arc4.DynamicArray[arc4_element_type] # type: ignore[valid-type]
|
|
62
|
+
return _Serializer(
|
|
63
|
+
arc4_type=arc4_type,
|
|
64
|
+
native_to_arc4=lambda arr: arc4_type(
|
|
65
|
+
*(element_serializer.native_to_arc4(e) for e in arr)
|
|
66
|
+
),
|
|
67
|
+
arc4_to_native=lambda arr: typ(
|
|
68
|
+
*(element_serializer.arc4_to_native(e) for e in arr)
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
raise TypeError(f"unserializable type: {typ}")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@functools.cache
|
|
75
|
+
def _simple_native_to_arc4_type_map() -> dict[type, type]:
|
|
76
|
+
from _algopy_testing import arc4
|
|
77
|
+
from _algopy_testing.models import Account
|
|
78
|
+
from _algopy_testing.primitives import BigUInt, Bytes, String
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
bool: arc4.Bool,
|
|
82
|
+
UInt64: arc4.UInt64,
|
|
83
|
+
BigUInt: arc4.UInt512,
|
|
84
|
+
Account: arc4.Address,
|
|
85
|
+
Bytes: arc4.DynamicBytes,
|
|
86
|
+
String: arc4.String,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _get_tuple_serializer(item_types: tuple[type, ...]) -> _Serializer[typing.Any, typing.Any]:
|
|
91
|
+
from _algopy_testing import arc4
|
|
92
|
+
|
|
93
|
+
serializers = [get_native_to_arc4_serializer(i) for i in item_types]
|
|
94
|
+
|
|
95
|
+
def _items_to_arc4(items: Sequence[object]) -> tuple[object, ...]:
|
|
96
|
+
result = []
|
|
97
|
+
for item, serializer in zip(items, serializers, strict=True):
|
|
98
|
+
result.append(serializer.native_to_arc4(item))
|
|
99
|
+
return tuple(result)
|
|
100
|
+
|
|
101
|
+
def _items_to_native(items: Sequence[object]) -> tuple[object, ...]:
|
|
102
|
+
result = []
|
|
103
|
+
for item, serializer in zip(items, serializers, strict=True):
|
|
104
|
+
result.append(serializer.arc4_to_native(item))
|
|
105
|
+
return tuple(result)
|
|
106
|
+
|
|
107
|
+
return _Serializer(
|
|
108
|
+
arc4_type=arc4.Tuple[*(s.arc4_type for s in serializers)], # type: ignore[misc]
|
|
109
|
+
native_to_arc4=lambda t: arc4.Tuple(_items_to_arc4(t)),
|
|
110
|
+
arc4_to_native=lambda t: _items_to_native(t),
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def serialize_to_bytes(value: object) -> bytes:
|
|
115
|
+
return native_to_arc4(value).bytes.value
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def type_of(value: object) -> type:
|
|
119
|
+
"""Returns the type of value, this will also ensure the type is fully parametrized
|
|
120
|
+
if it is a generic type."""
|
|
121
|
+
# get fully parametrized tuples
|
|
122
|
+
if isinstance(value, tuple) and type(value) is tuple:
|
|
123
|
+
return tuple[*(type_of(i) for i in value)] # type: ignore[misc, no-any-return]
|
|
124
|
+
else:
|
|
125
|
+
return type(value)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def native_to_arc4(value: object) -> "_ABIEncoded":
|
|
129
|
+
from _algopy_testing import arc4
|
|
130
|
+
|
|
131
|
+
src_type = type_of(value)
|
|
132
|
+
|
|
133
|
+
serializer = get_native_to_arc4_serializer(src_type)
|
|
134
|
+
arc4_value = serializer.native_to_arc4(value)
|
|
135
|
+
assert isinstance(arc4_value, arc4._ABIEncoded)
|
|
136
|
+
return arc4_value
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def compare_type(value_type: type, typ: type) -> bool:
|
|
140
|
+
if typing.NamedTuple in getattr(typ, "__orig_bases__", []):
|
|
141
|
+
tuple_fields: Sequence[type] = list(inspect.get_annotations(typ).values())
|
|
142
|
+
typ = tuple[*tuple_fields] # type: ignore[valid-type]
|
|
143
|
+
return value_type == typ
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def deserialize_from_bytes(typ: type[_T], bites: bytes) -> _T:
|
|
147
|
+
serializer = get_native_to_arc4_serializer(typ)
|
|
148
|
+
arc4_value = serializer.arc4_type.from_bytes(bites)
|
|
149
|
+
native_value = serializer.arc4_to_native(arc4_value)
|
|
150
|
+
assert compare_type(type_of(native_value), typ) or isinstance(native_value, typ)
|
|
151
|
+
return native_value # type: ignore[no-any-return]
|