Wallet/fix_nostr_timeout (#376)

* fix nostr receive

* split with amount pre 0.13

* drop 0.13.0 amount with split compatibility
This commit is contained in:
callebtc
2023-12-03 01:56:58 +01:00
committed by GitHub
parent 74c9317277
commit 6c8b1a858f
9 changed files with 62 additions and 61 deletions

View File

@@ -107,16 +107,13 @@ def deserialize_token_from_string(token: str) -> TokenV3:
except Exception:
pass
# ----- receive token -----
if token.startswith("cashu"):
tokenObj = TokenV3.deserialize(token)
assert len(tokenObj.token), Exception("no proofs in token")
assert len(tokenObj.token[0].proofs), Exception("no proofs in token")
return tokenObj
# deserialize token
# dtoken = json.loads(base64.urlsafe_b64decode(token))
tokenObj = TokenV3.deserialize(token)
# tokenObj = TokenV2.parse_obj(dtoken)
assert len(tokenObj.token), Exception("no proofs in token")
assert len(tokenObj.token[0].proofs), Exception("no proofs in token")
return tokenObj
raise Exception("Invalid token")
async def receive(