diff options
author | MacroFake <falke.marco@gmail.com> | 2022-06-13 14:08:12 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-06-13 18:09:16 +0200 |
commit | fa779de665227cf15a4056959e9753618cc013ac (patch) | |
tree | 9877cfa3654132d0f1e44d1b685eec1221d25ec1 /test/functional/test_framework | |
parent | 506d9b25a3f8ef8a4ce63f989083803d8d4ae6df (diff) |
test: Remove MiniWallet mempool_valid option
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r-- | test/functional/test_framework/util.py | 2 | ||||
-rw-r--r-- | test/functional/test_framework/wallet.py | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index b942642074..21d8baf3e9 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -563,7 +563,7 @@ def create_lots_of_big_transactions(mini_wallet, node, fee, tx_batch_size, txout from_node=node, utxo_to_spend=None if use_internal_utxos else utxos.pop(), fee_rate=0, - mempool_valid=False)['tx'] + )["tx"] tx.vout[0].nValue -= fee_sats tx.vout.extend(txouts) res = node.testmempoolaccept([tx.serialize().hex()])[0] diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py index e43dd9f61a..93f3ea9e81 100644 --- a/test/functional/test_framework/wallet.py +++ b/test/functional/test_framework/wallet.py @@ -193,7 +193,7 @@ class MiniWallet: Returns a tuple (txid, n) referring to the created external utxo outpoint. """ - tx = self.create_self_transfer(from_node=from_node, fee_rate=0, mempool_valid=False)['tx'] + tx = self.create_self_transfer(from_node=from_node, fee_rate=0)["tx"] assert_greater_than_or_equal(tx.vout[0].nValue, amount + fee) tx.vout[0].nValue -= (amount + fee) # change output -> MiniWallet tx.vout.append(CTxOut(amount, scriptPubKey)) # arbitrary output -> to be returned @@ -230,7 +230,7 @@ class MiniWallet: # create simple tx template (1 input, 1 output) tx = self.create_self_transfer( fee_rate=0, from_node=from_node, - utxo_to_spend=utxos_to_spend[0], sequence=sequence, mempool_valid=False)['tx'] + utxo_to_spend=utxos_to_spend[0], sequence=sequence)["tx"] # duplicate inputs, witnesses and outputs tx.vin = [deepcopy(tx.vin[0]) for _ in range(len(utxos_to_spend))] @@ -248,9 +248,8 @@ class MiniWallet: o.nValue = outputs_value_total // num_outputs return tx - def create_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node=None, utxo_to_spend=None, mempool_valid=True, locktime=0, sequence=0): - """Create and return a tx with the specified fee_rate. Fee may be exact or at most one satoshi higher than needed. - Checking mempool validity via the testmempoolaccept RPC can be skipped by setting mempool_valid to False.""" + def create_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node=None, utxo_to_spend=None, locktime=0, sequence=0): + """Create and return a tx with the specified fee_rate. Fee may be exact or at most one satoshi higher than needed.""" from_node = from_node or self._test_node utxo_to_spend = utxo_to_spend or self.get_utxo() if self._priv_key is None: @@ -277,11 +276,7 @@ class MiniWallet: tx.wit.vtxinwit[0].scriptWitness.stack = [CScript([OP_TRUE]), bytes([LEAF_VERSION_TAPSCRIPT]) + self._internal_key] tx_hex = tx.serialize().hex() - if mempool_valid: - tx_info = from_node.testmempoolaccept([tx_hex])[0] - assert_equal(tx_info['allowed'], True) - assert_equal(tx_info['vsize'], vsize) - assert_equal(tx_info['fees']['base'], utxo_to_spend['value'] - Decimal(send_value) / COIN) + assert_equal(tx.get_vsize(), vsize) return {'txid': tx.rehash(), 'wtxid': tx.getwtxid(), 'hex': tx_hex, 'tx': tx} |