pylint and added type info

This commit is contained in:
Lex Berezhny 2018-08-07 21:36:44 -04:00
parent e2537e43b5
commit f8c1790558

View file

@ -8,6 +8,7 @@ from torba.hash import double_sha256, aes_encrypt, aes_decrypt
if typing.TYPE_CHECKING: if typing.TYPE_CHECKING:
from torba import baseledger from torba import baseledger
from torba import wallet
class AddressManager: class AddressManager:
@ -195,9 +196,9 @@ class BaseAccount:
HierarchicalDeterministic.name: HierarchicalDeterministic, HierarchicalDeterministic.name: HierarchicalDeterministic,
} }
def __init__(self, ledger: 'baseledger.BaseLedger', wallet, name: str, seed: str, encrypted: bool, def __init__(self, ledger: 'baseledger.BaseLedger', wallet: 'wallet.Wallet', name: str,
private_key: PrivateKey, public_key: PubKey, address_generator: dict seed: str, encrypted: bool, private_key: PrivateKey, public_key: PubKey,
) -> None: address_generator: dict) -> None:
self.ledger = ledger self.ledger = ledger
self.wallet = wallet self.wallet = wallet
self.name = name self.name = name
@ -213,7 +214,8 @@ class BaseAccount:
wallet.add_account(self) wallet.add_account(self)
@classmethod @classmethod
def generate(cls, ledger: 'baseledger.BaseLedger', wallet, name: str = None, address_generator: dict = None): def generate(cls, ledger: 'baseledger.BaseLedger', wallet: 'wallet.Wallet',
name: str = None, address_generator: dict = None):
return cls.from_dict(ledger, wallet, { return cls.from_dict(ledger, wallet, {
'name': name, 'name': name,
'seed': cls.mnemonic_class().make_seed(), 'seed': cls.mnemonic_class().make_seed(),
@ -227,7 +229,7 @@ class BaseAccount:
) )
@classmethod @classmethod
def from_dict(cls, ledger: 'baseledger.BaseLedger', wallet, d: dict): def from_dict(cls, ledger: 'baseledger.BaseLedger', wallet: 'wallet.Wallet', d: dict):
seed = d.get('seed', '') seed = d.get('seed', '')
private_key = d.get('private_key', '') private_key = d.get('private_key', '')
public_key = None public_key = None