mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-03 20:21:34 +02:00
[refactor] clarify tests by referencing p2p objects directly
Use object returned from add_p2p_connection to refer to p2ps. Add a test class attribute if it needs to be used across many methods. Don't use the p2p property.
This commit is contained in:
@ -58,7 +58,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
|
||||
|
||||
def run_test(self):
|
||||
# Mine some blocks and have them mature.
|
||||
self.nodes[0].add_p2p_connection(P2PTxInvStore()) # keep track of invs
|
||||
peer_inv_store = self.nodes[0].add_p2p_connection(P2PTxInvStore()) # keep track of invs
|
||||
self.nodes[0].generate(101)
|
||||
utxo = self.nodes[0].listunspent(10)
|
||||
txid = utxo[0]['txid']
|
||||
@ -80,7 +80,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
|
||||
|
||||
# Wait until mempool transactions have passed initial broadcast (sent inv and received getdata)
|
||||
# Otherwise, getrawmempool may be inconsistent with getmempoolentry if unbroadcast changes in between
|
||||
self.nodes[0].p2p.wait_for_broadcast(witness_chain)
|
||||
peer_inv_store.wait_for_broadcast(witness_chain)
|
||||
|
||||
# Check mempool has MAX_ANCESTORS transactions in it, and descendant and ancestor
|
||||
# count and fees should look correct
|
||||
|
Reference in New Issue
Block a user