Browse Source

(trivial) contacts: add some type hints

master
SomberNight 2 years ago
parent
commit
ccbac96f9a
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 10
      electrum/contacts.py

10
electrum/contacts.py

@ -21,7 +21,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import re
from typing import Optional, Tuple, Dict, Any
from typing import Optional, Tuple, Dict, Any, TYPE_CHECKING
import dns
import threading
@ -33,6 +33,10 @@ from .util import read_json_file, write_json_file, to_string
from .logging import Logger, get_logger
from .util import trigger_callback
if TYPE_CHECKING:
from .wallet_db import WalletDB
from .simple_config import SimpleConfig
_logger = get_logger(__name__)
@ -43,7 +47,7 @@ class AliasNotFoundException(Exception):
class Contacts(dict, Logger):
def __init__(self, db):
def __init__(self, db: 'WalletDB'):
Logger.__init__(self)
self.db = db
d = self.db.get('contacts', {})
@ -121,7 +125,7 @@ class Contacts(dict, Logger):
}
return None
def fetch_openalias(self, config):
def fetch_openalias(self, config: 'SimpleConfig'):
self.alias_info = None
alias = config.OPENALIAS_ID
if alias:

Loading…
Cancel
Save