mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-22 03:24:18 +01:00
Refactor secret conditions (#350)
* refactor spending conditions and add comments * fix kind enum deserialization
This commit is contained in:
@@ -6,7 +6,7 @@ from .secret import Secret, SecretKind
|
||||
class HTLCSecret(Secret):
|
||||
@classmethod
|
||||
def from_secret(cls, secret: Secret):
|
||||
assert secret.kind == SecretKind.HTLC, "Secret is not a HTLC 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)
|
||||
|
||||
Reference in New Issue
Block a user