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
13 changes: 6 additions & 7 deletions chia/data_layer/data_layer_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import time
from operator import attrgetter
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Set, Tuple, cast

from blspy import G1Element, G2Element
from clvm.EvalError import EvalError
Expand Down Expand Up @@ -104,6 +104,11 @@ def from_json_dict(cls, json_dict: Dict[str, Any]) -> "Mirror":

@final
class DataLayerWallet:
if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_protocol_check: ClassVar[WalletProtocol] = cast("DataLayerWallet", None)

wallet_state_manager: WalletStateManager
log: logging.Logger
wallet_info: WalletInfo
Expand Down Expand Up @@ -1391,9 +1396,3 @@ def verify_offer(

if taker_from_offer != taker_from_reference:
raise OfferIntegrityError("taker: reference and offer inclusions do not match")


if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_dummy: WalletProtocol = DataLayerWallet()
13 changes: 6 additions & 7 deletions chia/pools/pool_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dataclasses
import logging
import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple, cast
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Set, Tuple, cast

from blspy import G1Element, G2Element, PrivateKey
from typing_extensions import final
Expand Down Expand Up @@ -59,6 +59,11 @@
@final
@dataclasses.dataclass
class PoolWallet:
if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_protocol_check: ClassVar[WalletProtocol] = cast("PoolWallet", None)

MINIMUM_INITIAL_BALANCE = 1
MINIMUM_RELATIVE_LOCK_HEIGHT = 5
MAXIMUM_RELATIVE_LOCK_HEIGHT = 1000
Expand Down Expand Up @@ -988,9 +993,3 @@ def puzzle_hash_for_pk(self, pubkey: G1Element) -> bytes32:

def get_name(self) -> str:
return self.wallet_info.name


if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_dummy: WalletProtocol = cast(PoolWallet, None)
13 changes: 6 additions & 7 deletions chia/wallet/cat_wallet/cat_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
import traceback
from secrets import token_bytes
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Set, Tuple, cast

from blspy import AugSchemeMPL, G1Element, G2Element

Expand Down Expand Up @@ -68,6 +68,11 @@


class CATWallet:
if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_protocol_check: ClassVar[WalletProtocol] = cast("CATWallet", None)

wallet_state_manager: WalletStateManager
log: logging.Logger
wallet_info: WalletInfo
Expand Down Expand Up @@ -927,9 +932,3 @@ async def get_coins_to_offer(
if balance < amount:
raise Exception(f"insufficient funds in wallet {self.id()}")
return await self.select_coins(amount, min_coin_amount=min_coin_amount, max_coin_amount=max_coin_amount)


if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_dummy: WalletProtocol = CATWallet()
13 changes: 6 additions & 7 deletions chia/wallet/did_wallet/did_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import re
import time
from secrets import token_bytes
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Set, Tuple, cast

from blspy import AugSchemeMPL, G1Element, G2Element

Expand Down Expand Up @@ -52,6 +52,11 @@


class DIDWallet:
if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_protocol_check: ClassVar[WalletProtocol] = cast("DIDWallet", None)

wallet_state_manager: Any
log: logging.Logger
wallet_info: WalletInfo
Expand Down Expand Up @@ -1482,9 +1487,3 @@ def deserialize_backup_data(backup_data: str) -> DIDInfo:

def require_derivation_paths(self) -> bool:
return True


if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_dummy: WalletProtocol = DIDWallet()
13 changes: 6 additions & 7 deletions chia/wallet/nft_wallet/nft_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import math
import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple, Type, TypeVar
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Set, Tuple, Type, TypeVar, cast

from blspy import AugSchemeMPL, G1Element, G2Element
from clvm.casts import int_from_bytes, int_to_bytes
Expand Down Expand Up @@ -61,6 +61,11 @@


class NFTWallet:
if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_protocol_check: ClassVar[WalletProtocol] = cast("NFTWallet", None)

wallet_state_manager: Any
log: logging.Logger
wallet_info: WalletInfo
Expand Down Expand Up @@ -1763,9 +1768,3 @@ def puzzle_hash_for_pk(self, pubkey: G1Element) -> bytes32:

def get_name(self) -> str:
return self.wallet_info.name


if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_dummy: WalletProtocol = NFTWallet()
13 changes: 6 additions & 7 deletions chia/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Set, Tuple, cast

from blspy import AugSchemeMPL, G1Element, G2Element

Expand Down Expand Up @@ -55,6 +55,11 @@


class Wallet:
if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_protocol_check: ClassVar[WalletProtocol] = cast("Wallet", None)

wallet_info: WalletInfo
wallet_state_manager: Any
log: logging.Logger
Expand Down Expand Up @@ -626,9 +631,3 @@ async def coin_added(

def get_name(self) -> str:
return "Standard Wallet"


if TYPE_CHECKING:
from chia.wallet.wallet_protocol import WalletProtocol

_dummy: WalletProtocol = Wallet()