Skip to content

Commit c217d6e

Browse files
committed
Comments by @altendky
1 parent 4bff65e commit c217d6e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

chia/wallet/util/tx_config.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from chia_rs import ConsensusConstants
77
from chia_rs.sized_bytes import bytes32
88
from chia_rs.sized_ints import uint64
9-
from typing_extensions import NotRequired, Self, TypedDict, TypeVar, Unpack
9+
from typing_extensions import NotRequired, Self, TypedDict, Unpack
1010

1111
from chia.consensus.default_constants import DEFAULT_CONSTANTS
1212
from chia.types.blockchain_format.coin import Coin
@@ -88,7 +88,7 @@ def autofill(
8888

8989
@classmethod
9090
def from_json_dict(cls, json_dict: dict[str, Any]) -> Self:
91-
if "excluded_coins" in json_dict and json_dict["excluded_coins"] is not None:
91+
if json_dict.get("excluded_coins") is not None:
9292
excluded_coins: list[Coin] = [Coin.from_json_dict(c) for c in json_dict["excluded_coins"]]
9393
excluded_coin_ids: list[str] = [c.name().hex() for c in excluded_coins]
9494
if "excluded_coin_ids" in json_dict:
@@ -99,13 +99,10 @@ def from_json_dict(cls, json_dict: dict[str, Any]) -> Self:
9999

100100
# This function is purely for ergonomics
101101
# But creates a small linting complication
102-
def override(self: _T_CoinSelectionConfigLoader, **kwargs: Any) -> _T_CoinSelectionConfigLoader: # noqa: PYI019
102+
def override(self, **kwargs: Any) -> Self:
103103
return dataclasses.replace(self, **kwargs)
104104

105105

106-
_T_CoinSelectionConfigLoader = TypeVar("_T_CoinSelectionConfigLoader", bound=CoinSelectionConfigLoader)
107-
108-
109106
@streamable
110107
@dataclasses.dataclass(frozen=True)
111108
class TXConfigLoader(CoinSelectionConfigLoader):

0 commit comments

Comments
 (0)