aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbrunoerg <brunoely.gc@gmail.com>2022-09-07 14:50:06 -0300
committerbrunoerg <brunoely.gc@gmail.com>2022-09-08 11:06:35 -0300
commit4b1d5a10537ab48e3457606ba1cf2ae26a1cb2b2 (patch)
tree73766912bc8e2b75bb55462d5b9c604f35de840b /test
parent5291933fedceb9df16eb9e4627b1d7386b53ba07 (diff)
test: invalidating an unknown block throws an error
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_invalidateblock.py6
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()