chore: update pyright to latest and fix new issues (#3978)

This commit is contained in:
dni ⚡
2026-06-03 11:46:53 +02:00
committed by GitHub
parent 1e0fc84586
commit b98515df14
17 changed files with 57 additions and 43 deletions
+6 -3
View File
@@ -1,3 +1,4 @@
from typing import cast
from uuid import uuid4
import pytest
@@ -86,7 +87,9 @@ async def test_get_pr_from_lnurl_success_and_error(mocker: MockerFixture):
mocker.patch(
"lnbits.core.services.lnurl.execute_pay_request",
mocker.AsyncMock(
return_value=LnurlPayActionResponse(pr=LightningInvoice(TEST_BOLT11))
return_value=LnurlPayActionResponse(
pr=cast(LightningInvoice, LightningInvoice(TEST_BOLT11))
)
),
)
@@ -106,7 +109,7 @@ async def test_fetch_lnurl_pay_request_converts_currency_and_stores_paylink(
):
pay_response = make_lnurl_pay_response(min_sendable_msat=1, text="Test")
action_response = LnurlPayActionResponse(
pr=LightningInvoice(TEST_BOLT11), disposable=False
pr=cast(LightningInvoice, LightningInvoice(TEST_BOLT11)), disposable=False
)
mocker.patch(
"lnbits.core.services.lnurl.fiat_amount_as_satoshis",
@@ -143,7 +146,7 @@ async def test_store_paylink_appends_and_updates_existing():
wallet = await _create_wallet()
pay_response = make_lnurl_pay_response(min_sendable_msat=1, text="Test")
action_response = LnurlPayActionResponse(
pr=LightningInvoice(TEST_BOLT11), disposable=False
pr=cast(LightningInvoice, LightningInvoice(TEST_BOLT11)), disposable=False
)
await store_paylink(
+2 -1
View File
@@ -1,3 +1,4 @@
from typing import Any
from uuid import uuid4
import pytest
@@ -66,7 +67,7 @@ async def test_create_user_account_no_check_rejects_duplicate_identity_fields(
existing = _account(**existing_data)
await create_account(existing)
resolved = {
resolved: dict[str, Any] = {
key: (value(existing) if callable(value) else value)
for key, value in new_data.items()
}
+6 -4
View File
@@ -1,3 +1,5 @@
from typing import Any
import pytest
from pytest_mock.plugin import MockerFixture
@@ -14,22 +16,22 @@ from lnbits.settings import (
set_cli_settings,
)
lnurlp_redirect_path = {
lnurlp_redirect_path: dict[str, Any] = {
"from_path": "/.well-known/lnurlp",
"redirect_to_path": "/api/v1/well-known",
}
lnurlp_redirect_path_with_headers = {
lnurlp_redirect_path_with_headers: dict[str, Any] = {
"from_path": "/.well-known/lnurlp",
"redirect_to_path": "/api/v1/well-known",
"header_filters": {"accept": "application/nostr+json"},
}
lnaddress_redirect_path = {
lnaddress_redirect_path: dict[str, Any] = {
"from_path": "/.well-known/lnurlp",
"redirect_to_path": "/api/v1/well-known",
}
nostrrelay_redirect_path = {
nostrrelay_redirect_path: dict[str, Any] = {
"from_path": "/",
"redirect_to_path": "/api/v1/relay-info",
"header_filters": {"accept": "application/nostr+json"},