Skip to content

Commit a30d85a

Browse files
committed
fix: use correct type for Globals.caller_application_id
1 parent 51a25fd commit a30d85a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/_algopy_testing/op/global_values.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class GlobalFields(TypedDict, total=False):
2727
latest_timestamp: algopy.UInt64
2828
group_id: algopy.Bytes # TODO: mock/infer from active txn group?
2929
caller_application_id: algopy.Application
30+
caller_application_id: algopy.UInt64
3031
asset_create_min_balance: algopy.UInt64
3132
asset_opt_in_min_balance: algopy.UInt64
3233
genesis_hash: algopy.Bytes
@@ -48,12 +49,12 @@ def current_application_id(self) -> algopy.Application:
4849
return lazy_context.active_app
4950

5051
@property
51-
def caller_application_id(self) -> algopy.Application:
52+
def caller_application_id(self) -> algopy.UInt64:
5253
return self._fields["caller_application_id"]
5354

5455
@property
5556
def caller_application_address(self) -> algopy.Account:
56-
app_address = algosdk.logic.get_application_address(int(self.caller_application_id.id))
57+
app_address = algosdk.logic.get_application_address(int(self.caller_application_id))
5758
return Account(app_address)
5859

5960
@property

src/_algopy_testing/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def get_default_global_fields() -> GlobalFields:
167167
"min_balance": algopy.UInt64(DEFAULT_ACCOUNT_MIN_BALANCE),
168168
"max_txn_life": algopy.UInt64(DEFAULT_MAX_TXN_LIFE),
169169
"zero_address": algopy.Account(algosdk.constants.ZERO_ADDRESS),
170+
"caller_application_id": algopy.UInt64(),
170171
"asset_create_min_balance": algopy.UInt64(DEFAULT_ASSET_CREATE_MIN_BALANCE),
171172
"asset_opt_in_min_balance": algopy.UInt64(DEFAULT_ASSET_OPT_IN_MIN_BALANCE),
172173
"genesis_hash": algopy.Bytes(DEFAULT_GLOBAL_GENESIS_HASH),

0 commit comments

Comments
 (0)