Skip to content

Commit 4b1d5a1

Browse files
committed
test: invalidating an unknown block throws an error
1 parent 5291933 commit 4b1d5a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/rpc_invalidateblock.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR
99
from test_framework.util import (
1010
assert_equal,
11+
assert_raises_rpc_error,
1112
)
1213

1314

@@ -83,6 +84,11 @@ def run_test(self):
8384
# Should be back at the tip by now
8485
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])
8586

87+
self.log.info("Verify that invalidating an unknown block throws an error")
88+
chain_tips = self.nodes[1].getchaintips()
89+
assert_raises_rpc_error(-5, "Block not found", self.nodes[1].invalidateblock, "00" * 32)
90+
assert_equal(chain_tips, self.nodes[1].getchaintips())
91+
8692

8793
if __name__ == '__main__':
8894
InvalidateTest().main()

0 commit comments

Comments
 (0)