mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-22 11:24:19 +01:00
21 lines
367 B
Python
21 lines
367 B
Python
from pydantic import BaseModel
|
|
from sqlite3 import Row
|
|
|
|
|
|
class Proof(dict):
|
|
amount: int
|
|
C_x: int
|
|
C_y: int
|
|
secret: str
|
|
|
|
@classmethod
|
|
def from_row(cls, row: Row):
|
|
return dict(
|
|
amount=row[0],
|
|
C=dict(
|
|
x=int(row[1]),
|
|
y=int(row[2]),
|
|
),
|
|
secret=row[3],
|
|
)
|