This commit is contained in:
callebtc
2022-09-17 11:15:29 +03:00
parent be326fcd33
commit aa265dc457
10 changed files with 157 additions and 127 deletions

View File

@@ -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),
),
)