1
0

more type annotations in core lib

This commit is contained in:
SomberNight
2018-10-22 16:41:25 +02:00
parent 6958c0ccc3
commit 81cc20039e
14 changed files with 90 additions and 49 deletions

View File

@@ -27,7 +27,7 @@ import os
import json
from collections import defaultdict
import asyncio
from typing import Dict, List, Tuple
from typing import Dict, List, Tuple, TYPE_CHECKING
import traceback
import sys
@@ -40,6 +40,11 @@ from .util import PrintError
from . import bitcoin
from .synchronizer import SynchronizerBase
if TYPE_CHECKING:
from .network import Network
from .simple_config import SimpleConfig
request_queue = asyncio.Queue()
@@ -61,7 +66,7 @@ class ElectrumWebSocket(WebSocket, PrintError):
class BalanceMonitor(SynchronizerBase):
def __init__(self, config, network):
def __init__(self, config: 'SimpleConfig', network: 'Network'):
SynchronizerBase.__init__(self, network)
self.config = config
self.expected_payments = defaultdict(list) # type: Dict[str, List[Tuple[WebSocket, int]]]
@@ -104,7 +109,7 @@ class BalanceMonitor(SynchronizerBase):
class WebSocketServer(threading.Thread):
def __init__(self, config, network):
def __init__(self, config: 'SimpleConfig', network: 'Network'):
threading.Thread.__init__(self)
self.config = config
self.network = network