diff --git a/chia/wallet/cat_wallet/cat_wallet.py b/chia/wallet/cat_wallet/cat_wallet.py index edefd80e5482..d35447785373 100644 --- a/chia/wallet/cat_wallet/cat_wallet.py +++ b/chia/wallet/cat_wallet/cat_wallet.py @@ -256,8 +256,11 @@ async def create_from_puzzle_info( puzzle_driver: PuzzleInfo, name: Optional[str] = None, # We're hinting this as Any for mypy by should explore adding this to the wallet protocol and hinting properly - potential_subclasses: dict[AssetType, Any] = {}, + potential_subclasses: Optional[dict[AssetType, Any]] = None, ) -> Any: + if potential_subclasses is None: + potential_subclasses = {} + next_layer: Optional[PuzzleInfo] = puzzle_driver.also() if next_layer is not None: if AssetType(next_layer.type()) in potential_subclasses: diff --git a/chia/wallet/cat_wallet/r_cat_wallet.py b/chia/wallet/cat_wallet/r_cat_wallet.py index 19eed3fb86f0..2300e511978c 100644 --- a/chia/wallet/cat_wallet/r_cat_wallet.py +++ b/chia/wallet/cat_wallet/r_cat_wallet.py @@ -139,8 +139,11 @@ async def create_from_puzzle_info( puzzle_driver: PuzzleInfo, name: Optional[str] = None, # We're hinting this as Any for mypy by should explore adding this to the wallet protocol and hinting properly - potential_subclasses: dict[AssetType, Any] = {}, + potential_subclasses: Optional[dict[AssetType, Any]] = None, ) -> Any: + if potential_subclasses is None: + potential_subclasses = {} + rev_layer: Optional[PuzzleInfo] = puzzle_driver.also() if rev_layer is None: raise ValueError("create_from_puzzle_info called on RCATWallet with a non R-CAT puzzle driver") diff --git a/chia/wallet/vc_wallet/cr_cat_wallet.py b/chia/wallet/vc_wallet/cr_cat_wallet.py index 600deba6f384..0862d3af55d6 100644 --- a/chia/wallet/vc_wallet/cr_cat_wallet.py +++ b/chia/wallet/vc_wallet/cr_cat_wallet.py @@ -136,8 +136,11 @@ async def create_from_puzzle_info( puzzle_driver: PuzzleInfo, name: Optional[str] = None, # We're hinting this as Any for mypy by should explore adding this to the wallet protocol and hinting properly - potential_subclasses: dict[AssetType, Any] = {}, + potential_subclasses: Optional[dict[AssetType, Any]] = None, ) -> Any: + if potential_subclasses is None: + potential_subclasses = {} + cr_layer: Optional[PuzzleInfo] = puzzle_driver.also() if cr_layer is None: # pragma: no cover raise ValueError("create_from_puzzle_info called on CRCATWallet with a non CR-CAT puzzle driver")