Review Fixes
This commit is contained in:
parent
8f3b596385
commit
37665f2df7
3 changed files with 3 additions and 7 deletions
|
@ -89,9 +89,7 @@ class Account(BaseAccount):
|
||||||
log.warning("Corrupt public:private key-pair: %s", str(e))
|
log.warning("Corrupt public:private key-pair: %s", str(e))
|
||||||
results['previous-corrupted'] += 1
|
results['previous-corrupted'] += 1
|
||||||
|
|
||||||
self.channel_keys.clear()
|
self.channel_keys = new_channel_keys
|
||||||
for key in new_channel_keys:
|
|
||||||
self.channel_keys[key] = new_channel_keys[key]
|
|
||||||
|
|
||||||
self.wallet.save()
|
self.wallet.save()
|
||||||
log.info('verifying and possibly migrating certificates:')
|
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):
|
def _get_pubkey_address_from_private_key_pem(self, private_key_pem):
|
||||||
private_key = ecdsa.SigningKey.from_pem(private_key_pem, hashfunc=hashlib.sha256)
|
private_key = ecdsa.SigningKey.from_pem(private_key_pem, hashfunc=hashlib.sha256)
|
||||||
|
|
||||||
public_key_der = private_key.get_verifying_key().to_der()
|
public_key_der = private_key.get_verifying_key().to_der()
|
||||||
return self.ledger.public_key_to_address(public_key_der)
|
return self.ledger.public_key_to_address(public_key_der)
|
||||||
|
|
|
@ -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
|
from torba.client.basenetwork import BaseNetwork
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,8 @@ class ChannelCommands(CommandTestCase):
|
||||||
|
|
||||||
# send the private key too
|
# send the private key too
|
||||||
channel_pubkey_address_hash = self.account.ledger.public_key_to_address(unhexlify(channel['public_key']))
|
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
|
# now should have private key
|
||||||
txo = (await account2.get_channels())[0]
|
txo = (await account2.get_channels())[0]
|
||||||
|
|
Loading…
Reference in a new issue