Skip to content

Commit b062196

Browse files
committed
refactor: modify new update_asset_holding method so asset is the first parameter
1 parent 8167cc3 commit b062196

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/_algopy_testing/context_helpers/ledger_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def update_account(
9393

9494
def update_asset_holdings(
9595
self,
96-
account: algopy.Account | str,
9796
asset: algopy.Asset | algopy.UInt64 | int,
97+
account: algopy.Account | str,
9898
*,
9999
balance: algopy.UInt64 | int | None = None,
100100
frozen: bool | None = None,

src/_algopy_testing/value_generators/avm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def account(
9898
account_data.fields.update(account_fields)
9999
for asset_id, balance in (opted_asset_balances or {}).items():
100100
ledger.update_asset_holdings(
101-
new_account_address,
102101
asset_id,
102+
new_account_address,
103103
balance=balance,
104104
)
105105
account_data.opted_apps = {_get_app_id(app): ledger.get_app(app) for app in opted_apps}

tests/models/test_asset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_asset_from_int() -> None:
3737
def test_asset_balance(context: AlgopyTestContext) -> None:
3838
account = context.any.account()
3939
asset = context.any.asset()
40-
context.ledger.update_asset_holdings(account, asset, balance=1000)
40+
context.ledger.update_asset_holdings(asset, account, balance=1000)
4141

4242
assert asset.balance(account) == UInt64(1000)
4343

0 commit comments

Comments
 (0)