Browse Source

Correct flake8 errors

Remove unused imports
Make regexp strings raw strings in bip21 and amount.py
Remove copy of classmethod in wallet.py
master
Adam Gibson 6 years ago
parent
commit
04752e1910
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 2
      jmbitcoin/jmbitcoin/amount.py
  2. 2
      jmbitcoin/jmbitcoin/bip21.py
  3. 1
      jmclient/jmclient/taker_utils.py
  4. 6
      jmclient/jmclient/wallet.py
  5. 1
      jmclient/jmclient/wallet_service.py

2
jmbitcoin/jmbitcoin/amount.py

@ -21,7 +21,7 @@ def sat_to_btc(sat):
def amount_to_sat(amount_str):
amount_str = str(amount_str).strip()
if re.compile("^[0-9]{1,8}(\.)?([0-9]{1,8})?(btc|sat)?$").match(
if re.compile(r"^[0-9]{1,8}(\.)?([0-9]{1,8})?(btc|sat)?$").match(
amount_str.lower()) is None:
raise ValueError("Invalid BTC amount string " + amount_str)
if amount_str.lower().endswith("btc"):

2
jmbitcoin/jmbitcoin/bip21.py

@ -15,7 +15,7 @@ def is_bip21_uri(uri):
def is_bip21_amount_str(amount):
return re.compile("^[0-9]{1,8}(\.[0-9]{1,8})?$").match(str(amount)) != None
return re.compile(r"^[0-9]{1,8}(\.[0-9]{1,8})?$").match(str(amount)) != None
def validate_bip21_amount(amount):

1
jmclient/jmclient/taker_utils.py

@ -5,7 +5,6 @@ import os
import sys
import time
import numbers
from binascii import hexlify
from jmbase import get_log, jmprint
from .configure import jm_single, validate_address, is_burn_destination

6
jmclient/jmclient/wallet.py

@ -1706,12 +1706,6 @@ class FidelityBondMixin(object):
def is_timelocked_path(cls, path):
return len(path) > 4 and path[4] == cls.BIP32_TIMELOCK_ID
def get_xpub_from_fidelity_bond_master_pub_key(cls, mpk):
if mpk.startswith(cls._BIP32_PUBKEY_PREFIX):
return mpk[len(cls._BIP32_PUBKEY_PREFIX):]
else:
return False
def _get_key_ident(self):
first_path = self.get_path(0, 0)
priv, engine = self._get_key_from_path(first_path)

1
jmclient/jmclient/wallet_service.py

@ -5,7 +5,6 @@ import time
import ast
import binascii
import sys
import itertools
from decimal import Decimal
from copy import deepcopy
from twisted.internet import reactor

Loading…
Cancel
Save