Only create table if not exist
This commit is contained in:
parent
646dbf5f79
commit
6542fd9e2c
@ -1,3 +1,7 @@
|
|||||||
|
* 0.1.1
|
||||||
|
- Create key table only if not exist
|
||||||
|
* 0.1.0
|
||||||
|
- Add web3 ext middleware capturing signer requests
|
||||||
* 0.0.1
|
* 0.0.1
|
||||||
- Introduce signer, transaction, keystore packages
|
- Introduce signer, transaction, keystore packages
|
||||||
- Add test for keystore and signer
|
- Add test for keystore and signer
|
||||||
|
@ -28,13 +28,13 @@ def to_bytes(x):
|
|||||||
class ReferenceKeystore(Keystore):
|
class ReferenceKeystore(Keystore):
|
||||||
|
|
||||||
schema = [
|
schema = [
|
||||||
"""CREATE TABLE ethereum (
|
"""CREATE TABLE IF NOT EXISTS ethereum (
|
||||||
id SERIAL NOT NULL PRIMARY KEY,
|
id SERIAL NOT NULL PRIMARY KEY,
|
||||||
key_ciphertext VARCHAR(256) NOT NULL,
|
key_ciphertext VARCHAR(256) NOT NULL,
|
||||||
wallet_address_hex CHAR(40) NOT NULL
|
wallet_address_hex CHAR(40) NOT NULL
|
||||||
);
|
);
|
||||||
""",
|
""",
|
||||||
"""CREATE UNIQUE INDEX ethereum_address_idx ON ethereum ( wallet_address_hex );
|
"""CREATE UNIQUE INDEX IF NOT EXISTS ethereum_address_idx ON ethereum ( wallet_address_hex );
|
||||||
""",
|
""",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ def init():
|
|||||||
kw = {
|
kw = {
|
||||||
'symmetric_key': secret,
|
'symmetric_key': secret,
|
||||||
}
|
}
|
||||||
db = ReferenceKeystore('cic_signer', **kw)
|
db = ReferenceKeystore(os.environ.get('SIGNER_DATABASE', 'cic_signer'), **kw)
|
||||||
signer = ReferenceSigner(db)
|
signer = ReferenceSigner(db)
|
||||||
|
|
||||||
|
|
||||||
|
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.0",
|
version="0.1.1",
|
||||||
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