Skip to content

Commit 8df4844

Browse files
merge-scriptknst
merge-script
authored andcommitted
Merge bitcoin#23086: test: Add -testactivationheight tests to rpc_blockchain
fa4ca8d test: Add -testactivationheight tests to rpc_blockchain (MarcoFalke) Pull request description: Suggested: bitcoin#22818 (comment) ACKs for top commit: laanwj: Code review ACK fa4ca8d theStack: Concept and code-review ACK fa4ca8d Tree-SHA512: 41304db1a15c0c705a9cc2808c9f1d7831a321a8a7948a28ec5d3ee1ed3da6a0ce67cd50c99a33aaed86830c59608eb6ffadbeaba67d95245c490f9b6c277912
1 parent 9c4b40b commit 8df4844

File tree

1 file changed

+43
-13
lines changed

1 file changed

+43
-13
lines changed

test/functional/rpc_blockchain.py

+43-13
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,37 @@ def _test_getblockchaininfo(self):
147147
# should have exact keys
148148
assert_equal(sorted(res.keys()), keys)
149149

150-
self.restart_node(0, ['-stopatheight=207', '-prune=550', '-txindex=0'])
150+
self.stop_node(0)
151+
self.nodes[0].assert_start_raises_init_error(
152+
extra_args=['-testactivationheight=name@2'],
153+
expected_msg='Error: Invalid name (name@2) for -testactivationheight=name@height.',
154+
)
155+
self.nodes[0].assert_start_raises_init_error(
156+
extra_args=['-testactivationheight=bip34@-2'],
157+
expected_msg='Error: Invalid height value (bip34@-2) for -testactivationheight=name@height.',
158+
)
159+
self.nodes[0].assert_start_raises_init_error(
160+
extra_args=['-testactivationheight='],
161+
expected_msg='Error: Invalid format () for -testactivationheight=name@height.',
162+
)
163+
self.start_node(0, extra_args=[
164+
'-stopatheight=207',
165+
'-prune=550',
166+
'-txindex=0',
167+
'-testactivationheight=bip34@2',
168+
'-testactivationheight=dersig@3',
169+
'-testactivationheight=cltv@4',
170+
'-testactivationheight=csv@5',
171+
'-testactivationheight=bip147@6',
172+
'-testactivationheight=dip0001@10',
173+
'-dip3params=411:511',
174+
'-testactivationheight=dip0008@12',
175+
'-testactivationheight=dip0024@13',
176+
'-testactivationheight=brr@14',
177+
'-testactivationheight=v20@901',
178+
'-testactivationheight=mn_rr@902',
179+
])
180+
151181
res = self.nodes[0].getblockchaininfo()
152182
# result should have these additional pruning keys if prune=550
153183
assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys))
@@ -159,20 +189,20 @@ def _test_getblockchaininfo(self):
159189
assert_equal(res['prune_target_size'], 576716800)
160190
assert_greater_than(res['size_on_disk'], 0)
161191
assert_equal(res['softforks'], {
162-
'bip34': {'type': 'buried', 'active': True, 'height': 1},
163-
'bip66': {'type': 'buried', 'active': True, 'height': 1},
164-
'bip65': {'type': 'buried', 'active': True, 'height': 1},
165-
'bip147': { 'type': 'buried', 'active': True, 'height': 1},
166-
'csv': {'type': 'buried', 'active': True, 'height': 1},
167-
'dip0001': { 'type': 'buried', 'active': True, 'height': 1},
168-
'dip0003': { 'type': 'buried', 'active': False, 'height': 432},
169-
'dip0008': { 'type': 'buried', 'active': True, 'height': 1},
192+
'bip34': {'type': 'buried', 'active': True, 'height': 2},
193+
'bip66': {'type': 'buried', 'active': True, 'height': 3},
194+
'bip65': {'type': 'buried', 'active': True, 'height': 4},
195+
'csv': {'type': 'buried', 'active': True, 'height': 5},
196+
'bip147': {'type': 'buried', 'active': True, 'height': 6},
197+
'dip0001': { 'type': 'buried', 'active': True, 'height': 10},
198+
'dip0003': { 'type': 'buried', 'active': False, 'height': 411},
199+
'dip0008': { 'type': 'buried', 'active': True, 'height': 12},
170200
'dip0020': { 'type': 'buried', 'active': True, 'height': 1},
171-
'dip0024': { 'type': 'buried', 'active': True, 'height': 1},
172-
'realloc': { 'type': 'buried', 'active': True, 'height': 1},
201+
'dip0024': { 'type': 'buried', 'active': True, 'height': 13},
202+
'realloc': { 'type': 'buried', 'active': True, 'height': 14},
173203
'v19': { 'type': 'buried', 'active': False, 'height': 900},
174-
'v20': { 'type': 'buried', 'active': False, 'height': 900},
175-
'mn_rr': { 'type': 'buried', 'active': False, 'height': 900},
204+
'v20': { 'type': 'buried', 'active': False, 'height': 901},
205+
'mn_rr': { 'type': 'buried', 'active': False, 'height': 902},
176206
'withdrawals': {
177207
'type': 'bip9',
178208
'bip9': {

0 commit comments

Comments
 (0)