From 6286af667d062820f355994faba2ad39ad9c8d4f Mon Sep 17 00:00:00 2001 From: John Peterson Date: Sun, 29 Sep 2024 18:37:41 -0400 Subject: [PATCH] [chore] Fix Get Default Address on Newly Hydrated Wallet --- CHANGELOG.md | 4 ++++ cdp/wallet.py | 2 +- tests/test_wallet.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b4d99d..c588a39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixed + +- Fixed bug in `Wallet` `default_address` property for newly hydrated wallets. + ## [0.0.3] - 2024-09-25 ### Added diff --git a/cdp/wallet.py b/cdp/wallet.py index 41c2414..c57b54e 100644 --- a/cdp/wallet.py +++ b/cdp/wallet.py @@ -569,7 +569,7 @@ def _address(self, address_id: str) -> WalletAddress | None: """ return next( - (address for address in self._addresses if address.address_id == address_id), + (address for address in self.addresses if address.address_id == address_id), None, ) diff --git a/tests/test_wallet.py b/tests/test_wallet.py index afac1f3..b7ce1b8 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -47,7 +47,7 @@ def _create_wallet_model( network_id="base-sepolia", default_address=None, feature_set=None, - server_signer_status="active_seed", + server_signer_status="active_seed" ): if default_address is None: default_address = address_model_factory()