@@ -187,7 +187,7 @@ def send_to(self, *, from_node, scriptPubKey, amount, fee=1000):
187187
188188 Returns a tuple (txid, n) referring to the created external utxo outpoint.
189189 """
190- tx = self .create_self_transfer (from_node = from_node , fee_rate = 0 , mempool_valid = False )[ 'tx' ]
190+ tx = self .create_self_transfer (from_node = from_node , fee_rate = 0 )[ "tx" ]
191191 assert_greater_than_or_equal (tx .vout [0 ].nValue , amount + fee )
192192 tx .vout [0 ].nValue -= (amount + fee ) # change output -> MiniWallet
193193 tx .vout .append (CTxOut (amount , scriptPubKey )) # arbitrary output -> to be returned
@@ -224,7 +224,7 @@ def create_self_transfer_multi(
224224 # create simple tx template (1 input, 1 output)
225225 tx = self .create_self_transfer (
226226 fee_rate = 0 , from_node = from_node ,
227- utxo_to_spend = utxos_to_spend [0 ], sequence = sequence , mempool_valid = False )[ 'tx' ]
227+ utxo_to_spend = utxos_to_spend [0 ], sequence = sequence )[ "tx" ]
228228
229229 # duplicate inputs, witnesses and outputs
230230 tx .vin = [deepcopy (tx .vin [0 ]) for _ in range (len (utxos_to_spend ))]
@@ -241,9 +241,8 @@ def create_self_transfer_multi(
241241 o .nValue = outputs_value_total // num_outputs
242242 return tx
243243
244- def create_self_transfer (self , * , fee_rate = Decimal ("0.003" ), from_node = None , utxo_to_spend = None , mempool_valid = True , locktime = 0 , sequence = 0 ):
245- """Create and return a tx with the specified fee_rate. Fee may be exact or at most one satoshi higher than needed.
246- Checking mempool validity via the testmempoolaccept RPC can be skipped by setting mempool_valid to False."""
244+ def create_self_transfer (self , * , fee_rate = Decimal ("0.003" ), from_node = None , utxo_to_spend = None , locktime = 0 , sequence = 0 ):
245+ """Create and return a tx with the specified fee_rate. Fee may be exact or at most one satoshi higher than needed."""
247246 from_node = from_node or self ._test_node
248247 utxo_to_spend = utxo_to_spend or self .get_utxo ()
249248 if self ._mode in (MiniWalletMode .RAW_OP_TRUE , MiniWalletMode .ADDRESS_OP_TRUE ):
@@ -269,11 +268,7 @@ def create_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node=None, utx
269268 assert False
270269 tx_hex = tx .serialize ().hex ()
271270
272- if mempool_valid :
273- tx_info = from_node .testmempoolaccept ([tx_hex ])[0 ]
274- assert_equal (tx_info ['allowed' ], True )
275- assert_equal (len (tx_hex ) // 2 , vsize ) # 1 byte = 2 character
276- assert_equal (tx_info ['fees' ]['base' ], utxo_to_spend ['value' ] - Decimal (send_value ) / COIN )
271+ assert_equal (tx .get_vsize (), vsize )
277272
278273 return {'txid' : tx .rehash (), 'hex' : tx_hex , 'tx' : tx }
279274
0 commit comments