diff options
author | merge-script <falke.marco@gmail.com> | 2021-09-25 09:39:42 +0200 |
---|---|---|
committer | merge-script <falke.marco@gmail.com> | 2021-09-25 09:39:42 +0200 |
commit | 16ccb3a1cd9125eb24a5b45a98099ff98660767a (patch) | |
tree | 309e0ee6705f0fe0a16b5e8bf05904b92ff174dd /test | |
parent | 747f91c0a385df19bced69deca4d9da6d6e756b8 (diff) | |
parent | fa4ca8d5797adb9ad6aa0f150a5f187ebfb714c7 (diff) |
Merge bitcoin/bitcoin#23086: test: Add -testactivationheight tests to rpc_blockchain
fa4ca8d5797adb9ad6aa0f150a5f187ebfb714c7 test: Add -testactivationheight tests to rpc_blockchain (MarcoFalke)
Pull request description:
Suggested: https://github.com/bitcoin/bitcoin/pull/22818#discussion_r712513991
ACKs for top commit:
laanwj:
Code review ACK fa4ca8d5797adb9ad6aa0f150a5f187ebfb714c7
theStack:
Concept and code-review ACK fa4ca8d5797adb9ad6aa0f150a5f187ebfb714c7
Tree-SHA512: 41304db1a15c0c705a9cc2808c9f1d7831a321a8a7948a28ec5d3ee1ed3da6a0ce67cd50c99a33aaed86830c59608eb6ffadbeaba67d95245c490f9b6c277912
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/rpc_blockchain.py | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index b8b5c5a519..c3c6ade684 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -127,7 +127,29 @@ class BlockchainTest(BitcoinTestFramework): # should have exact keys assert_equal(sorted(res.keys()), keys) - self.restart_node(0, ['-stopatheight=207', '-prune=550']) + self.stop_node(0) + self.nodes[0].assert_start_raises_init_error( + extra_args=['-testactivationheight=name@2'], + expected_msg='Error: Invalid name (name@2) for -testactivationheight=name@height.', + ) + self.nodes[0].assert_start_raises_init_error( + extra_args=['-testactivationheight=bip34@-2'], + expected_msg='Error: Invalid height value (bip34@-2) for -testactivationheight=name@height.', + ) + self.nodes[0].assert_start_raises_init_error( + extra_args=['-testactivationheight='], + expected_msg='Error: Invalid format () for -testactivationheight=name@height.', + ) + self.start_node(0, extra_args=[ + '-stopatheight=207', + '-prune=550', + '-testactivationheight=bip34@2', + '-testactivationheight=dersig@3', + '-testactivationheight=cltv@4', + '-testactivationheight=csv@5', + '-testactivationheight=segwit@6', + ]) + res = self.nodes[0].getblockchaininfo() # result should have these additional pruning keys if prune=550 assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys)) @@ -140,11 +162,11 @@ class BlockchainTest(BitcoinTestFramework): assert_greater_than(res['size_on_disk'], 0) assert_equal(res['softforks'], { - 'bip34': {'type': 'buried', 'active': True, 'height': 1}, - 'bip66': {'type': 'buried', 'active': True, 'height': 1}, - 'bip65': {'type': 'buried', 'active': True, 'height': 1}, - 'csv': {'type': 'buried', 'active': True, 'height': 1}, - 'segwit': {'type': 'buried', 'active': True, 'height': 1}, + 'bip34': {'type': 'buried', 'active': True, 'height': 2}, + 'bip66': {'type': 'buried', 'active': True, 'height': 3}, + 'bip65': {'type': 'buried', 'active': True, 'height': 4}, + 'csv': {'type': 'buried', 'active': True, 'height': 5}, + 'segwit': {'type': 'buried', 'active': True, 'height': 6}, 'testdummy': { 'type': 'bip9', 'bip9': { |