mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Apply code review suggestions #2647
This commit is contained in:
parent
501227deef
commit
071035b93a
@ -50,7 +50,7 @@ class BIP68Test(BitcoinTestFramework):
|
||||
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")
|
||||
|
@ -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
|
||||
|
||||
@ -392,7 +391,7 @@ 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')
|
||||
@ -400,9 +399,9 @@ def assert_start_raises_init_error(i, dirname, extra_args=None, expected_msg=Non
|
||||
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):
|
||||
|
5
qa/rpc-tests/wallet-hd.py
Normal file → Executable file
5
qa/rpc-tests/wallet-hd.py
Normal file → Executable file
@ -13,9 +13,10 @@ class WalletHDTest(BitcoinTestFramework):
|
||||
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
|
||||
@ -27,7 +28,7 @@ class WalletHDTest(BitcoinTestFramework):
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user