aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-11-20 11:50:06 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-11-20 11:50:10 +0100
commitbf9548bc59458c997baa8b2818c33f399559168a (patch)
treee75b227171ed6ff3b9105f91ebef2df02e8113b6 /test
parent80496f9e81164c75ce80e75cbe87092171f3c963 (diff)
parent7ffac12545328cadd92a3caec4f1c6ca7c127493 (diff)
downloadbitcoin-bf9548bc59458c997baa8b2818c33f399559168a.tar.xz
Merge #20431: [backport 0.21] tests: shrink feature_taproot transfer of funds tx
7ffac12545328cadd92a3caec4f1c6ca7c127493 tests: shrink feature_taproot transfer of funds tx (Anthony Towns) Pull request description: Github-Pull: #20428 Rebased-From: 7ffac12545328cadd92a3caec4f1c6ca7c127493 Top commit has no ACKs. Tree-SHA512: 4e6b37a44dca3e29d5168b7eb9238a7ce0bbb9b0924a21671537a7c534790fb6b05b1a30a404db434fade030b4f369adfc73694ef85d91884bb7349adddc5f6a
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_taproot.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py
index 6e28cfb265..0f0fe8a34a 100755
--- a/test/functional/feature_taproot.py
+++ b/test/functional/feature_taproot.py
@@ -1442,17 +1442,23 @@ class TaprootTest(BitcoinTestFramework):
self.nodes[1].generate(101)
self.test_spenders(self.nodes[1], spenders_taproot_active(), input_counts=[1, 2, 2, 2, 2, 3])
- # Transfer funds to pre-taproot node.
+ # Transfer value of the largest 500 coins to pre-taproot node.
addr = self.nodes[0].getnewaddress()
+
+ unsp = self.nodes[1].listunspent()
+ unsp = sorted(unsp, key=lambda i: i['amount'], reverse=True)
+ unsp = unsp[:500]
+
rawtx = self.nodes[1].createrawtransaction(
inputs=[{
'txid': i['txid'],
'vout': i['vout']
- } for i in self.nodes[1].listunspent()],
- outputs={addr: self.nodes[1].getbalance()},
+ } for i in unsp],
+ outputs={addr: sum(i['amount'] for i in unsp)}
)
rawtx = self.nodes[1].signrawtransactionwithwallet(rawtx)['hex']
- # Transaction is too large to fit into the mempool, so put it into a block
+
+ # Mine a block with the transaction
block = create_block(tmpl=self.nodes[1].getblocktemplate(NORMAL_GBT_REQUEST_PARAMS), txlist=[rawtx])
add_witness_commitment(block)
block.rehash()