Skip to content

Commit 7ffac12

Browse files
committed
tests: shrink feature_taproot transfer of funds tx
1 parent 4fd37d0 commit 7ffac12

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/functional/feature_taproot.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,17 +1442,23 @@ def run_test(self):
14421442
self.nodes[1].generate(101)
14431443
self.test_spenders(self.nodes[1], spenders_taproot_active(), input_counts=[1, 2, 2, 2, 2, 3])
14441444

1445-
# Transfer funds to pre-taproot node.
1445+
# Transfer value of the largest 500 coins to pre-taproot node.
14461446
addr = self.nodes[0].getnewaddress()
1447+
1448+
unsp = self.nodes[1].listunspent()
1449+
unsp = sorted(unsp, key=lambda i: i['amount'], reverse=True)
1450+
unsp = unsp[:500]
1451+
14471452
rawtx = self.nodes[1].createrawtransaction(
14481453
inputs=[{
14491454
'txid': i['txid'],
14501455
'vout': i['vout']
1451-
} for i in self.nodes[1].listunspent()],
1452-
outputs={addr: self.nodes[1].getbalance()},
1456+
} for i in unsp],
1457+
outputs={addr: sum(i['amount'] for i in unsp)}
14531458
)
14541459
rawtx = self.nodes[1].signrawtransactionwithwallet(rawtx)['hex']
1455-
# Transaction is too large to fit into the mempool, so put it into a block
1460+
1461+
# Mine a block with the transaction
14561462
block = create_block(tmpl=self.nodes[1].getblocktemplate(NORMAL_GBT_REQUEST_PARAMS), txlist=[rawtx])
14571463
add_witness_commitment(block)
14581464
block.rehash()

0 commit comments

Comments
 (0)