diff --git a/cashu/mint/app.py b/cashu/mint/app.py index c682a70..002d03e 100644 --- a/cashu/mint/app.py +++ b/cashu/mint/app.py @@ -3,21 +3,17 @@ import sys from fastapi import FastAPI from loguru import logger +from starlette.middleware import Middleware +from starlette.middleware.base import BaseHTTPMiddleware +from starlette_context import context +from starlette_context.middleware import RawContextMiddleware from cashu.core.settings import DEBUG, VERSION -from starlette_context.middleware import RawContextMiddleware -from starlette.middleware import Middleware -from starlette_context import context - - from .router import router from .startup import load_ledger -from starlette.middleware.base import BaseHTTPMiddleware - - class CustomHeaderMiddleware(BaseHTTPMiddleware): """ Middleware for starlette that can set the context from request headers diff --git a/cashu/mint/ledger.py b/cashu/mint/ledger.py index 98cbba5..2e2f0bb 100644 --- a/cashu/mint/ledger.py +++ b/cashu/mint/ledger.py @@ -6,10 +6,11 @@ import math from typing import Dict, List, Set from loguru import logger +from starlette_context import context -import cashu.core.legacy as legacy import cashu.core.b_dhke as b_dhke import cashu.core.bolt11 as bolt11 +import cashu.core.legacy as legacy from cashu.core.base import ( BlindedMessage, BlindedSignature, @@ -37,8 +38,6 @@ from cashu.mint.crud import ( update_lightning_invoice, ) -from starlette_context import context - class Ledger: def __init__(self, secret_key: str, db: str, derivation_path=""):