constants: add some more type hints
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
from typing import Sequence, Tuple, Mapping, Type
|
||||||
|
|
||||||
from .util import inv_dict, all_subclasses
|
from .util import inv_dict, all_subclasses
|
||||||
from . import bitcoin
|
from . import bitcoin
|
||||||
@@ -58,6 +59,14 @@ class AbstractNet:
|
|||||||
BLOCK_HEIGHT_FIRST_LIGHTNING_CHANNELS: int = 0
|
BLOCK_HEIGHT_FIRST_LIGHTNING_CHANNELS: int = 0
|
||||||
BIP44_COIN_TYPE: int
|
BIP44_COIN_TYPE: int
|
||||||
LN_REALM_BYTE: 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
|
@classmethod
|
||||||
def max_checkpoint(cls) -> int:
|
def max_checkpoint(cls) -> int:
|
||||||
@@ -184,7 +193,7 @@ class BitcoinSignet(BitcoinTestnet):
|
|||||||
NETS_LIST = tuple(all_subclasses(AbstractNet))
|
NETS_LIST = tuple(all_subclasses(AbstractNet))
|
||||||
|
|
||||||
# don't import net directly, import the module instead (so that net is singleton)
|
# don't import net directly, import the module instead (so that net is singleton)
|
||||||
net = BitcoinMainnet
|
net = BitcoinMainnet # type: Type[AbstractNet]
|
||||||
|
|
||||||
def set_signet():
|
def set_signet():
|
||||||
global net
|
global net
|
||||||
|
|||||||
Reference in New Issue
Block a user