Skip to content

Commit

Permalink
Apply code review suggestions #2647
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Feb 1, 2019
1 parent 501227d commit 071035b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion qa/rpc-tests/bip68-sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_test(self):
self.activateCSV()

print("Verifying nVersion=2 transactions are standard.")
print("Note that with current versions of bitcoin software, nVersion=2 transactions are always standard (independent of BIP68 activation status).")
print("Note that with current versions of Dash Core software, nVersion=2 transactions are always standard (independent of BIP68 activation status).")
self.test_version2_relay()

print("Passed\n")
Expand Down
7 changes: 3 additions & 4 deletions qa/rpc-tests/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=

# Allow to redirect stderr to stdout in case we expect some non-critical warnings/errors printed to stderr
# Otherwise the whole test would be considered to be failed in such cases
stderr = None
if redirect_stderr:
stderr = sys.stdout

Expand All @@ -392,17 +391,17 @@ def assert_start_raises_init_error(i, dirname, extra_args=None, expected_msg=Non
node = start_node(i, dirname, extra_args, stderr=log_stderr)
stop_node(node, i)
except Exception as e:
assert 'bitcoind exited' in str(e) #node must have shutdown
assert 'dashd exited' in str(e) #node must have shutdown
if expected_msg is not None:
log_stderr.seek(0)
stderr = log_stderr.read().decode('utf-8')
if expected_msg not in stderr:
raise AssertionError("Expected error \"" + expected_msg + "\" not found in:\n" + stderr)
else:
if expected_msg is None:
assert_msg = "bitcoind should have exited with an error"
assert_msg = "dashd should have exited with an error"
else:
assert_msg = "bitcoind should have exited with expected error " + expected_msg
assert_msg = "dashd should have exited with expected error " + expected_msg
raise AssertionError(assert_msg)

def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, timewait=None, binary=None, redirect_stderr=False):
Expand Down
5 changes: 3 additions & 2 deletions qa/rpc-tests/wallet-hd.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 2
self.node_args = [['-usehd=0'], ['-usehd=1', '-keypool=0']]

def setup_network(self):
self.nodes = start_nodes(2, self.options.tmpdir, [['-usehd=0'], ['-usehd=1', '-keypool=0']], redirect_stderr=True)
self.nodes = start_nodes(2, self.options.tmpdir, self.node_args, redirect_stderr=True)
self.is_network_split = False
connect_nodes_bi(self.nodes, 0, 1)
self.is_network_split=False
Expand All @@ -27,7 +28,7 @@ def run_test (self):
# Make sure can't switch off usehd after wallet creation
self.stop_node(1)
assert_start_raises_init_error(1, self.options.tmpdir, ['-usehd=0'], 'already existing HD wallet')
self.nodes[1] = start_node(1, self.options.tmpdir, self.node_args[1])
self.nodes[1] = start_node(1, self.options.tmpdir, self.node_args[1], redirect_stderr=True)
connect_nodes_bi(self.nodes, 0, 1)

# Make sure we use hd, keep chainid
Expand Down

0 comments on commit 071035b

Please sign in to comment.