Skip to content

Commit 33932d3

Browse files
committed
Merge bitcoin/bitcoin#31784: test: added additional coverage to waitforblock and waitforblockheight rpc's
7e0db87 test: added additional coverage to waitforblock and waitforblockheight rpc's (kevkevinpal) Pull request description: Similar to bitcoin/bitcoin#31746 This adds test coverage to the `waitforblock` and `waitforblockheight` rpc's by adding a test to assert we get an rpc error if we include a negative timeout ACKs for top commit: Sjors: utACK 7e0db87 Prabhat1308: ACK [7e0db87](bitcoin/bitcoin@7e0db87) brunoerg: code review ACK 7e0db87 BrandonOdiwuor: Code Review ACK 7e0db87 Tree-SHA512: c3b1b3a525e91e0092b783d73d2401126e3b8792a394be00374258f20cf3d619498e6625d3aad5e5ced29509c5eac828ee03c4ee66ba405b91e89be7e8b07311
2 parents 2aa7be1 + 7e0db87 commit 33932d3

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)