Skip to content

Commit

Permalink
fix tag serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Sep 20, 2023
1 parent d24cd5a commit aa54b63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cashu/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ class P2PKSecret(Secret):
@classmethod
def from_secret(cls, secret: Secret):
assert secret.kind == SecretKind.P2PK, "Secret is not a P2PK secret"
return cls(**secret.dict())
# 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)

def get_p2pk_pubkey_from_secret(self) -> List[str]:
"""Gets the P2PK pubkey from a Secret depending on the locktime
Expand Down

0 comments on commit aa54b63

Please sign in to comment.