0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-22 12:23:34 -05:00

Merge bitcoin/bitcoin#31784: test: added additional coverage to waitforblock and waitforblockheight rpc's

7e0db87d4f test: added additional coverage to waitforblock and waitforblockheight rpc's (kevkevinpal)

Pull request description:

  Similar to https://github.com/bitcoin/bitcoin/pull/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 7e0db87d4f
  Prabhat1308:
    ACK [7e0db87](7e0db87d4f)
  brunoerg:
    code review ACK 7e0db87d4f
  BrandonOdiwuor:
    Code Review ACK 7e0db87d4f

Tree-SHA512: c3b1b3a525e91e0092b783d73d2401126e3b8792a394be00374258f20cf3d619498e6625d3aad5e5ced29509c5eac828ee03c4ee66ba405b91e89be7e8b07311
This commit is contained in:
merge-script 2025-02-05 10:38:00 +00:00
commit 33932d30e3
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -535,6 +535,7 @@ class BlockchainTest(BitcoinTestFramework):
self.log.debug("waitforblock should return the same block after its timeout")
assert_equal(node.waitforblock(blockhash=current_hash, timeout=1)['hash'], rollback_header['previousblockhash'])
assert_raises_rpc_error(-1, "Negative timeout", node.waitforblock, current_hash, -1)
node.reconsiderblock(rollback_hash)
# The chain has probably already been restored by the time reconsiderblock returns,
@ -589,6 +590,7 @@ class BlockchainTest(BitcoinTestFramework):
assert_waitforheight(current_height - 1)
assert_waitforheight(current_height)
assert_waitforheight(current_height + 1)
assert_raises_rpc_error(-1, "Negative timeout", node.waitforblockheight, current_height, -1)
def _test_getblock(self):
node = self.nodes[0]