Skip to content

Commit

Permalink
fix blindedsignature method
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed May 22, 2024
1 parent 79b3afa commit 2307423
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions cashu/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ def p2pksigs(self) -> List[str]:
return P2PKWitness.from_witness(self.witness).signatures


class BlindedMessages(BaseModel):
# NOTE: not used in Pydantic validation
__root__: List[BlindedMessage] = []


class BlindedSignature(BaseModel):
"""
Blinded signature or "promise" which is the signature on a `BlindedMessage`
Expand All @@ -209,10 +214,14 @@ class BlindedSignature(BaseModel):
C_: str # Hex-encoded signature
dleq: Optional[DLEQ] = None # DLEQ proof


class BlindedMessages(BaseModel):
# NOTE: not used in Pydantic validation
__root__: List[BlindedMessage] = []
@classmethod
def from_row(cls, row: Row):
return cls(
id=row["id"],
amount=row["amount"],
C_=row["c_"],
dleq=DLEQ(e=row["dleq_e"], s=row["dleq_s"]),
)


# ------- LIGHTNING INVOICE -------
Expand Down

0 comments on commit 2307423

Please sign in to comment.