Browse Source

Remove unused imports

master
Kristaps Kaupe 5 years ago
parent
commit
fde23c3cc5
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.
"""
import struct
from jmbase import hextobin, bintohex
from jmbase import hextobin
from bitcointx.core import CBitcoinTransaction
from bitcointx.core.serialize import VarIntSerializer, VarBytesSerializer
from bitcointx.core.serialize import VarIntSerializer
def decode_varint(data):
n, tail = VarIntSerializer.deserialize_partial(data)

1
jmbitcoin/jmbitcoin/secp256k1_transaction.py

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

3
jmbitcoin/test/test_tx_signing.py

@ -2,7 +2,6 @@
import pytest
import binascii
import hashlib
from jmbase import bintohex
import jmbitcoin as btc
@ -90,4 +89,4 @@ def test_bip143_tv():
tx = btc.CMutableTransaction.deserialize(btc.x(rawtx_hex))
btc.sign(tx, 0, btc.x(privkey_hex), amount=btc.coins_to_satoshi(10), native=False)
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,
get_nontor_agent, BytesProducer, wrapped_urlparse,
bintohex, bdict_sdict_convert, JMHTTPResource)
bdict_sdict_convert, JMHTTPResource)
from jmbase.commands import *
from twisted.protocols import amp
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 os
import json
import binascii
from pprint import pformat
from optparse import OptionParser
from jmclient import load_program_config, jm_single,\
open_wallet, WalletService, add_external_commitments, update_commitments,\
PoDLE, get_podle_commitments, get_utxo_info, validate_utxo_data, quit,\
get_wallet_path, add_base_options, BTCEngine, BTC_P2SH_P2WPKH
from jmbase.support import EXIT_SUCCESS, EXIT_FAILURE, EXIT_ARGERROR, \
jmprint, utxostr_to_utxo
get_wallet_path, add_base_options, BTCEngine
from jmbase.support import EXIT_SUCCESS, EXIT_FAILURE, \
jmprint
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.support import DUST_THRESHOLD, EXIT_FAILURE, utxo_to_utxostr,\
bintohex, hextobin, JM_CORE_VERSION
hextobin, JM_CORE_VERSION
import jmbitcoin as btc
from jmclient import load_program_config, get_network, update_persist_config,\
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,\
NO_ROUNDING, get_max_cj_fee_values, get_default_max_absolute_fee, \
get_default_max_relative_fee, RetryableStorageError, add_base_options, \
BTCEngine, BTC_P2SH_P2WPKH, FidelityBondMixin, wallet_change_passphrase, \
parse_payjoin_setup, send_payjoin, JMBIP78ReceiverManager, \
BIP78ClientProtocolFactory
BTCEngine, FidelityBondMixin, wallet_change_passphrase, \
parse_payjoin_setup, send_payjoin, JMBIP78ReceiverManager
from qtsupport import ScheduleWizard, TumbleRestartWizard, config_tips,\
config_types, QtHandler, XStream, Buttons, OkButton, CancelButton,\
PasswordDialog, MyTreeWidget, JMQtMessageBox, BLUE_FG,\

3
scripts/receive-payjoin.py

@ -3,9 +3,8 @@
from optparse import OptionParser
import sys
from twisted.python.log import startLogging
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, \
WalletService, open_test_wallet_maybe, get_wallet_path, check_regtest, \
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, \
parse_payjoin_setup, send_payjoin
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
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).
"""
from pprint import pformat
from optparse import OptionParser
import jmbitcoin as btc
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
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
import jmbitcoin as btc
from jmclient import (RegtestBitcoinCoreInterface, process_shutdown,
jm_single, load_program_config, check_regtest, select_one_utxo,
estimate_tx_fee, SNICKERReceiver, add_base_options, get_wallet_path,
from jmclient import (process_shutdown,
jm_single, load_program_config, check_regtest,
estimate_tx_fee, add_base_options, get_wallet_path,
open_test_wallet_maybe, WalletService, SNICKERClientProtocolFactory,
start_reactor, JMPluginService)
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 jmbase import bintohex, EXIT_ARGERROR, EXIT_FAILURE, jmprint
from jmbase import bintohex, EXIT_ARGERROR, jmprint
import jmbitcoin as btc
from jmclient import (jm_single, add_base_options, load_program_config,
check_regtest)

4
scripts/snicker/snicker-recovery.py

@ -25,9 +25,9 @@ or at least, the imported keys themselves.)
"""
from optparse import OptionParser
from jmbase import bintohex, EXIT_ARGERROR, EXIT_FAILURE, jmprint
from jmbase import bintohex, EXIT_ARGERROR, jmprint
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,
WalletService)
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 random
from optparse import OptionParser
from jmbase import BytesProducer, bintohex, jmprint, hextobin, \
EXIT_ARGERROR, EXIT_FAILURE, EXIT_SUCCESS
from jmbase import bintohex, jmprint, EXIT_ARGERROR, EXIT_FAILURE
import jmbitcoin as btc
from jmclient import (RegtestBitcoinCoreInterface, process_shutdown,
jm_single, load_program_config, check_regtest, select_one_utxo,
estimate_tx_fee, SNICKERReceiver, add_base_options, get_wallet_path,
open_test_wallet_maybe, WalletService, SNICKERClientProtocolFactory,
start_reactor, JMPluginService)
from jmclient import (jm_single, load_program_config, check_regtest,
estimate_tx_fee, add_base_options, get_wallet_path,
open_test_wallet_maybe, WalletService, JMPluginService)
from jmclient.support import select_greedy, NotEnoughFundsException
from jmclient.configure import get_log

3
scripts/snicker/snicker-server.py

@ -33,9 +33,8 @@ import base64
import json
import sqlite3
import threading
import hashlib
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.configure import get_log

1
scripts/yg-privacyenhanced.py

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

4
test/payjoinserver.py

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

Loading…
Cancel
Save