mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
works
This commit is contained in:
23
mint/crud.py
23
mint/crud.py
@@ -7,10 +7,8 @@ from core.db import Connection, Database
|
||||
|
||||
async def store_promise(
|
||||
amount: int,
|
||||
B_x: str,
|
||||
B_y: str,
|
||||
C_x: str,
|
||||
C_y: str,
|
||||
B_: str,
|
||||
C_: str,
|
||||
db: Database,
|
||||
conn: Optional[Connection] = None,
|
||||
):
|
||||
@@ -18,15 +16,13 @@ async def store_promise(
|
||||
await (conn or db).execute(
|
||||
"""
|
||||
INSERT INTO promises
|
||||
(amount, B_x, B_y, C_x, C_y)
|
||||
VALUES (?, ?, ?, ?, ?)
|
||||
(amount, B_b, C_b)
|
||||
VALUES (?, ?, ?)
|
||||
""",
|
||||
(
|
||||
amount,
|
||||
str(B_x),
|
||||
str(B_y),
|
||||
str(C_x),
|
||||
str(C_y),
|
||||
str(B_),
|
||||
str(C_),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -54,13 +50,12 @@ async def invalidate_proof(
|
||||
await (conn or db).execute(
|
||||
"""
|
||||
INSERT INTO proofs_used
|
||||
(amount, C_x, C_y, secret)
|
||||
VALUES (?, ?, ?, ?)
|
||||
(amount, C, secret)
|
||||
VALUES (?, ?, ?)
|
||||
""",
|
||||
(
|
||||
proof.amount,
|
||||
str(proof.C.x),
|
||||
str(proof.C.y),
|
||||
str(proof.C),
|
||||
str(proof.secret),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user