Skip to content

Commit 7e0db87

Browse files
committed
test: added additional coverage to waitforblock and waitforblockheight rpc's
1 parent 1172bc4 commit 7e0db87

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/rpc_blockchain.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ def _test_waitforblock(self):
535535

536536
self.log.debug("waitforblock should return the same block after its timeout")
537537
assert_equal(node.waitforblock(blockhash=current_hash, timeout=1)['hash'], rollback_header['previousblockhash'])
538+
assert_raises_rpc_error(-1, "Negative timeout", node.waitforblock, current_hash, -1)
538539

539540
node.reconsiderblock(rollback_hash)
540541
# The chain has probably already been restored by the time reconsiderblock returns,
@@ -589,6 +590,7 @@ def assert_waitforheight(height, timeout=2):
589590
assert_waitforheight(current_height - 1)
590591
assert_waitforheight(current_height)
591592
assert_waitforheight(current_height + 1)
593+
assert_raises_rpc_error(-1, "Negative timeout", node.waitforblockheight, current_height, -1)
592594

593595
def _test_getblock(self):
594596
node = self.nodes[0]

0 commit comments

Comments
 (0)