From 5e08d6e486ae34a30a9e3ed72fdf24b95a39291d Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 29 Apr 2024 16:49:12 +0000 Subject: [PATCH] constants: add some more type hints --- electrum/constants.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/electrum/constants.py b/electrum/constants.py index 3facd4d66..9e379755d 100644 --- a/electrum/constants.py +++ b/electrum/constants.py @@ -25,6 +25,7 @@ import os import json +from typing import Sequence, Tuple, Mapping, Type from .util import inv_dict, all_subclasses from . import bitcoin @@ -58,6 +59,14 @@ class AbstractNet: BLOCK_HEIGHT_FIRST_LIGHTNING_CHANNELS: int = 0 BIP44_COIN_TYPE: int LN_REALM_BYTE: int + DEFAULT_PORTS: Mapping[str, str] + DEFAULT_SERVERS: Mapping[str, Mapping[str, str]] + CHECKPOINTS: Sequence[Tuple[str, int]] + LN_DNS_SEEDS: Sequence[str] + XPRV_HEADERS: Mapping[str, int] + XPRV_HEADERS_INV: Mapping[int, str] + XPUB_HEADERS: Mapping[str, int] + XPUB_HEADERS_INV: Mapping[int, str] @classmethod def max_checkpoint(cls) -> int: @@ -184,7 +193,7 @@ class BitcoinSignet(BitcoinTestnet): NETS_LIST = tuple(all_subclasses(AbstractNet)) # don't import net directly, import the module instead (so that net is singleton) -net = BitcoinMainnet +net = BitcoinMainnet # type: Type[AbstractNet] def set_signet(): global net