0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

test: remove redundant blocks generation logic

those tests already have enough mature utxos from the pre-mined chain.
This commit is contained in:
kouloumos 2023-01-13 12:00:53 +02:00
parent 0377d6bb42
commit 42029a7fd4
5 changed files with 0 additions and 16 deletions

View file

@ -63,9 +63,6 @@ class BIP68Test(BitcoinTestFramework):
self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"] self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"]
self.wallet = MiniWallet(self.nodes[0]) self.wallet = MiniWallet(self.nodes[0])
# Generate some coins
self.generate(self.wallet, 110)
self.log.info("Running test disable flag") self.log.info("Running test disable flag")
self.test_disable_flag() self.test_disable_flag()

View file

@ -144,7 +144,6 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
def run_test(self): def run_test(self):
self.wallet = MiniWallet(self.nodes[0]) self.wallet = MiniWallet(self.nodes[0])
self.generate(self.wallet, 101)
self.test_uncache() self.test_uncache()
self.test_add_spent() self.test_add_spent()

View file

@ -8,7 +8,6 @@ from decimal import Decimal
import random import random
import threading import threading
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import get_rpc_proxy from test_framework.util import get_rpc_proxy
from test_framework.wallet import MiniWallet from test_framework.wallet import MiniWallet
@ -62,9 +61,6 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
thr.join(5) # wait 5 seconds or until thread exits thr.join(5) # wait 5 seconds or until thread exits
assert not thr.is_alive() assert not thr.is_alive()
# Add enough mature utxos to the wallets, so that all txs spend confirmed coins
self.generate(self.nodes[0], COINBASE_MATURITY)
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll") self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
thr = LongpollThread(self.nodes[0]) thr = LongpollThread(self.nodes[0])
thr.start() thr.start()

View file

@ -6,7 +6,6 @@
from decimal import Decimal from decimal import Decimal
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.messages import MSG_TX, MSG_WTX, msg_feefilter from test_framework.messages import MSG_TX, MSG_WTX, msg_feefilter
from test_framework.p2p import P2PInterface, p2p_lock from test_framework.p2p import P2PInterface, p2p_lock
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
@ -80,9 +79,6 @@ class FeeFilterTest(BitcoinTestFramework):
node1 = self.nodes[1] node1 = self.nodes[1]
node0 = self.nodes[0] node0 = self.nodes[0]
miniwallet = MiniWallet(node1) miniwallet = MiniWallet(node1)
# Add enough mature utxos to the wallet, so that all txs spend confirmed coins
self.generate(miniwallet, 5)
self.generate(node1, COINBASE_MATURITY)
conn = self.nodes[0].add_p2p_connection(TestP2PConn()) conn = self.nodes[0].add_p2p_connection(TestP2PConn())

View file

@ -4,7 +4,6 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that we don't leak txs to inbound peers that we haven't yet announced to""" """Test that we don't leak txs to inbound peers that we haven't yet announced to"""
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.messages import msg_getdata, CInv, MSG_TX from test_framework.messages import msg_getdata, CInv, MSG_TX
from test_framework.p2p import p2p_lock, P2PDataStore from test_framework.p2p import p2p_lock, P2PDataStore
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
@ -26,9 +25,6 @@ class P2PLeakTxTest(BitcoinTestFramework):
def run_test(self): def run_test(self):
gen_node = self.nodes[0] # The block and tx generating node gen_node = self.nodes[0] # The block and tx generating node
miniwallet = MiniWallet(gen_node) miniwallet = MiniWallet(gen_node)
# Add enough mature utxos to the wallet, so that all txs spend confirmed coins
self.generate(miniwallet, 1)
self.generate(gen_node, COINBASE_MATURITY)
inbound_peer = self.nodes[0].add_p2p_connection(P2PNode()) # An "attacking" inbound peer inbound_peer = self.nodes[0].add_p2p_connection(P2PNode()) # An "attacking" inbound peer