diff options
author | brunoerg <brunoely.gc@gmail.com> | 2022-09-07 14:50:06 -0300 |
---|---|---|
committer | brunoerg <brunoely.gc@gmail.com> | 2022-09-08 11:06:35 -0300 |
commit | 4b1d5a10537ab48e3457606ba1cf2ae26a1cb2b2 (patch) | |
tree | 73766912bc8e2b75bb55462d5b9c604f35de840b | |
parent | 5291933fedceb9df16eb9e4627b1d7386b53ba07 (diff) | |
download | bitcoin-4b1d5a10537ab48e3457606ba1cf2ae26a1cb2b2.tar.xz |
test: invalidating an unknown block throws an error
-rwxr-xr-x | test/functional/rpc_invalidateblock.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/rpc_invalidateblock.py b/test/functional/rpc_invalidateblock.py index f1c2537ef9..705fa6c736 100755 --- a/test/functional/rpc_invalidateblock.py +++ b/test/functional/rpc_invalidateblock.py @@ -8,6 +8,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR from test_framework.util import ( assert_equal, + assert_raises_rpc_error, ) @@ -83,6 +84,11 @@ class InvalidateTest(BitcoinTestFramework): # Should be back at the tip by now assert_equal(self.nodes[1].getbestblockhash(), blocks[-1]) + self.log.info("Verify that invalidating an unknown block throws an error") + chain_tips = self.nodes[1].getchaintips() + assert_raises_rpc_error(-5, "Block not found", self.nodes[1].invalidateblock, "00" * 32) + assert_equal(chain_tips, self.nodes[1].getchaintips()) + if __name__ == '__main__': InvalidateTest().main() |