Skip to content

Commit 16ccb3a

Browse files
author
merge-script
committed
Merge bitcoin/bitcoin#23086: test: Add -testactivationheight tests to rpc_blockchain
fa4ca8d test: Add -testactivationheight tests to rpc_blockchain (MarcoFalke) Pull request description: Suggested: bitcoin/bitcoin#22818 (comment) ACKs for top commit: laanwj: Code review ACK fa4ca8d theStack: Concept and code-review ACK fa4ca8d Tree-SHA512: 41304db1a15c0c705a9cc2808c9f1d7831a321a8a7948a28ec5d3ee1ed3da6a0ce67cd50c99a33aaed86830c59608eb6ffadbeaba67d95245c490f9b6c277912
2 parents 747f91c + fa4ca8d commit 16ccb3a

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

test/functional/rpc_blockchain.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,29 @@ def _test_getblockchaininfo(self):
127127
# should have exact keys
128128
assert_equal(sorted(res.keys()), keys)
129129

130-
self.restart_node(0, ['-stopatheight=207', '-prune=550'])
130+
self.stop_node(0)
131+
self.nodes[0].assert_start_raises_init_error(
132+
extra_args=['-testactivationheight=name@2'],
133+
expected_msg='Error: Invalid name (name@2) for -testactivationheight=name@height.',
134+
)
135+
self.nodes[0].assert_start_raises_init_error(
136+
extra_args=['-testactivationheight=bip34@-2'],
137+
expected_msg='Error: Invalid height value (bip34@-2) for -testactivationheight=name@height.',
138+
)
139+
self.nodes[0].assert_start_raises_init_error(
140+
extra_args=['-testactivationheight='],
141+
expected_msg='Error: Invalid format () for -testactivationheight=name@height.',
142+
)
143+
self.start_node(0, extra_args=[
144+
'-stopatheight=207',
145+
'-prune=550',
146+
'-testactivationheight=bip34@2',
147+
'-testactivationheight=dersig@3',
148+
'-testactivationheight=cltv@4',
149+
'-testactivationheight=csv@5',
150+
'-testactivationheight=segwit@6',
151+
])
152+
131153
res = self.nodes[0].getblockchaininfo()
132154
# result should have these additional pruning keys if prune=550
133155
assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys))
@@ -140,11 +162,11 @@ def _test_getblockchaininfo(self):
140162
assert_greater_than(res['size_on_disk'], 0)
141163

142164
assert_equal(res['softforks'], {
143-
'bip34': {'type': 'buried', 'active': True, 'height': 1},
144-
'bip66': {'type': 'buried', 'active': True, 'height': 1},
145-
'bip65': {'type': 'buried', 'active': True, 'height': 1},
146-
'csv': {'type': 'buried', 'active': True, 'height': 1},
147-
'segwit': {'type': 'buried', 'active': True, 'height': 1},
165+
'bip34': {'type': 'buried', 'active': True, 'height': 2},
166+
'bip66': {'type': 'buried', 'active': True, 'height': 3},
167+
'bip65': {'type': 'buried', 'active': True, 'height': 4},
168+
'csv': {'type': 'buried', 'active': True, 'height': 5},
169+
'segwit': {'type': 'buried', 'active': True, 'height': 6},
148170
'testdummy': {
149171
'type': 'bip9',
150172
'bip9': {

0 commit comments

Comments
 (0)