Skip to content

Commit

Permalink
tests: Remove unused testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalswift committed Nov 7, 2018
1 parent e8d490f commit 590a57f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion test/functional/feature_cltv.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

# Reject codes that we might receive in this test
REJECT_INVALID = 16
REJECT_OBSOLETE = 17
REJECT_NONSTANDARD = 64

def cltv_invalidate(tx):
Expand Down
1 change: 0 additions & 1 deletion test/functional/feature_dersig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

# Reject codes that we might receive in this test
REJECT_INVALID = 16
REJECT_OBSOLETE = 17
REJECT_NONSTANDARD = 64

# A canonical signature consists of:
Expand Down
7 changes: 1 addition & 6 deletions test/functional/test_framework/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
MY_SUBVERSION = b"/python-mininode-tester:0.0.3/"
MY_RELAY = 1 # from version 70001 onwards, fRelay should be appended to version messages (BIP37)

MAX_INV_SZ = 50000
MAX_LOCATOR_SZ = 101
MAX_BLOCK_BASE_SIZE = 1000000

Expand All @@ -58,9 +57,6 @@
def sha256(s):
return hashlib.new('sha256', s).digest()

def ripemd160(s):
return hashlib.new('ripemd160', s).digest()

def hash256(s):
return sha256(sha256(s))

Expand Down Expand Up @@ -887,13 +883,12 @@ def __repr__(self):


class CPartialMerkleTree:
__slots__ = ("fBad", "nTransactions", "vBits", "vHash")
__slots__ = ("nTransactions", "vBits", "vHash")

def __init__(self):
self.nTransactions = 0
self.vHash = []
self.vBits = []
self.fBad = False

def deserialize(self, f):
self.nTransactions = struct.unpack("<i", f.read(4))[0]
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_framework/mininode.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def on_ping(self, message):
self.send_message(msg_pong(message.nonce))

def on_verack(self, message):
self.verack_received = True
pass

def on_version(self, message):
assert message.nVersion >= MIN_VERSION_SUPPORTED, "Version {} received. Test framework only supports versions greater than {}".format(message.nVersion, MIN_VERSION_SUPPORTED)
Expand Down
7 changes: 3 additions & 4 deletions test/functional/test_framework/socks5.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ def __repr__(self):
return 'Socks5Command(%s,%s,%s,%s,%s,%s)' % (self.cmd, self.atyp, self.addr, self.port, self.username, self.password)

class Socks5Connection():
def __init__(self, serv, conn, peer):
def __init__(self, serv, conn):
self.serv = serv
self.conn = conn
self.peer = peer

def handle(self):
"""Handle socks5 request according to RFC192."""
Expand Down Expand Up @@ -137,9 +136,9 @@ def __init__(self, conf):

def run(self):
while self.running:
(sockconn, peer) = self.s.accept()
(sockconn, _) = self.s.accept()
if self.running:
conn = Socks5Connection(self, sockconn, peer)
conn = Socks5Connection(self, sockconn)
thread = threading.Thread(None, conn.handle)
thread.daemon = True
thread.start()
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def _get_uncovered_rpc_commands(self):
with open(coverage_ref_filename, 'r', encoding="utf8") as coverage_ref_file:
all_cmds.update([line.strip() for line in coverage_ref_file.readlines()])

for root, dirs, files in os.walk(self.dir):
for root, _, files in os.walk(self.dir):
for filename in files:
if filename.startswith(coverage_file_prefix):
coverage_filenames.add(os.path.join(root, filename))
Expand Down

0 comments on commit 590a57f

Please sign in to comment.