Skip to content

Commit

Permalink
feat: update algopy.op.Global with fields added in AVM 11
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Feb 19, 2025
1 parent 75d6847 commit 0cc9807
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/_algopy_testing/op/global_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class GlobalFields(TypedDict, total=False):
asset_opt_in_min_balance: algopy.UInt64
genesis_hash: algopy.Bytes
opcode_budget: Callable[[], int]
payouts_enabled: bool
payouts_go_online_fee: algopy.UInt64
payouts_max_balance: algopy.UInt64
payouts_min_balance: algopy.UInt64
payouts_percent: algopy.UInt64


class _Global:
Expand Down
5 changes: 5 additions & 0 deletions src/_algopy_testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ def get_default_global_fields() -> GlobalFields:
"asset_create_min_balance": algopy.UInt64(DEFAULT_ASSET_CREATE_MIN_BALANCE),
"asset_opt_in_min_balance": algopy.UInt64(DEFAULT_ASSET_OPT_IN_MIN_BALANCE),
"genesis_hash": algopy.Bytes(DEFAULT_GLOBAL_GENESIS_HASH),
"payouts_enabled": False,
"payouts_go_online_fee": algopy.UInt64(),
"payouts_max_balance": algopy.UInt64(),
"payouts_min_balance": algopy.UInt64(),
"payouts_percent": algopy.UInt64(),
}


Expand Down
1 change: 1 addition & 0 deletions tests/test_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ def test_globals(context: AlgopyTestContext) -> None:
assert algopy.Global.creator_address == creator
assert algopy.Global.current_application_id == app
assert algopy.Global.current_application_address == app.address
assert not algopy.Global.payouts_enabled

txn2 = context.any.txn.payment()
txn3 = context.any.txn.application_call()
Expand Down

0 comments on commit 0cc9807

Please sign in to comment.