mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-22 11:24:19 +01:00
initial commit
This commit is contained in:
20
wallet/models.py
Normal file
20
wallet/models.py
Normal file
@@ -0,0 +1,20 @@
|
||||
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],
|
||||
)
|
||||
Reference in New Issue
Block a user