diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-09-17 14:00:41 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-09-17 14:00:47 -0400 |
commit | 4901c00792c1dabae4bb01e6373c9b1ed9ef3008 (patch) | |
tree | 55e00ff28fd4dc73dd2adc9c9d745d9845b619c4 /test/functional/feature_versionbits_warning.py | |
parent | 2d4749b366c4cae3da19017d6658f11349634303 (diff) | |
parent | 0ca4c8b3c61984e9e2ab5a2a9a7c47faf139d1fc (diff) | |
download | bitcoin-4901c00792c1dabae4bb01e6373c9b1ed9ef3008.tar.xz |
Merge #14236: qa: generate --> generatetoaddress change to allow tests run without wallet
0ca4c8b3c6 Changed functional tests which do not require wallets to run without (sanket1729)
Pull request description:
Addresses #14216 . Changed Changed `get_deterministic_priv_key()` to return named tuple`(address, key)`
I have tried to be exhaustive as possible in maximum coverage for non-wallet mode without affecting any coverage for wallet mode.
However, I could not check the tests in wallet mode because of timeout issues. Hopefully, travis job checks those.
Tests `feature_block.py`, `feature_logging.py` and `feature_reindex.py` were skipping despite having no direct dependency on any wallet functions. So, I have also disabled the `skip_test_no_wallet()` for those files too.
Tree-SHA512: 8f84bd8400a732d4266c7518d5cbcf1eb761f623a64a74849e0470142c8ef22cb75364474ddae75d9213c3d16659a52917b5ed979a313695da6abd16c4fd7445
Diffstat (limited to 'test/functional/feature_versionbits_warning.py')
-rwxr-xr-x | test/functional/feature_versionbits_warning.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/functional/feature_versionbits_warning.py b/test/functional/feature_versionbits_warning.py index cf77720437..88df61cabc 100755 --- a/test/functional/feature_versionbits_warning.py +++ b/test/functional/feature_versionbits_warning.py @@ -31,9 +31,6 @@ class VersionBitsWarningTest(BitcoinTestFramework): self.setup_clean_chain = True self.num_nodes = 1 - def skip_test_if_missing_module(self): - self.skip_if_no_wallet() - def setup_network(self): self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt") # Open and close to create zero-length file @@ -68,13 +65,14 @@ class VersionBitsWarningTest(BitcoinTestFramework): node = self.nodes[0] node.add_p2p_connection(P2PInterface()) + node_deterministic_address = node.get_deterministic_priv_key().address # Mine one period worth of blocks - node.generate(VB_PERIOD) + node.generatetoaddress(VB_PERIOD, node_deterministic_address) self.log.info("Check that there is no warning if previous VB_BLOCKS have <VB_THRESHOLD blocks with unknown versionbits version.") # Build one period of blocks with < VB_THRESHOLD blocks signaling some unknown bit self.send_blocks_with_version(node.p2p, VB_THRESHOLD - 1, VB_UNKNOWN_VERSION) - node.generate(VB_PERIOD - VB_THRESHOLD + 1) + node.generatetoaddress(VB_PERIOD - VB_THRESHOLD + 1, node_deterministic_address) # Check that we're not getting any versionbit-related errors in get*info() assert(not VB_PATTERN.match(node.getmininginfo()["warnings"])) @@ -83,7 +81,7 @@ class VersionBitsWarningTest(BitcoinTestFramework): self.log.info("Check that there is a warning if >50 blocks in the last 100 were an unknown version") # Build one period of blocks with VB_THRESHOLD blocks signaling some unknown bit self.send_blocks_with_version(node.p2p, VB_THRESHOLD, VB_UNKNOWN_VERSION) - node.generate(VB_PERIOD - VB_THRESHOLD) + node.generatetoaddress(VB_PERIOD - VB_THRESHOLD, node_deterministic_address) # Check that get*info() shows the 51/100 unknown block version error. assert(WARN_UNKNOWN_RULES_MINED in node.getmininginfo()["warnings"]) @@ -92,16 +90,16 @@ class VersionBitsWarningTest(BitcoinTestFramework): self.log.info("Check that there is a warning if previous VB_BLOCKS have >=VB_THRESHOLD blocks with unknown versionbits version.") # Mine a period worth of expected blocks so the generic block-version warning # is cleared. This will move the versionbit state to ACTIVE. - node.generate(VB_PERIOD) + node.generatetoaddress(VB_PERIOD, node_deterministic_address) # Stop-start the node. This is required because bitcoind will only warn once about unknown versions or unknown rules activating. self.restart_node(0) # Generating one block guarantees that we'll get out of IBD - node.generate(1) + node.generatetoaddress(1, node_deterministic_address) wait_until(lambda: not node.getblockchaininfo()['initialblockdownload'], timeout=10, lock=mininode_lock) # Generating one more block will be enough to generate an error. - node.generate(1) + node.generatetoaddress(1, node_deterministic_address) # Check that get*info() shows the versionbits unknown rules warning assert(WARN_UNKNOWN_RULES_ACTIVE in node.getmininginfo()["warnings"]) assert(WARN_UNKNOWN_RULES_ACTIVE in node.getnetworkinfo()["warnings"]) |