mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-24 03:54:21 +01:00
fix tokens to proofs
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user