7
7
from decimal import Decimal
8
8
9
9
from test_framework .blocktools import COINBASE_MATURITY
10
- from test_framework .messages import COIN
11
10
from test_framework .test_framework import BitcoinTestFramework
12
11
from test_framework .util import (
13
12
assert_equal ,
14
13
assert_greater_than ,
15
14
assert_raises_rpc_error ,
15
+ create_lots_of_big_transactions ,
16
16
gen_return_txouts ,
17
17
)
18
18
from test_framework .wallet import MiniWallet
@@ -29,16 +29,6 @@ def set_test_params(self):
29
29
]]
30
30
self .supports_cli = False
31
31
32
- def send_large_txs (self , node , miniwallet , txouts , fee , tx_batch_size ):
33
- for _ in range (tx_batch_size ):
34
- tx = miniwallet .create_self_transfer (from_node = node , fee_rate = 0 , mempool_valid = False )['tx' ]
35
- for txout in txouts :
36
- tx .vout .append (txout )
37
- tx .vout [0 ].nValue -= int (fee * COIN )
38
- res = node .testmempoolaccept ([tx .serialize ().hex ()])[0 ]
39
- assert_equal (res ['fees' ]['base' ], fee )
40
- miniwallet .sendrawtransaction (from_node = node , tx_hex = tx .serialize ().hex ())
41
-
42
32
def run_test (self ):
43
33
txouts = gen_return_txouts ()
44
34
node = self .nodes [0 ]
@@ -71,7 +61,7 @@ def run_test(self):
71
61
self .log .info ("Fill up the mempool with txs with higher fee rate" )
72
62
for batch_of_txid in range (num_of_batches ):
73
63
fee = (batch_of_txid + 1 ) * base_fee
74
- self . send_large_txs ( node , miniwallet , txouts , fee , tx_batch_size )
64
+ create_lots_of_big_transactions ( miniwallet , node , fee , tx_batch_size , txouts )
75
65
76
66
self .log .info ('The tx should be evicted by now' )
77
67
# The number of transactions created should be greater than the ones present in the mempool
0 commit comments