fix tokens to proofs

This commit is contained in:
callebtc
2023-01-14 13:45:49 +01:00
parent 7f07c0c6fd
commit ded836d750
2 changed files with 3 additions and 3 deletions

View File

@@ -387,7 +387,7 @@ async def receive(ctx, token: str, lock: str):
# deserialize token
dtoken = json.loads(base64.urlsafe_b64decode(token))
assert "tokens" in dtoken, Exception("no proofs in token")
assert "proofs" in dtoken, Exception("no proofs in token")
includes_mint_info: bool = "mints" in dtoken and dtoken.get("mints") is not None
# if there is a `mints` field in the token
@@ -402,7 +402,7 @@ async def receive(ctx, token: str, lock: str):
await wallet.load_proofs()
else:
# no mint information present, we extract the proofs and use wallet's default mint
proofs = [Proof(**p) for p in dtoken["tokens"]]
proofs = [Proof(**p) for p in dtoken["proofs"]]
_, _ = await wallet.redeem(proofs, script, signature)
wallet.status()

View File

@@ -63,7 +63,7 @@ async def redeem_multimint(ctx, dtoken, script, signature):
# redeem proofs of this keyset
redeem_proofs = [
Proof(**p) for p in dtoken["tokens"] if Proof(**p).id == keyset
Proof(**p) for p in dtoken["proofs"] if Proof(**p).id == keyset
]
_, _ = await keyset_wallet.redeem(
redeem_proofs, scnd_script=script, scnd_siganture=signature