mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-25 20:44:20 +01:00
proof.do_tict() minor fixup (#357)
This commit is contained in:
@@ -103,18 +103,18 @@ class Proof(BaseModel):
|
||||
return c
|
||||
|
||||
def to_dict(self, include_dleq=False):
|
||||
# dictionary without the fields that don't need to be send to Carol
|
||||
if not include_dleq:
|
||||
return dict(id=self.id, amount=self.amount, secret=self.secret, C=self.C)
|
||||
# necessary fields
|
||||
return_dict = dict(id=self.id, amount=self.amount, secret=self.secret, C=self.C)
|
||||
|
||||
assert self.dleq, "DLEQ proof is missing"
|
||||
return dict(
|
||||
id=self.id,
|
||||
amount=self.amount,
|
||||
secret=self.secret,
|
||||
C=self.C,
|
||||
dleq=self.dleq.dict(),
|
||||
)
|
||||
# optional fields
|
||||
if include_dleq:
|
||||
assert self.dleq, "DLEQ proof is missing"
|
||||
return_dict["dleq"] = self.dleq.dict() # type: ignore
|
||||
|
||||
if self.witness:
|
||||
return_dict["witness"] = self.witness
|
||||
|
||||
return return_dict
|
||||
|
||||
def to_dict_no_dleq(self):
|
||||
# dictionary without the fields that don't need to be send to Carol
|
||||
|
||||
@@ -4,8 +4,6 @@ from loguru import logger
|
||||
|
||||
from ..core.settings import settings
|
||||
|
||||
sys.tracebacklimit = None # type: ignore
|
||||
|
||||
# configure logger
|
||||
logger.remove()
|
||||
logger.add(sys.stderr, level="DEBUG" if settings.debug else "INFO")
|
||||
|
||||
Reference in New Issue
Block a user