forked from LBRYCommunity/lbry-sdk
encrypt/decrypt/lock/unlock commands return True
This commit is contained in:
parent
45eef03576
commit
b8b24da292
1 changed files with 4 additions and 0 deletions
|
@ -181,12 +181,14 @@ class Wallet:
|
||||||
for account in self.accounts:
|
for account in self.accounts:
|
||||||
if account.encrypted:
|
if account.encrypted:
|
||||||
account.decrypt(password)
|
account.decrypt(password)
|
||||||
|
return True
|
||||||
|
|
||||||
def lock(self):
|
def lock(self):
|
||||||
for account in self.accounts:
|
for account in self.accounts:
|
||||||
if not account.encrypted:
|
if not account.encrypted:
|
||||||
assert account.password is not None, "account was never encrypted"
|
assert account.password is not None, "account was never encrypted"
|
||||||
account.encrypt(account.password)
|
account.encrypt(account.password)
|
||||||
|
return True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_encrypted(self) -> bool:
|
def is_encrypted(self) -> bool:
|
||||||
|
@ -199,6 +201,7 @@ class Wallet:
|
||||||
for account in self.accounts:
|
for account in self.accounts:
|
||||||
account.serialize_encrypted = False
|
account.serialize_encrypted = False
|
||||||
self.save()
|
self.save()
|
||||||
|
return True
|
||||||
|
|
||||||
def encrypt(self, password):
|
def encrypt(self, password):
|
||||||
for account in self.accounts:
|
for account in self.accounts:
|
||||||
|
@ -207,6 +210,7 @@ class Wallet:
|
||||||
account.serialize_encrypted = True
|
account.serialize_encrypted = True
|
||||||
self.save()
|
self.save()
|
||||||
self.unlock(password)
|
self.unlock(password)
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class WalletStorage:
|
class WalletStorage:
|
||||||
|
|
Loading…
Reference in a new issue