feat: use lnbits price aggregator to save loads of request (#4026)

Co-authored-by: alan <alan@lnbits.com>
This commit is contained in:
dni ⚡
2026-07-06 09:21:55 +02:00
committed by GitHub
co-authored by alan
parent 648aaa17c5
commit 4634ad5a5a
7 changed files with 130 additions and 28 deletions
+4
View File
@@ -275,6 +275,10 @@ async def test_btc_rates_skips_unsupported_and_failing_providers(
@pytest.mark.anyio
async def test_btc_price_handles_empty_single_and_multiple_rates(mocker: MockerFixture):
mocker.patch(
"lnbits.utils.exchange_rates.btc_price_from_aggregator",
AsyncMock(return_value=None),
)
mocker.patch("lnbits.utils.exchange_rates.btc_rates", AsyncMock(return_value=[]))
assert await btc_price("usd") == 0.0