Browse Source

Merge #852: Remove unused imports

fde23c3cc5 Remove unused imports (Kristaps Kaupe)

Pull request description:

  [Module imported but unused (F401)](https://www.flake8rules.com/rules/F401.html)
  ```
  $ flake8 --select=F401 $(git ls-files "*.py")
  ```

Top commit has no ACKs.

Tree-SHA512: 14cc06e521f533e194143ad0e553adb3646651b35633af90eb10fcb9f168bd1ca0bf890fa21ab1d89f01b12fc02aa77b4b2c1341186c127ad4a2df46f041cccd
master
Kristaps Kaupe 5 years ago
parent
commit
967a5bd0ae
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 5
      jmbitcoin/jmbitcoin/blocks.py
  2. 1
      jmbitcoin/jmbitcoin/secp256k1_transaction.py
  3. 3
      jmbitcoin/test/test_tx_signing.py
  4. 2
      jmdaemon/jmdaemon/daemon_protocol.py
  5. 7
      scripts/add-utxo.py
  6. 7
      scripts/joinmarket-qt.py
  7. 3
      scripts/receive-payjoin.py
  8. 2
      scripts/sendpayment.py
  9. 1
      scripts/sendtomany.py
  10. 8
      scripts/snicker/create-snicker-proposal.py
  11. 2
      scripts/snicker/snicker-finder.py
  12. 4
      scripts/snicker/snicker-recovery.py
  13. 11
      scripts/snicker/snicker-seed-tx.py
  14. 3
      scripts/snicker/snicker-server.py
  15. 1
      scripts/yg-privacyenhanced.py
  16. 4
      test/payjoinserver.py

5
jmbitcoin/jmbitcoin/blocks.py

@ -3,10 +3,9 @@ Module implementing actions that can be taken on
network-serialized bitcoin blocks. network-serialized bitcoin blocks.
""" """
import struct from jmbase import hextobin
from jmbase import hextobin, bintohex
from bitcointx.core import CBitcoinTransaction from bitcointx.core import CBitcoinTransaction
from bitcointx.core.serialize import VarIntSerializer, VarBytesSerializer from bitcointx.core.serialize import VarIntSerializer
def decode_varint(data): def decode_varint(data):
n, tail = VarIntSerializer.deserialize_partial(data) n, tail = VarIntSerializer.deserialize_partial(data)

1
jmbitcoin/jmbitcoin/secp256k1_transaction.py

@ -3,7 +3,6 @@
# note, only used for non-cryptographic randomness: # note, only used for non-cryptographic randomness:
import random import random
import json import json
import itertools
# needed for single sha256 evaluation, which is used # needed for single sha256 evaluation, which is used
# in bitcoin (p2wsh) but not exposed in python-bitcointx: # in bitcoin (p2wsh) but not exposed in python-bitcointx:
import hashlib import hashlib

3
jmbitcoin/test/test_tx_signing.py

@ -2,7 +2,6 @@
import pytest import pytest
import binascii
import hashlib import hashlib
from jmbase import bintohex from jmbase import bintohex
import jmbitcoin as btc import jmbitcoin as btc
@ -90,4 +89,4 @@ def test_bip143_tv():
tx = btc.CMutableTransaction.deserialize(btc.x(rawtx_hex)) tx = btc.CMutableTransaction.deserialize(btc.x(rawtx_hex))
btc.sign(tx, 0, btc.x(privkey_hex), amount=btc.coins_to_satoshi(10), native=False) btc.sign(tx, 0, btc.x(privkey_hex), amount=btc.coins_to_satoshi(10), native=False)
expectedsignedtx = "01000000000101db6b1b20aa0fd7b23880be2ecbd4a98130974cf4748fb66092ac4d3ceb1a5477010000001716001479091972186c449eb1ded22b78e40d009bdf0089feffffff02b8b4eb0b000000001976a914a457b684d7f0d539a46a45bbc043f35b59d0d96388ac0008af2f000000001976a914fd270b1ee6abcaea97fea7ad0402e8bd8ad6d77c88ac02473044022047ac8e878352d3ebbde1c94ce3a10d057c24175747116f8288e5d794d12d482f0220217f36a485cae903c713331d877c1f64677e3622ad4010726870540656fe9dcb012103ad1d8e89212f0b92c74d23bb710c00662ad1470198ac48c43f7d6f93a2a2687392040000" expectedsignedtx = "01000000000101db6b1b20aa0fd7b23880be2ecbd4a98130974cf4748fb66092ac4d3ceb1a5477010000001716001479091972186c449eb1ded22b78e40d009bdf0089feffffff02b8b4eb0b000000001976a914a457b684d7f0d539a46a45bbc043f35b59d0d96388ac0008af2f000000001976a914fd270b1ee6abcaea97fea7ad0402e8bd8ad6d77c88ac02473044022047ac8e878352d3ebbde1c94ce3a10d057c24175747116f8288e5d794d12d482f0220217f36a485cae903c713331d877c1f64677e3622ad4010726870540656fe9dcb012103ad1d8e89212f0b92c74d23bb710c00662ad1470198ac48c43f7d6f93a2a2687392040000"
assert btc.b2x(tx.serialize()) == expectedsignedtx assert btc.b2x(tx.serialize()) == expectedsignedtx

2
jmdaemon/jmdaemon/daemon_protocol.py

@ -11,7 +11,7 @@ from .irc import IRCMessageChannel
from jmbase import (hextobin, is_hs_uri, get_tor_agent, JMHiddenService, from jmbase import (hextobin, is_hs_uri, get_tor_agent, JMHiddenService,
get_nontor_agent, BytesProducer, wrapped_urlparse, get_nontor_agent, BytesProducer, wrapped_urlparse,
bintohex, bdict_sdict_convert, JMHTTPResource) bdict_sdict_convert, JMHTTPResource)
from jmbase.commands import * from jmbase.commands import *
from twisted.protocols import amp from twisted.protocols import amp
from twisted.internet import reactor, ssl, task from twisted.internet import reactor, ssl, task

7
scripts/add-utxo.py

@ -9,16 +9,15 @@ the anti-snooping feature employed by makers.
import sys import sys
import os import os
import json import json
import binascii
from pprint import pformat from pprint import pformat
from optparse import OptionParser from optparse import OptionParser
from jmclient import load_program_config, jm_single,\ from jmclient import load_program_config, jm_single,\
open_wallet, WalletService, add_external_commitments, update_commitments,\ open_wallet, WalletService, add_external_commitments, update_commitments,\
PoDLE, get_podle_commitments, get_utxo_info, validate_utxo_data, quit,\ PoDLE, get_podle_commitments, get_utxo_info, validate_utxo_data, quit,\
get_wallet_path, add_base_options, BTCEngine, BTC_P2SH_P2WPKH get_wallet_path, add_base_options, BTCEngine
from jmbase.support import EXIT_SUCCESS, EXIT_FAILURE, EXIT_ARGERROR, \ from jmbase.support import EXIT_SUCCESS, EXIT_FAILURE, \
jmprint, utxostr_to_utxo jmprint
def add_ext_commitments(utxo_datas): def add_ext_commitments(utxo_datas):

7
scripts/joinmarket-qt.py

@ -60,7 +60,7 @@ JM_GUI_VERSION = '21dev'
from jmbase import get_log, stop_reactor from jmbase import get_log, stop_reactor
from jmbase.support import DUST_THRESHOLD, EXIT_FAILURE, utxo_to_utxostr,\ from jmbase.support import DUST_THRESHOLD, EXIT_FAILURE, utxo_to_utxostr,\
bintohex, hextobin, JM_CORE_VERSION hextobin, JM_CORE_VERSION
import jmbitcoin as btc import jmbitcoin as btc
from jmclient import load_program_config, get_network, update_persist_config,\ from jmclient import load_program_config, get_network, update_persist_config,\
open_test_wallet_maybe, get_wallet_path,\ open_test_wallet_maybe, get_wallet_path,\
@ -72,9 +72,8 @@ from jmclient import load_program_config, get_network, update_persist_config,\
wallet_generate_recover_bip39, wallet_display, get_utxos_enabled_disabled,\ wallet_generate_recover_bip39, wallet_display, get_utxos_enabled_disabled,\
NO_ROUNDING, get_max_cj_fee_values, get_default_max_absolute_fee, \ NO_ROUNDING, get_max_cj_fee_values, get_default_max_absolute_fee, \
get_default_max_relative_fee, RetryableStorageError, add_base_options, \ get_default_max_relative_fee, RetryableStorageError, add_base_options, \
BTCEngine, BTC_P2SH_P2WPKH, FidelityBondMixin, wallet_change_passphrase, \ BTCEngine, FidelityBondMixin, wallet_change_passphrase, \
parse_payjoin_setup, send_payjoin, JMBIP78ReceiverManager, \ parse_payjoin_setup, send_payjoin, JMBIP78ReceiverManager
BIP78ClientProtocolFactory
from qtsupport import ScheduleWizard, TumbleRestartWizard, config_tips,\ from qtsupport import ScheduleWizard, TumbleRestartWizard, config_tips,\
config_types, QtHandler, XStream, Buttons, OkButton, CancelButton,\ config_types, QtHandler, XStream, Buttons, OkButton, CancelButton,\
PasswordDialog, MyTreeWidget, JMQtMessageBox, BLUE_FG,\ PasswordDialog, MyTreeWidget, JMQtMessageBox, BLUE_FG,\

3
scripts/receive-payjoin.py

@ -3,9 +3,8 @@
from optparse import OptionParser from optparse import OptionParser
import sys import sys
from twisted.python.log import startLogging
from twisted.internet import reactor from twisted.internet import reactor
from jmbase import get_log, set_logging_level, jmprint from jmbase import get_log, jmprint
from jmclient import jm_single, load_program_config, \ from jmclient import jm_single, load_program_config, \
WalletService, open_test_wallet_maybe, get_wallet_path, check_regtest, \ WalletService, open_test_wallet_maybe, get_wallet_path, check_regtest, \
add_base_options, JMBIP78ReceiverManager, start_reactor add_base_options, JMBIP78ReceiverManager, start_reactor

2
scripts/sendpayment.py

@ -18,7 +18,7 @@ from jmclient import Taker, load_program_config, get_schedule,\
get_sendpayment_parser, get_max_cj_fee_values, check_regtest, \ get_sendpayment_parser, get_max_cj_fee_values, check_regtest, \
parse_payjoin_setup, send_payjoin parse_payjoin_setup, send_payjoin
from twisted.python.log import startLogging from twisted.python.log import startLogging
from jmbase.support import get_log, set_logging_level, jmprint, \ from jmbase.support import get_log, jmprint, \
EXIT_FAILURE, EXIT_ARGERROR, DUST_THRESHOLD EXIT_FAILURE, EXIT_ARGERROR, DUST_THRESHOLD
import jmbitcoin as btc import jmbitcoin as btc

1
scripts/sendtomany.py

@ -5,7 +5,6 @@ for a Joinmarket user, although of course it may be useful
for other reasons). for other reasons).
""" """
from pprint import pformat
from optparse import OptionParser from optparse import OptionParser
import jmbitcoin as btc import jmbitcoin as btc
from jmbase import (get_log, jmprint, bintohex, utxostr_to_utxo, from jmbase import (get_log, jmprint, bintohex, utxostr_to_utxo,

8
scripts/snicker/create-snicker-proposal.py

@ -23,12 +23,12 @@ output to stdout in the same string format: base64proposal,hexpubkey.
import sys import sys
from optparse import OptionParser from optparse import OptionParser
from jmbase import BytesProducer, bintohex, jmprint, hextobin, \ from jmbase import bintohex, jmprint, hextobin, \
EXIT_ARGERROR, EXIT_FAILURE, EXIT_SUCCESS, get_pow EXIT_ARGERROR, EXIT_FAILURE, EXIT_SUCCESS, get_pow
import jmbitcoin as btc import jmbitcoin as btc
from jmclient import (RegtestBitcoinCoreInterface, process_shutdown, from jmclient import (process_shutdown,
jm_single, load_program_config, check_regtest, select_one_utxo, jm_single, load_program_config, check_regtest,
estimate_tx_fee, SNICKERReceiver, add_base_options, get_wallet_path, estimate_tx_fee, add_base_options, get_wallet_path,
open_test_wallet_maybe, WalletService, SNICKERClientProtocolFactory, open_test_wallet_maybe, WalletService, SNICKERClientProtocolFactory,
start_reactor, JMPluginService) start_reactor, JMPluginService)
from jmclient.configure import get_log from jmclient.configure import get_log

2
scripts/snicker/snicker-finder.py

@ -25,7 +25,7 @@ parses the raw blocks.
""" """
from optparse import OptionParser from optparse import OptionParser
from jmbase import bintohex, EXIT_ARGERROR, EXIT_FAILURE, jmprint from jmbase import bintohex, EXIT_ARGERROR, jmprint
import jmbitcoin as btc import jmbitcoin as btc
from jmclient import (jm_single, add_base_options, load_program_config, from jmclient import (jm_single, add_base_options, load_program_config,
check_regtest) check_regtest)

4
scripts/snicker/snicker-recovery.py

@ -25,9 +25,9 @@ or at least, the imported keys themselves.)
""" """
from optparse import OptionParser from optparse import OptionParser
from jmbase import bintohex, EXIT_ARGERROR, EXIT_FAILURE, jmprint from jmbase import bintohex, EXIT_ARGERROR, jmprint
import jmbitcoin as btc import jmbitcoin as btc
from jmclient import (jm_single, add_base_options, load_program_config, from jmclient import (add_base_options, load_program_config,
check_regtest, get_wallet_path, open_test_wallet_maybe, check_regtest, get_wallet_path, open_test_wallet_maybe,
WalletService) WalletService)
from jmclient.configure import get_log from jmclient.configure import get_log

11
scripts/snicker/snicker-seed-tx.py

@ -22,14 +22,11 @@ a *signalling* fake coinjoin, so it is better not to violate the principle.
import sys import sys
import random import random
from optparse import OptionParser from optparse import OptionParser
from jmbase import BytesProducer, bintohex, jmprint, hextobin, \ from jmbase import bintohex, jmprint, EXIT_ARGERROR, EXIT_FAILURE
EXIT_ARGERROR, EXIT_FAILURE, EXIT_SUCCESS
import jmbitcoin as btc import jmbitcoin as btc
from jmclient import (RegtestBitcoinCoreInterface, process_shutdown, from jmclient import (jm_single, load_program_config, check_regtest,
jm_single, load_program_config, check_regtest, select_one_utxo, estimate_tx_fee, add_base_options, get_wallet_path,
estimate_tx_fee, SNICKERReceiver, add_base_options, get_wallet_path, open_test_wallet_maybe, WalletService, JMPluginService)
open_test_wallet_maybe, WalletService, SNICKERClientProtocolFactory,
start_reactor, JMPluginService)
from jmclient.support import select_greedy, NotEnoughFundsException from jmclient.support import select_greedy, NotEnoughFundsException
from jmclient.configure import get_log from jmclient.configure import get_log

3
scripts/snicker/snicker-server.py

@ -33,9 +33,8 @@ import base64
import json import json
import sqlite3 import sqlite3
import threading import threading
import hashlib
from io import BytesIO from io import BytesIO
from jmbase import jmprint, hextobin, bintohex, verify_pow from jmbase import jmprint, hextobin, verify_pow
from jmclient import process_shutdown, jm_single, load_program_config from jmclient import process_shutdown, jm_single, load_program_config
from jmclient.configure import get_log from jmclient.configure import get_log

1
scripts/yg-privacyenhanced.py

@ -4,7 +4,6 @@ from future.utils import iteritems
import random import random
from jmbase import get_log, jmprint from jmbase import get_log, jmprint
from jmbase.support import lookup_appdata_folder
from jmclient import YieldGeneratorBasic, ygmain, jm_single from jmclient import YieldGeneratorBasic, ygmain, jm_single
# This is a maker for the purposes of generating a yield from held bitcoins # This is a maker for the purposes of generating a yield from held bitcoins

4
test/payjoinserver.py

@ -13,13 +13,11 @@
""" """
import os import os
from twisted.web.server import Site from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import ssl from twisted.internet import ssl
from twisted.internet import reactor, endpoints from twisted.internet import reactor
from common import make_wallets from common import make_wallets
import pytest import pytest
from jmbase import jmprint from jmbase import jmprint
import jmbitcoin as btc
from jmclient import load_test_config, jm_single,\ from jmclient import load_test_config, jm_single,\
SegwitWallet, SegwitLegacyWallet, cryptoengine, PayjoinServer SegwitWallet, SegwitLegacyWallet, cryptoengine, PayjoinServer

Loading…
Cancel
Save