mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-04 08:51:00 +02:00
test: invalidating an unknown block throws an error
This commit is contained in:
parent
5291933fed
commit
4b1d5a1053
@ -8,6 +8,7 @@ from test_framework.test_framework import BitcoinTestFramework
|
|||||||
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR
|
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR
|
||||||
from test_framework.util import (
|
from test_framework.util import (
|
||||||
assert_equal,
|
assert_equal,
|
||||||
|
assert_raises_rpc_error,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -83,6 +84,11 @@ class InvalidateTest(BitcoinTestFramework):
|
|||||||
# Should be back at the tip by now
|
# Should be back at the tip by now
|
||||||
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])
|
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__':
|
if __name__ == '__main__':
|
||||||
InvalidateTest().main()
|
InvalidateTest().main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user