From adf4e391cf5915d77c8c9a02ea8ea142a889fc11 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Wed, 20 Dec 2023 11:33:28 -0600 Subject: [PATCH] feat: complete upgrade --- tests/test_account.py | 17 +++++++++++++++++ tests/test_multisend.py | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/test_account.py b/tests/test_account.py index f53f1d4..21c27c3 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -1,5 +1,7 @@ import pytest +from ape.api import AccountAPI from ape.exceptions import SignatureError +from ape.types import AddressType from eth_utils import add_0x_prefix @@ -158,3 +160,18 @@ def exec_transaction(): assert receipt.events == expected_events assert old_owner not in safe.signers + + +def test_account_type(safe): + actual = type(safe) + assert issubclass(actual, AccountAPI) + + +def test_safe_account_convert(safe): + """ + We had a bug where converting safe accounts to AddressType + would fail. + """ + convert = safe.conversion_manager.convert + actual = convert(safe, AddressType) + assert actual == safe.address diff --git a/tests/test_multisend.py b/tests/test_multisend.py index deefd2e..9d4712b 100644 --- a/tests/test_multisend.py +++ b/tests/test_multisend.py @@ -9,7 +9,7 @@ def test_asset(vault, token): def test_default_operation(safe, token, vault, multisend): amount = token.balanceOf(safe) - multisend.add(token.approve, vault, safe) + multisend.add(token.approve, vault, 123) multisend.add(vault.transfer, safe, amount) receipt = multisend(sender=safe) assert receipt.txn_hash @@ -17,7 +17,7 @@ def test_default_operation(safe, token, vault, multisend): def test_no_operation(safe, token, vault, multisend): amount = token.balanceOf(safe) - multisend.add(token.approve, vault, safe) + multisend.add(token.approve, vault, 123) multisend.add(vault.transfer, safe, amount) with pytest.raises(SafeLogicError, match="Safe transaction failed"): multisend(sender=safe, operation=0)