Fix/nut 04 payment hash (#191)

* payment_hash -> hash

* add aes encryption

* urlsafe base64 for free

* move files to crypto

* use random hash instead of encryption

* get rid of useless code

* simplify
This commit is contained in:
callebtc
2023-05-04 00:12:18 +02:00
committed by GitHub
parent 84d2471902
commit e9f33337db
21 changed files with 99 additions and 927 deletions

View File

@@ -146,3 +146,17 @@ async def m005_pending_proofs_table(db: Database) -> None:
);
"""
)
async def m006_invoices_add_payment_hash(db: Database):
"""
Column that remembers the payment_hash as we're using
the column hash as a random identifier now
(see https://github.com/cashubtc/nuts/pull/14).
"""
await db.execute(
f"ALTER TABLE {table_with_schema(db, 'invoices')} ADD COLUMN payment_hash TEXT"
)
await db.execute(
f"UPDATE {table_with_schema(db, 'invoices')} SET payment_hash = hash"
)