Rename forbidden keyword import
This commit is contained in:
parent
71c87d9e37
commit
fc4c211849
@ -1,3 +1,5 @@
|
|||||||
|
* 0.2.0
|
||||||
|
- Add import method to keystore interface
|
||||||
* 0.1.1
|
* 0.1.1
|
||||||
- Create key table only if not exist
|
- Create key table only if not exist
|
||||||
* 0.1.0
|
* 0.1.0
|
||||||
|
@ -6,3 +6,6 @@ class Keystore:
|
|||||||
def new(self, password=None):
|
def new(self, password=None):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def import_key(self, pk, password=None):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@ -55,12 +55,15 @@ class ReferenceKeystore(Keystore):
|
|||||||
def new(self, password=None):
|
def new(self, password=None):
|
||||||
b = os.urandom(32)
|
b = os.urandom(32)
|
||||||
pk = keyapi.PrivateKey(b)
|
pk = keyapi.PrivateKey(b)
|
||||||
|
self.import(pk, password)
|
||||||
|
|
||||||
|
|
||||||
|
def import_key(self, pk, password=None):
|
||||||
pubk = keyapi.private_key_to_public_key(pk)
|
pubk = keyapi.private_key_to_public_key(pk)
|
||||||
address_hex = pubk.to_checksum_address()
|
address_hex = pubk.to_checksum_address()
|
||||||
address_hex_clean = strip_hex_prefix(address_hex)
|
address_hex_clean = strip_hex_prefix(address_hex)
|
||||||
|
|
||||||
logg.debug('address {}'.format(address_hex_clean))
|
logg.debug('inserting address {}'.format(address_hex_clean))
|
||||||
c = self._encrypt(pk.to_bytes(), password)
|
c = self._encrypt(pk.to_bytes(), password)
|
||||||
s = sql.SQL('INSERT INTO ethereum (wallet_address_hex, key_ciphertext) VALUES (%s, %s)')
|
s = sql.SQL('INSERT INTO ethereum (wallet_address_hex, key_ciphertext) VALUES (%s, %s)')
|
||||||
self.cur.execute(s, [ address_hex_clean, c.decode('utf-8') ])
|
self.cur.execute(s, [ address_hex_clean, c.decode('utf-8') ])
|
||||||
|
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="crypto-dev-signer",
|
name="crypto-dev-signer",
|
||||||
version="0.1.1",
|
version="0.2.0"
|
||||||
description="A signer and keystore daemon and library for cryptocurrency software development",
|
description="A signer and keystore daemon and library for cryptocurrency software development",
|
||||||
author="Louis Holbrook",
|
author="Louis Holbrook",
|
||||||
author_email="dev@holbrook.no",
|
author_email="dev@holbrook.no",
|
||||||
|
Loading…
Reference in New Issue
Block a user