fake wallet queue issue
This commit is contained in:
+1
-3
@@ -47,7 +47,7 @@ def create_app() -> FastAPI:
|
|||||||
description="API for LNbits, the free and open source bitcoin wallet and accounts system with plugins.",
|
description="API for LNbits, the free and open source bitcoin wallet and accounts system with plugins.",
|
||||||
license_info={
|
license_info={
|
||||||
"name": "MIT License",
|
"name": "MIT License",
|
||||||
"url": "https://raw.githubusercontent.com/lnbits/lnbits-legend/main/LICENSE",
|
"url": "https://raw.githubusercontent.com/lnbits/lnbits/main/LICENSE",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -58,8 +58,6 @@ def create_app() -> FastAPI:
|
|||||||
name="core_static",
|
name="core_static",
|
||||||
)
|
)
|
||||||
|
|
||||||
# needed for lnurlw?
|
|
||||||
# g().config = settings
|
|
||||||
g().base_url = f"http://{settings.host}:{settings.port}"
|
g().base_url = f"http://{settings.host}:{settings.port}"
|
||||||
|
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ from .base import (
|
|||||||
|
|
||||||
|
|
||||||
class FakeWallet(Wallet):
|
class FakeWallet(Wallet):
|
||||||
|
queue: asyncio.Queue = asyncio.Queue(0)
|
||||||
secret: str = settings.fake_wallet_secret
|
secret: str = settings.fake_wallet_secret
|
||||||
privkey: str = hashlib.pbkdf2_hmac(
|
privkey: str = hashlib.pbkdf2_hmac(
|
||||||
"sha256",
|
"sha256",
|
||||||
@@ -97,7 +98,6 @@ class FakeWallet(Wallet):
|
|||||||
return PaymentStatus(None)
|
return PaymentStatus(None)
|
||||||
|
|
||||||
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
|
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
|
||||||
self.queue: asyncio.Queue = asyncio.Queue(0)
|
|
||||||
while True:
|
while True:
|
||||||
value: Invoice = await self.queue.get()
|
value: Invoice = await self.queue.get()
|
||||||
yield value.payment_hash
|
yield value.payment_hash
|
||||||
|
|||||||
Reference in New Issue
Block a user