diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-03-23 11:36:45 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-03-23 11:37:21 +0100 |
commit | dfef6b6af08097f0676a2323085558fbbd3c48c6 (patch) | |
tree | d4fdd410a626f441e610522957eef07d5608abe5 | |
parent | 3568b30ca31d5fdc67a188eb60b486cf0b550fb1 (diff) | |
parent | 389745901a79567e34fe30df99b77720ef0f686d (diff) |
Merge #10047: [tests] Remove unused variables and imports
3897459 [tests] Remove unused variables (practicalswift)
72163d4 [tests] Remove unused and duplicate imports (practicalswift)
Tree-SHA512: 926af14b844bfca3bdd08b3cfdcb0edd3652efb4612d5571fee9abb917a6ce4e7d11d3601ff9c3d017e943ebe1e9ebdfccaf0af3db84d201b61941e9c1c9146a
-rwxr-xr-x | contrib/testgen/gen_base58_test_vectors.py | 2 | ||||
-rwxr-xr-x | test/functional/bip68-sequence.py | 4 | ||||
-rwxr-xr-x | test/functional/fundrawtransaction.py | 1 | ||||
-rwxr-xr-x | test/functional/import-rescan.py | 1 | ||||
-rwxr-xr-x | test/functional/multi_rpc.py | 2 | ||||
-rwxr-xr-x | test/functional/rawtransactions.py | 1 | ||||
-rwxr-xr-x | test/functional/segwit.py | 5 | ||||
-rwxr-xr-x | test/functional/smartfees.py | 3 | ||||
-rw-r--r-- | test/functional/test_framework/socks5.py | 1 | ||||
-rwxr-xr-x | test/functional/test_framework/test_framework.py | 1 | ||||
-rwxr-xr-x | test/functional/zmq_test.py | 1 |
11 files changed, 6 insertions, 16 deletions
diff --git a/contrib/testgen/gen_base58_test_vectors.py b/contrib/testgen/gen_base58_test_vectors.py index ac0701e6be..86366eb8e3 100755 --- a/contrib/testgen/gen_base58_test_vectors.py +++ b/contrib/testgen/gen_base58_test_vectors.py @@ -13,7 +13,7 @@ Usage: # Released under MIT License import os from itertools import islice -from base58 import b58encode, b58decode, b58encode_chk, b58decode_chk, b58chars +from base58 import b58encode_chk, b58decode_chk, b58chars import random from binascii import b2a_hex diff --git a/test/functional/bip68-sequence.py b/test/functional/bip68-sequence.py index 3ed6ebe044..89d42a710c 100755 --- a/test/functional/bip68-sequence.py +++ b/test/functional/bip68-sequence.py @@ -378,8 +378,8 @@ class BIP68Test(BitcoinTestFramework): # activation should happen at block height 432 (3 periods) min_activation_height = 432 height = self.nodes[0].getblockcount() - assert(height < 432) - self.nodes[0].generate(432-height) + assert(height < min_activation_height) + self.nodes[0].generate(min_activation_height-height) assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active') sync_blocks(self.nodes) diff --git a/test/functional/fundrawtransaction.py b/test/functional/fundrawtransaction.py index fd330ef277..1dc00f2ba1 100755 --- a/test/functional/fundrawtransaction.py +++ b/test/functional/fundrawtransaction.py @@ -691,7 +691,6 @@ class RawTransactionsTest(BitcoinTestFramework): inputs = [] outputs = {self.nodes[2].getnewaddress(): value for value in (1.0, 1.1, 1.2, 1.3)} - keys = list(outputs.keys()) rawtx = self.nodes[3].createrawtransaction(inputs, outputs) result = [self.nodes[3].fundrawtransaction(rawtx), diff --git a/test/functional/import-rescan.py b/test/functional/import-rescan.py index 0218a46168..5be095e62d 100755 --- a/test/functional/import-rescan.py +++ b/test/functional/import-rescan.py @@ -22,7 +22,6 @@ happened previously. from test_framework.authproxy import JSONRPCException from test_framework.test_framework import BitcoinTestFramework from test_framework.util import (start_nodes, connect_nodes, sync_blocks, assert_equal, set_node_times) -from decimal import Decimal import collections import enum diff --git a/test/functional/multi_rpc.py b/test/functional/multi_rpc.py index 3b74bf1c46..a9701c548b 100755 --- a/test/functional/multi_rpc.py +++ b/test/functional/multi_rpc.py @@ -41,11 +41,9 @@ class HTTPBasicsTest (BitcoinTestFramework): authpair = url.username + ':' + url.password #New authpair generated via share/rpcuser tool - rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144" password = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM=" #Second authpair with different username - rpcauth2 = "rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e" password2 = "8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI=" authpairnew = "rt:"+password diff --git a/test/functional/rawtransactions.py b/test/functional/rawtransactions.py index 0374d8984a..d4c684136c 100755 --- a/test/functional/rawtransactions.py +++ b/test/functional/rawtransactions.py @@ -104,7 +104,6 @@ class RawTransactionsTest(BitcoinTestFramework): txId = self.nodes[0].sendtoaddress(mSigObj, 2.2) decTx = self.nodes[0].gettransaction(txId) rawTx = self.nodes[0].decoderawtransaction(decTx['hex']) - sPK = rawTx['vout'][0]['scriptPubKey']['hex'] self.sync_all() self.nodes[0].generate(1) self.sync_all() diff --git a/test/functional/segwit.py b/test/functional/segwit.py index 5b1fba8eec..a1fffcb81a 100755 --- a/test/functional/segwit.py +++ b/test/functional/segwit.py @@ -6,11 +6,10 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -from test_framework.mininode import sha256, ripemd160, CTransaction, CTxIn, COutPoint, CTxOut, COIN +from test_framework.mininode import sha256, CTransaction, CTxIn, COutPoint, CTxOut, COIN, ToHex, FromHex from test_framework.address import script_to_p2sh, key_to_p2pkh -from test_framework.script import CScript, OP_HASH160, OP_CHECKSIG, OP_0, hash160, OP_EQUAL, OP_DUP, OP_EQUALVERIFY, OP_1, OP_2, OP_CHECKMULTISIG, hash160, OP_TRUE +from test_framework.script import CScript, OP_HASH160, OP_CHECKSIG, OP_0, hash160, OP_EQUAL, OP_DUP, OP_EQUALVERIFY, OP_1, OP_2, OP_CHECKMULTISIG, OP_TRUE from io import BytesIO -from test_framework.mininode import ToHex, FromHex, COIN NODE_0 = 0 NODE_1 = 1 diff --git a/test/functional/smartfees.py b/test/functional/smartfees.py index 49f2df5c37..b7f4b86e7b 100755 --- a/test/functional/smartfees.py +++ b/test/functional/smartfees.py @@ -4,11 +4,10 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test fee estimation code.""" -from collections import OrderedDict from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import CScript, OP_1, OP_DROP, OP_2, OP_HASH160, OP_EQUAL, hash160, OP_TRUE -from test_framework.mininode import CTransaction, CTxIn, CTxOut, COutPoint, ToHex, FromHex, COIN +from test_framework.mininode import CTransaction, CTxIn, CTxOut, COutPoint, ToHex, COIN # Construct 2 trivial P2SH's and the ScriptSigs that spend them # So we can create many many transactions without needing to spend diff --git a/test/functional/test_framework/socks5.py b/test/functional/test_framework/socks5.py index dd7624d454..a08b03ed24 100644 --- a/test/functional/test_framework/socks5.py +++ b/test/functional/test_framework/socks5.py @@ -5,7 +5,6 @@ """Dummy Socks5 server for testing.""" import socket, threading, queue -import traceback, sys import logging logger = logging.getLogger("TestFramework.socks5") diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index fd2e803541..8656a1ca6a 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -11,7 +11,6 @@ import sys import shutil import tempfile import time -import traceback from .util import ( initialize_chain, diff --git a/test/functional/zmq_test.py b/test/functional/zmq_test.py index e6f18b0b93..9e27b46381 100755 --- a/test/functional/zmq_test.py +++ b/test/functional/zmq_test.py @@ -41,7 +41,6 @@ class ZMQTest (BitcoinTestFramework): topic = msg[0] assert_equal(topic, b"hashtx") body = msg[1] - nseq = msg[2] msgSequence = struct.unpack('<I', msg[-1])[-1] assert_equal(msgSequence, 0) #must be sequence 0 on hashtx |