From aa54b63f2e5bed9d665d2e10d4786404230bf77e Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 20 Sep 2023 16:29:37 +0200 Subject: [PATCH] fix tag serialization --- cashu/core/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cashu/core/base.py b/cashu/core/base.py index c2882e6f..4bd8c385 100644 --- a/cashu/core/base.py +++ b/cashu/core/base.py @@ -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