test: Added coverage to the waitfornewblock rpc

Added a test for the Negative timeout error if the rpc is given a
negative value for its timeout arg
This commit is contained in:
kevkevinpal 2025-01-28 08:12:37 -05:00
parent b432e36742
commit 93747d934b
No known key found for this signature in database
GPG Key ID: B4346A15246A925D

View File

@ -549,6 +549,7 @@ class BlockchainTest(BitcoinTestFramework):
# The chain has probably already been restored by the time reconsiderblock returns,
# but poll anyway.
self.wait_until(lambda: node.waitfornewblock(timeout=100)['hash'] == current_hash)
assert_raises_rpc_error(-1, "Negative timeout", node.waitfornewblock, -1)
def _test_waitforblockheight(self):
self.log.info("Test waitforblockheight")