Skip to content

Commit fa4ca8d

Browse files
author
MarcoFalke
committed
test: Add -testactivationheight tests to rpc_blockchain
1 parent 8e9801b commit fa4ca8d

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)