From d26e50ec9af49ae16b6491a982532bc75f5a6bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 16 Sep 2024 17:34:30 +0200 Subject: [PATCH] refactor: rename is_uncheckable (#2670) it actually means is_internal and internal payments cant fail so we return success status --- lnbits/core/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lnbits/core/models.py b/lnbits/core/models.py index 4afca23bc..24bae0d72 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -21,8 +21,8 @@ from lnbits.settings import settings from lnbits.utils.exchange_rates import allowed_currencies from lnbits.wallets import get_funding_source from lnbits.wallets.base import ( - PaymentPendingStatus, PaymentStatus, + PaymentSuccessStatus, ) @@ -285,12 +285,12 @@ class Payment(FromRowModel): return self.expiry < time.time() if self.expiry else False @property - def is_uncheckable(self) -> bool: + def is_internal(self) -> bool: return self.checking_id.startswith("internal_") async def check_status(self) -> PaymentStatus: - if self.is_uncheckable: - return PaymentPendingStatus() + if self.is_internal: + return PaymentSuccessStatus() funding_source = get_funding_source() if self.is_out: status = await funding_source.get_payment_status(self.checking_id)