Review Fixes

This commit is contained in:
hackrush 2019-05-23 01:14:00 +05:30 committed by Lex Berezhny
parent 8f3b596385
commit 37665f2df7
3 changed files with 3 additions and 7 deletions

View file

@ -89,9 +89,7 @@ class Account(BaseAccount):
log.warning("Corrupt public:private key-pair: %s", str(e))
results['previous-corrupted'] += 1
self.channel_keys.clear()
for key in new_channel_keys:
self.channel_keys[key] = new_channel_keys[key]
self.channel_keys = new_channel_keys
self.wallet.save()
log.info('verifying and possibly migrating certificates:')
@ -173,6 +171,5 @@ class Account(BaseAccount):
def _get_pubkey_address_from_private_key_pem(self, private_key_pem):
private_key = ecdsa.SigningKey.from_pem(private_key_pem, hashfunc=hashlib.sha256)
public_key_der = private_key.get_verifying_key().to_der()
return self.ledger.public_key_to_address(public_key_der)

View file

@ -1,5 +1,3 @@
# temporary fix for https://github.com/PyCQA/pylint/issues/2820
# pylint: disable=no-value-for-parameter
from torba.client.basenetwork import BaseNetwork

View file

@ -300,7 +300,8 @@ class ChannelCommands(CommandTestCase):
# send the private key too
channel_pubkey_address_hash = self.account.ledger.public_key_to_address(unhexlify(channel['public_key']))
account2.channel_keys[channel_pubkey_address_hash] = self.account.channel_keys[channel_pubkey_address_hash]
account2.add_channel_private_key('@featurechannel', channel_pubkey_address_hash,
self.account.channel_keys[channel_pubkey_address_hash])
# now should have private key
txo = (await account2.get_channels())[0]