aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2020-11-20 05:23:25 +1000
committerAnthony Towns <aj@erisian.com.au>2020-11-20 07:29:42 +1000
commit7ffac12545328cadd92a3caec4f1c6ca7c127493 (patch)
tree6d91163c396c241a174536c9d3a818df329b897a /test/functional
parent4fd37d0a104ff1b05a3c8e374af9b2c92a0078c2 (diff)
tests: shrink feature_taproot transfer of funds tx
Diffstat (limited to 'test/functional')
-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()