Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ape_test/accounts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import warnings
from collections.abc import Iterator
from functools import cached_property
from typing import TYPE_CHECKING, Any, Optional, Union, cast

from eip712.messages import EIP712Message
Expand Down Expand Up @@ -115,7 +116,7 @@ class TestAccount(TestAccountAPI):
def alias(self) -> str:
return f"TEST::{self.index}"

@property
@cached_property
def address(self) -> AddressType:
return self.network_manager.ethereum.decode_address(self.address_str)

Expand All @@ -125,7 +126,7 @@ def public_key(self) -> "HexBytes":

@log_instead_of_fail(default="<TestAccount>")
def __repr__(self) -> str:
return f"<{self.__class__.__name__}_{self.index} {self.address_str}>"
return f"<{self.__class__.__name__}_{self.index} {self.address}>"

def sign_authorization(
self,
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,10 @@ def test_test_accounts_repr(accounts, config):
actual = repr(accounts)
assert config.get_config("test").hd_path in actual

# Show actual test-account repr (address should be checksummed).
actual = repr(accounts[0])
assert accounts[0].address in actual


def test_account_comparison_to_non_account(core_account):
# Before, would get a ConversionError.
Expand Down
Loading