From 12848938e04ab9c9581ed2ca33137cfbf259dcd7 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:24:16 +0100 Subject: [PATCH] better error --- lnbits/extensions/cashu/views_api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/cashu/views_api.py b/lnbits/extensions/cashu/views_api.py index 4edd92294..3b51bb6a3 100644 --- a/lnbits/extensions/cashu/views_api.py +++ b/lnbits/extensions/cashu/views_api.py @@ -261,8 +261,8 @@ async def melt_coins( # THIS IS NECESSARY BECAUSE THE CASHU BACKEND WILL ACCEPT ANY VALID # TOKENS assert all([p.id == cashu.keyset_id for p in proofs]), HTTPException( - status_code=HTTPStatus.BAD_REQUEST, - detail="Proofs include tokens from another mint.", + status_code=HTTPStatus.METHOD_NOT_ALLOWED, + detail="Tokens are from another mint.", ) assert all([ledger._verify_proof(p) for p in proofs]), HTTPException( @@ -355,8 +355,8 @@ async def split( # THIS IS NECESSARY BECAUSE THE CASHU BACKEND WILL ACCEPT ANY VALID # TOKENS assert all([p.id == cashu.keyset_id for p in proofs]), HTTPException( - status_code=HTTPStatus.BAD_REQUEST, - detail="Proofs include tokens from another mint.", + status_code=HTTPStatus.METHOD_NOT_ALLOWED, + detail="Tokens are from another mint.", ) amount = payload.amount