aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_getblockfrompeer.py
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2021-12-13 13:25:15 +0700
committerSjors Provoost <sjors@sprovoost.nl>2021-12-24 16:29:03 +0100
commit60243cac7286e4c4bdda7094bef4cf6d1564b583 (patch)
treefa873dd5208553106898521c1072d9e60b2eea62 /test/functional/rpc_getblockfrompeer.py
parent809d66bb65aa78048e27c2a878d6f7becaecfe11 (diff)
downloadbitcoin-60243cac7286e4c4bdda7094bef4cf6d1564b583.tar.xz
rpc: turn already downloaded into error in getblockfrompeer
Diffstat (limited to 'test/functional/rpc_getblockfrompeer.py')
-rwxr-xr-xtest/functional/rpc_getblockfrompeer.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/functional/rpc_getblockfrompeer.py b/test/functional/rpc_getblockfrompeer.py
index 47be920532..19af197530 100755
--- a/test/functional/rpc_getblockfrompeer.py
+++ b/test/functional/rpc_getblockfrompeer.py
@@ -61,12 +61,10 @@ class GetBlockFromPeerTest(BitcoinTestFramework):
self.log.info("Successful fetch")
result = self.nodes[0].getblockfrompeer(short_tip, peer_0_peer_1_id)
self.wait_until(lambda: self.check_for_block(short_tip), timeout=1)
- assert(not "warnings" in result)
+ assert_equal(result, {})
self.log.info("Don't fetch blocks we already have")
- result = self.nodes[0].getblockfrompeer(short_tip, peer_0_peer_1_id)
- assert("warnings" in result)
- assert_equal(result["warnings"], "Block already downloaded")
+ assert_raises_rpc_error(-1, "Block already downloaded", self.nodes[0].getblockfrompeer, short_tip, peer_0_peer_1_id)
if __name__ == '__main__':
GetBlockFromPeerTest().main()