mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-22 19:34:18 +01:00
* n_sigs_refund working, tests added * update requirements * wip sigall * wip * sigall works * add signatures for refund * add mint p2pk tests * add more p2pk tests * fix tests * sign htlc pubkeys as well * fix htlc and add new test * fix regtest * fix new tests with deprecated * remove asserts * comments * new wallet p2pk tests * getting there * add more tests * fixes * refactor htlc and p2pk validation * reduce code * melt with sigall * fix htlcs * fix deprecated api tests * Update cashu/mint/conditions.py Co-authored-by: lollerfirst <43107113+lollerfirst@users.noreply.github.com> * refactor sigall validation --------- Co-authored-by: lollerfirst <43107113+lollerfirst@users.noreply.github.com>
13 lines
522 B
Python
13 lines
522 B
Python
from .p2pk import P2PKSecret
|
|
from .secret import Secret, SecretKind
|
|
|
|
|
|
# HTLCSecret inherits properties from P2PKSecret
|
|
class HTLCSecret(P2PKSecret, Secret):
|
|
@classmethod
|
|
def from_secret(cls, secret: Secret):
|
|
assert SecretKind(secret.kind) == SecretKind.HTLC, "Secret is not a HTLC secret"
|
|
# NOTE: exclude tags in .dict() because it doesn't deserialize it properly
|
|
# need to add it back in manually with tags=secret.tags
|
|
return cls(**secret.dict(exclude={"tags"}), tags=secret.tags)
|