mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 02:31:05 +02:00
test: makes timeout a forced named argument in tests methods that use it
This makes calls to such methods more explicit and less error prone
This commit is contained in:
@ -198,15 +198,15 @@ class TestP2PConn(P2PInterface):
|
||||
self.send_message(msg)
|
||||
else:
|
||||
self.send_message(msg_inv(inv=[CInv(MSG_BLOCK, block.sha256)]))
|
||||
self.wait_for_getheaders()
|
||||
self.wait_for_getheaders(timeout=timeout)
|
||||
self.send_message(msg)
|
||||
self.wait_for_getdata([block.sha256])
|
||||
self.wait_for_getdata([block.sha256], timeout=timeout)
|
||||
|
||||
def request_block(self, blockhash, inv_type, timeout=60):
|
||||
with p2p_lock:
|
||||
self.last_message.pop("block", None)
|
||||
self.send_message(msg_getdata(inv=[CInv(inv_type, blockhash)]))
|
||||
self.wait_for_block(blockhash, timeout)
|
||||
self.wait_for_block(blockhash, timeout=timeout)
|
||||
return self.last_message["block"].block
|
||||
|
||||
class SegWitTest(BitcoinTestFramework):
|
||||
@ -2056,7 +2056,7 @@ class SegWitTest(BitcoinTestFramework):
|
||||
test_transaction_acceptance(self.nodes[0], self.wtx_node, tx2, with_witness=True, accepted=False)
|
||||
|
||||
# Expect a request for parent (tx) by txid despite use of WTX peer
|
||||
self.wtx_node.wait_for_getdata([tx.sha256], 60)
|
||||
self.wtx_node.wait_for_getdata([tx.sha256], timeout=60)
|
||||
with p2p_lock:
|
||||
lgd = self.wtx_node.lastgetdata[:]
|
||||
assert_equal(lgd, [CInv(MSG_WITNESS_TX, tx.sha256)])
|
||||
|
Reference in New Issue
Block a user