Skip to content

Commit 42029a7

Browse files
committed
test: remove redundant blocks generation logic
those tests already have enough mature utxos from the pre-mined chain.
1 parent 0377d6b commit 42029a7

5 files changed

+0
-16
lines changed

test/functional/feature_bip68_sequence.py

-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ def run_test(self):
6363
self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"]
6464
self.wallet = MiniWallet(self.nodes[0])
6565

66-
# Generate some coins
67-
self.generate(self.wallet, 110)
68-
6966
self.log.info("Running test disable flag")
7067
self.test_disable_flag()
7168

test/functional/interface_usdt_utxocache.py

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def skip_test_if_missing_module(self):
144144

145145
def run_test(self):
146146
self.wallet = MiniWallet(self.nodes[0])
147-
self.generate(self.wallet, 101)
148147

149148
self.test_uncache()
150149
self.test_add_spent()

test/functional/mining_getblocktemplate_longpoll.py

-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import random
99
import threading
1010

11-
from test_framework.blocktools import COINBASE_MATURITY
1211
from test_framework.test_framework import BitcoinTestFramework
1312
from test_framework.util import get_rpc_proxy
1413
from test_framework.wallet import MiniWallet
@@ -62,9 +61,6 @@ def run_test(self):
6261
thr.join(5) # wait 5 seconds or until thread exits
6362
assert not thr.is_alive()
6463

65-
# Add enough mature utxos to the wallets, so that all txs spend confirmed coins
66-
self.generate(self.nodes[0], COINBASE_MATURITY)
67-
6864
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
6965
thr = LongpollThread(self.nodes[0])
7066
thr.start()

test/functional/p2p_feefilter.py

-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from decimal import Decimal
88

9-
from test_framework.blocktools import COINBASE_MATURITY
109
from test_framework.messages import MSG_TX, MSG_WTX, msg_feefilter
1110
from test_framework.p2p import P2PInterface, p2p_lock
1211
from test_framework.test_framework import BitcoinTestFramework
@@ -80,9 +79,6 @@ def test_feefilter(self):
8079
node1 = self.nodes[1]
8180
node0 = self.nodes[0]
8281
miniwallet = MiniWallet(node1)
83-
# Add enough mature utxos to the wallet, so that all txs spend confirmed coins
84-
self.generate(miniwallet, 5)
85-
self.generate(node1, COINBASE_MATURITY)
8682

8783
conn = self.nodes[0].add_p2p_connection(TestP2PConn())
8884

test/functional/p2p_leak_tx.py

-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test that we don't leak txs to inbound peers that we haven't yet announced to"""
66

7-
from test_framework.blocktools import COINBASE_MATURITY
87
from test_framework.messages import msg_getdata, CInv, MSG_TX
98
from test_framework.p2p import p2p_lock, P2PDataStore
109
from test_framework.test_framework import BitcoinTestFramework
@@ -26,9 +25,6 @@ def set_test_params(self):
2625
def run_test(self):
2726
gen_node = self.nodes[0] # The block and tx generating node
2827
miniwallet = MiniWallet(gen_node)
29-
# Add enough mature utxos to the wallet, so that all txs spend confirmed coins
30-
self.generate(miniwallet, 1)
31-
self.generate(gen_node, COINBASE_MATURITY)
3228

3329
inbound_peer = self.nodes[0].add_p2p_connection(P2PNode()) # An "attacking" inbound peer
3430

0 commit comments

Comments
 (0)