From 7c93daa05a2061c465ec8068c28a3a8fcb60cc49 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Mon, 10 Oct 2022 21:53:25 +0200 Subject: [PATCH] make format --- cashu/mint/app.py | 12 ++++-------- cashu/mint/ledger.py | 5 ++--- 2 files changed, 6 insertions(+), 11 deletions(-) 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=""):