funga

Signer and keystore daemon and library for cryptocurrency software development
Log | Files | Refs | README | LICENSE

commit 5a45512f3b115f272c2e8b07f1cde4f4bd4d6bb1
parent 630db89381387015eab7114dcb0786e0dcea7a19
Author: nolash <dev@holbrook.no>
Date:   Sun, 20 Sep 2020 10:15:48 +0200

Return new address on method 'new'

Diffstat:
Mcrypto_dev_signer/keystore/postgres.py | 2+-
Mtest/test_keystore.py | 4++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/crypto_dev_signer/keystore/postgres.py b/crypto_dev_signer/keystore/postgres.py @@ -55,7 +55,7 @@ class ReferenceKeystore(Keystore): def new(self, password=None): b = os.urandom(32) pk = keyapi.PrivateKey(b) - self.import(pk, password) + return self.import_key(pk, password) def import_key(self, pk, password=None): diff --git a/test/test_keystore.py b/test/test_keystore.py @@ -1,13 +1,16 @@ #!/usr/bin/python +# standard imports import unittest import logging import base64 +# third-party imports import psycopg2 from psycopg2 import sql from cryptography.fernet import Fernet, InvalidToken +# local imports from crypto_dev_signer.keystore import ReferenceKeystore logging.basicConfig(level=logging.DEBUG) @@ -23,6 +26,7 @@ class TestDatabase(unittest.TestCase): db = None def setUp(self): + logg.debug('setup') # arbitrary value symkey_hex = 'E92431CAEE69313A7BE9E443C4ABEED9BF8157E9A13553B4D5D6E7D51B5021D9' self.symkey = bytes.fromhex(symkey_hex)