mirror of
https://github.com/basicswap/basicswap.git
synced 2026-06-08 12:11:41 +02:00
refactor: black
This commit is contained in:
@@ -166,7 +166,6 @@ import basicswap.network.network as bsn
|
||||
import basicswap.protocols.atomic_swap_1 as atomic_swap_1
|
||||
import basicswap.protocols.xmr_swap_1 as xmr_swap_1
|
||||
|
||||
|
||||
PROTOCOL_VERSION_SECRET_HASH = 5
|
||||
MINPROTO_VERSION_SECRET_HASH = 4
|
||||
|
||||
@@ -13811,8 +13810,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
||||
num_watched_outputs += len(v["watched_outputs"])
|
||||
|
||||
now: int = self.getTime()
|
||||
q_bids_str: str = (
|
||||
"""SELECT
|
||||
q_bids_str: str = """SELECT
|
||||
COUNT(CASE WHEN b.was_sent THEN 1 ELSE NULL END) AS count_sent,
|
||||
COUNT(CASE WHEN b.was_sent AND (s.in_progress OR (s.swap_ended = 0 AND b.expire_at > :now AND o.expire_at > :now)) THEN 1 ELSE NULL END) AS count_sent_active,
|
||||
COUNT(CASE WHEN b.was_received THEN 1 ELSE NULL END) AS count_received,
|
||||
@@ -13822,15 +13820,12 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
||||
JOIN offers o ON b.offer_id = o.offer_id
|
||||
JOIN bidstates s ON b.state = s.state_id
|
||||
WHERE b.active_ind = 1"""
|
||||
)
|
||||
|
||||
q_offers_str: str = (
|
||||
"""SELECT
|
||||
q_offers_str: str = """SELECT
|
||||
COUNT(CASE WHEN expire_at > :now THEN 1 ELSE NULL END) AS count_active,
|
||||
COUNT(CASE WHEN was_sent THEN 1 ELSE NULL END) AS count_sent,
|
||||
COUNT(CASE WHEN was_sent AND expire_at > :now THEN 1 ELSE NULL END) AS count_sent_active
|
||||
FROM offers WHERE active_ind = 1"""
|
||||
)
|
||||
|
||||
try:
|
||||
cursor = self.openDB()
|
||||
|
||||
@@ -12,7 +12,6 @@ import time
|
||||
from enum import IntEnum, auto
|
||||
from typing import Optional
|
||||
|
||||
|
||||
CURRENT_DB_VERSION = 34
|
||||
CURRENT_DB_DATA_VERSION = 8
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import json
|
||||
|
||||
|
||||
default_coingecko_api_key = "CG-8hm3r9iLfpEXv4ied8oLbeUj"
|
||||
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ from basicswap.basicswap_util import TxLockTypes
|
||||
from basicswap.chainparams import Coins
|
||||
from basicswap.rpc import make_rpc_func, openrpc
|
||||
|
||||
|
||||
SEQUENCE_LOCKTIME_GRANULARITY = 9 # 512 seconds
|
||||
SEQUENCE_LOCKTIME_TYPE_FLAG = 1 << 22
|
||||
SEQUENCE_LOCKTIME_MASK = 0x0000FFFF
|
||||
|
||||
@@ -82,7 +82,6 @@ from coincurve.ecdsaotves import (
|
||||
ecdsaotves_rec_enc_key,
|
||||
)
|
||||
|
||||
|
||||
SEQUENCE_LOCKTIME_GRANULARITY = 9 # 512 seconds
|
||||
SEQUENCE_LOCKTIME_TYPE_FLAG = 1 << 22
|
||||
SEQUENCE_LOCKTIME_MASK = 0x0000F
|
||||
|
||||
@@ -13,7 +13,7 @@ import subprocess
|
||||
def createDCRWallet(args, hex_seed, logging, delay_event):
|
||||
logging.info("Creating DCR wallet")
|
||||
|
||||
(pipe_r, pipe_w) = os.pipe() # subprocess.PIPE is buffered, blocks when read
|
||||
pipe_r, pipe_w = os.pipe() # subprocess.PIPE is buffered, blocks when read
|
||||
|
||||
if os.name == "nt":
|
||||
str_args = " ".join(args)
|
||||
|
||||
@@ -34,7 +34,6 @@ from basicswap.rpc_xmr import make_xmr_rpc_func, make_xmr_rpc2_func
|
||||
from basicswap.chainparams import XMR_COIN, Coins
|
||||
from basicswap.interface.base import CoinInterface
|
||||
|
||||
|
||||
ed25519_l = 2**252 + 27742317777372353535851937790883648493
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ protobuf ParseFromString would reset the whole object, from_bytes won't.
|
||||
|
||||
from basicswap.util.integer import encode_varint, decode_varint
|
||||
|
||||
|
||||
NPBW_INT = 0
|
||||
NPBW_BYTES = 2
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ from basicswap.contrib.rfc6979 import (
|
||||
rfc6979_hmac_sha256_generate,
|
||||
)
|
||||
|
||||
|
||||
START_TOKEN = 0xABCD
|
||||
MSG_START_TOKEN = START_TOKEN.to_bytes(2, "big")
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ def initSimplexClient(args, logger, delay_event):
|
||||
# TODO: Must be a better way?
|
||||
logger.info("Initialising Simplex client")
|
||||
|
||||
(pipe_r, pipe_w) = os.pipe() # subprocess.PIPE is buffered, blocks when read
|
||||
pipe_r, pipe_w = os.pipe() # subprocess.PIPE is buffered, blocks when read
|
||||
|
||||
if os.name == "nt":
|
||||
str_args = " ".join(args)
|
||||
|
||||
@@ -10,7 +10,6 @@ import json
|
||||
import time
|
||||
import decimal
|
||||
|
||||
|
||||
COIN = 100000000
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ from basicswap.contrib.test_framework.messages import (
|
||||
uint256_from_str,
|
||||
)
|
||||
|
||||
|
||||
AES_BLOCK_SIZE = 16
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user