diff options
author | MacroFake <falke.marco@gmail.com> | 2022-06-15 08:38:16 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-06-15 08:38:19 +0200 |
commit | 4c0d1fec16fdbf1ead9d239c161128c6b1c17e2d (patch) | |
tree | 3e28ab5a5bbb25b1d721da0589415be8dcff95c7 | |
parent | a57492f65df78be353923f321d5b4a7f586417a9 (diff) | |
parent | 42b2fdfd5f9d854fe05a248278fc309a6a9fa6bc (diff) | |
download | bitcoin-4c0d1fec16fdbf1ead9d239c161128c6b1c17e2d.tar.xz |
Merge bitcoin/bitcoin#25374: test: remove unused `create_confirmed_utxos` helper
42b2fdfd5f9d854fe05a248278fc309a6a9fa6bc test: remove unused `create_confirmed_utxos` helper (Sebastian Falbesoner)
Pull request description:
After more and more non-wallet tests have been converted to use MiniWallet (#25087, #24839, #24749 etc.), the `create_confirmed_utxos` helper is now not used anymore and can be removed. An alternative would be to create a MiniWallet version of `create_confirmed_utxos`, but it seems that it's not worth it, considering that would be only two lines (calling MiniWallet's `send_self_transfer_multi` with a subsequent `generate` call), see comment https://github.com/bitcoin/bitcoin/pull/24839#discussion_r896472729.
ACKs for top commit:
MarcoFalke:
cr ACK 42b2fdfd5f9d854fe05a248278fc309a6a9fa6bc
Tree-SHA512: 274418156265a6071940f53cbcd77f6779af5e951cfa1e5efbf07a5c61487b521ee19f36b4105e5c0a808139d121e5e262e77525ea3d1486a0421f01abcf58fd
-rw-r--r-- | test/functional/test_framework/util.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 21d8baf3e9..1c64fa4028 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -476,39 +476,6 @@ def find_output(node, txid, amount, *, blockhash=None): raise RuntimeError("find_output txid %s : %s not found" % (txid, str(amount))) -# Helper to create at least "count" utxos -# Pass in a fee that is sufficient for relay and mining new transactions. -def create_confirmed_utxos(test_framework, fee, node, count, **kwargs): - to_generate = int(0.5 * count) + 101 - while to_generate > 0: - test_framework.generate(node, min(25, to_generate), **kwargs) - to_generate -= 25 - utxos = node.listunspent() - iterations = count - len(utxos) - addr1 = node.getnewaddress() - addr2 = node.getnewaddress() - if iterations <= 0: - return utxos - for _ in range(iterations): - t = utxos.pop() - inputs = [] - inputs.append({"txid": t["txid"], "vout": t["vout"]}) - outputs = {} - send_value = t['amount'] - fee - outputs[addr1] = satoshi_round(send_value / 2) - outputs[addr2] = satoshi_round(send_value / 2) - raw_tx = node.createrawtransaction(inputs, outputs) - signed_tx = node.signrawtransactionwithwallet(raw_tx)["hex"] - node.sendrawtransaction(signed_tx) - - while (node.getmempoolinfo()['size'] > 0): - test_framework.generate(node, 1, **kwargs) - - utxos = node.listunspent() - assert len(utxos) >= count - return utxos - - def chain_transaction(node, parent_txids, vouts, value, fee, num_outputs): """Build and send a transaction that spends the given inputs (specified by lists of parent_txid:vout each), with the desired total value and fee, |