Merge branch 'lash/table-when-not-exist' into 'master'
Only create table if not exist See merge request nolash/crypto-dev-signer!1
This commit is contained in:
commit
71c87d9e37
@ -1,3 +1,5 @@
|
||||
* 0.1.1
|
||||
- Create key table only if not exist
|
||||
* 0.1.0
|
||||
- Package wrap with setup.py
|
||||
- Fix hex prefix bug in tx serialization
|
||||
|
@ -28,13 +28,13 @@ def to_bytes(x):
|
||||
class ReferenceKeystore(Keystore):
|
||||
|
||||
schema = [
|
||||
"""CREATE TABLE ethereum (
|
||||
"""CREATE TABLE IF NOT EXISTS ethereum (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
key_ciphertext VARCHAR(256) 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 );
|
||||
""",
|
||||
]
|
||||
|
||||
|
@ -152,7 +152,7 @@ def init():
|
||||
kw = {
|
||||
'symmetric_key': secret,
|
||||
}
|
||||
db = ReferenceKeystore('cic_signer', **kw)
|
||||
db = ReferenceKeystore(os.environ.get('SIGNER_DATABASE', 'cic_signer'), **kw)
|
||||
signer = ReferenceSigner(db)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user