mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 12:23:34 -05:00
test: added additional coverage to waitforblock and waitforblockheight rpc's
This commit is contained in:
parent
1172bc4157
commit
7e0db87d4f
1 changed files with 2 additions and 0 deletions
|
@ -535,6 +535,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||||
|
|
||||||
self.log.debug("waitforblock should return the same block after its timeout")
|
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_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)
|
node.reconsiderblock(rollback_hash)
|
||||||
# The chain has probably already been restored by the time reconsiderblock returns,
|
# 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 - 1)
|
||||||
assert_waitforheight(current_height)
|
assert_waitforheight(current_height)
|
||||||
assert_waitforheight(current_height + 1)
|
assert_waitforheight(current_height + 1)
|
||||||
|
assert_raises_rpc_error(-1, "Negative timeout", node.waitforblockheight, current_height, -1)
|
||||||
|
|
||||||
def _test_getblock(self):
|
def _test_getblock(self):
|
||||||
node = self.nodes[0]
|
node = self.nodes[0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue