mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-04 16:24:21 +01:00
isort
This commit is contained in:
@@ -26,6 +26,7 @@ If true, C must have originated from Alice
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
from secp256k1 import PrivateKey, PublicKey
|
from secp256k1 import PrivateKey, PublicKey
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
from functools import partial, wraps
|
from functools import partial, wraps
|
||||||
|
|
||||||
from core.settings import LIGHTNING_FEE_PERCENT, LIGHTNING_RESERVE_FEE_MIN
|
from core.settings import LIGHTNING_FEE_PERCENT, LIGHTNING_RESERVE_FEE_MIN
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
from loguru import logger
|
|
||||||
from core.db import Database
|
|
||||||
from core.db import COCKROACH, POSTGRES, SQLITE
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
|
from core.db import COCKROACH, POSTGRES, SQLITE, Database
|
||||||
|
|
||||||
|
|
||||||
async def migrate_databases(db: Database, migrations_module):
|
async def migrate_databases(db: Database, migrations_module):
|
||||||
"""Creates the necessary databases if they don't exist already; or migrates them."""
|
"""Creates the necessary databases if they don't exist already; or migrates them."""
|
||||||
|
|||||||
@@ -8,13 +8,8 @@ import requests
|
|||||||
|
|
||||||
from core.settings import LNBITS_ENDPOINT, LNBITS_KEY
|
from core.settings import LNBITS_ENDPOINT, LNBITS_KEY
|
||||||
|
|
||||||
from .base import (
|
from .base import (InvoiceResponse, PaymentResponse, PaymentStatus,
|
||||||
InvoiceResponse,
|
StatusResponse, Wallet)
|
||||||
PaymentResponse,
|
|
||||||
PaymentStatus,
|
|
||||||
StatusResponse,
|
|
||||||
Wallet,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class LNbitsWallet(Wallet):
|
class LNbitsWallet(Wallet):
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ import click
|
|||||||
import uvicorn
|
import uvicorn
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from secp256k1 import PublicKey
|
from secp256k1 import PublicKey
|
||||||
|
|
||||||
import core.settings as settings
|
import core.settings as settings
|
||||||
from core.base import MintPayloads, SplitPayload, MeltPayload, CheckPayload
|
from core.base import CheckPayload, MeltPayload, MintPayloads, SplitPayload
|
||||||
from core.settings import MINT_PRIVATE_KEY, MINT_SERVER_HOST, MINT_SERVER_PORT
|
from core.settings import MINT_PRIVATE_KEY, MINT_SERVER_HOST, MINT_SERVER_PORT
|
||||||
from lightning import WALLET
|
from lightning import WALLET
|
||||||
from mint.ledger import Ledger
|
from mint.ledger import Ledger
|
||||||
|
|||||||
@@ -3,27 +3,19 @@ Implementation of https://gist.github.com/phyro/935badc682057f418842c72961cf096c
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
from core.secp import PrivateKey, PublicKey
|
|
||||||
|
|
||||||
from typing import List, Set
|
from typing import List, Set
|
||||||
from core.base import Proof, BlindedMessage, BlindedSignature
|
|
||||||
|
|
||||||
import core.b_dhke as b_dhke
|
import core.b_dhke as b_dhke
|
||||||
from core.base import Invoice
|
from core.base import BlindedMessage, BlindedSignature, Invoice, Proof
|
||||||
from core.db import Database
|
from core.db import Database
|
||||||
from core.settings import MAX_ORDER, LIGHTNING
|
|
||||||
from core.helpers import fee_reserve
|
from core.helpers import fee_reserve
|
||||||
|
from core.secp import PrivateKey, PublicKey
|
||||||
|
from core.settings import LIGHTNING, MAX_ORDER
|
||||||
from core.split import amount_split
|
from core.split import amount_split
|
||||||
from lightning import WALLET
|
from lightning import WALLET
|
||||||
from mint.crud import (
|
from mint.crud import (get_lightning_invoice, get_proofs_used,
|
||||||
get_lightning_invoice,
|
invalidate_proof, store_lightning_invoice,
|
||||||
get_proofs_used,
|
store_promise, update_lightning_invoice)
|
||||||
invalidate_proof,
|
|
||||||
store_lightning_invoice,
|
|
||||||
store_promise,
|
|
||||||
update_lightning_invoice,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Ledger:
|
class Ledger:
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from core.helpers import async_unwrap
|
from core.helpers import async_unwrap
|
||||||
|
|
||||||
from core.migrations import migrate_databases
|
from core.migrations import migrate_databases
|
||||||
from wallet import migrations
|
from wallet import migrations
|
||||||
|
|
||||||
from wallet.wallet import Wallet as Wallet1
|
from wallet.wallet import Wallet as Wallet1
|
||||||
from wallet.wallet import Wallet as Wallet2
|
from wallet.wallet import Wallet as Wallet2
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ from functools import wraps
|
|||||||
import click
|
import click
|
||||||
from bech32 import bech32_decode, bech32_encode, convertbits
|
from bech32 import bech32_decode, bech32_encode, convertbits
|
||||||
|
|
||||||
from core.settings import MINT_URL, LIGHTNING
|
|
||||||
from core.migrations import migrate_databases
|
|
||||||
from core.base import Proof
|
|
||||||
from core.helpers import fee_reserve
|
|
||||||
import core.bolt11 as bolt11
|
import core.bolt11 as bolt11
|
||||||
|
from core.base import Proof
|
||||||
from core.bolt11 import Invoice
|
from core.bolt11 import Invoice
|
||||||
from wallet.wallet import Wallet as Wallet
|
from core.helpers import fee_reserve
|
||||||
|
from core.migrations import migrate_databases
|
||||||
|
from core.settings import LIGHTNING, MINT_URL
|
||||||
from wallet import migrations
|
from wallet import migrations
|
||||||
|
from wallet.wallet import Wallet as Wallet
|
||||||
|
|
||||||
|
|
||||||
async def init_wallet(wallet: Wallet):
|
async def init_wallet(wallet: Wallet):
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import secrets
|
import secrets
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from core.base import Proof
|
from core.base import Proof
|
||||||
from core.db import Connection, Database
|
from core.db import Connection, Database
|
||||||
|
|
||||||
|
|||||||
@@ -2,21 +2,15 @@ import random
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from core.secp import PublicKey
|
|
||||||
|
|
||||||
import core.b_dhke as b_dhke
|
import core.b_dhke as b_dhke
|
||||||
from core.base import (
|
from core.base import (BlindedMessage, BlindedSignature, CheckPayload,
|
||||||
BlindedMessage,
|
MeltPayload, MintPayloads, Proof, SplitPayload)
|
||||||
MintPayloads,
|
|
||||||
Proof,
|
|
||||||
SplitPayload,
|
|
||||||
BlindedSignature,
|
|
||||||
CheckPayload,
|
|
||||||
MeltPayload,
|
|
||||||
)
|
|
||||||
from core.db import Database
|
from core.db import Database
|
||||||
|
from core.secp import PublicKey
|
||||||
from core.split import amount_split
|
from core.split import amount_split
|
||||||
from wallet.crud import get_proofs, invalidate_proof, store_proof, update_proof_reserved
|
from wallet.crud import (get_proofs, invalidate_proof, store_proof,
|
||||||
|
update_proof_reserved)
|
||||||
|
|
||||||
|
|
||||||
class LedgerAPI:
|
class LedgerAPI:
|
||||||
|
|||||||
Reference in New Issue
Block a user