Skip to content

Commit

Permalink
feat: complete upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 20, 2023
1 parent 7fbff68 commit adf4e39
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions tests/test_account.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/test_multisend.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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


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)

0 comments on commit adf4e39

Please sign in to comment.