From fa2924582726ee00b392bd0b5591e7d9770e1b90 Mon Sep 17 00:00:00 2001 From: MacroFake Date: Fri, 1 Jul 2022 12:27:59 +0200 Subject: test: Allow setting sequence per input in MiniWallet create_self_transfer_multi Previously it was only possible to set the same sequence in all inputs --- test/functional/test_framework/wallet.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py index 6c83a40347..7ab54618c8 100644 --- a/test/functional/test_framework/wallet.py +++ b/test/functional/test_framework/wallet.py @@ -242,13 +242,17 @@ class MiniWallet: set by amount_per_output or automatically calculated with a fee_per_output. """ utxos_to_spend = utxos_to_spend or [self.get_utxo()] + sequence = [sequence] * len(utxos_to_spend) if type(sequence) is int else sequence + assert_equal(len(utxos_to_spend), len(sequence)) # create simple tx template (1 input, 1 output) tx = self.create_self_transfer( fee_rate=0, - utxo_to_spend=utxos_to_spend[0], sequence=sequence)["tx"] + utxo_to_spend=utxos_to_spend[0])["tx"] # duplicate inputs, witnesses and outputs tx.vin = [deepcopy(tx.vin[0]) for _ in range(len(utxos_to_spend))] + for txin, seq in zip(tx.vin, sequence): + txin.nSequence = seq tx.wit.vtxinwit = [deepcopy(tx.wit.vtxinwit[0]) for _ in range(len(utxos_to_spend))] tx.vout = [deepcopy(tx.vout[0]) for _ in range(num_outputs)] -- cgit v1.2.3