pylint and added type info
This commit is contained in:
parent
e2537e43b5
commit
f8c1790558
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue