Skip to content

Commit

Permalink
proof.do_tict() minor fixup (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc authored Nov 13, 2023
1 parent 0c3777d commit 3348ffa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 12 additions & 12 deletions cashu/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ def from_dict(cls, proof_dict: dict):
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)

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(),
)
# necessary fields
return_dict = dict(id=self.id, amount=self.amount, secret=self.secret, C=self.C)

# 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
Expand Down
2 changes: 0 additions & 2 deletions cashu/wallet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

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")

0 comments on commit 3348ffa

Please sign in to comment.