diff options
author | MacroFake <falke.marco@gmail.com> | 2022-07-01 12:27:59 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-07-01 12:29:22 +0200 |
commit | fa2924582726ee00b392bd0b5591e7d9770e1b90 (patch) | |
tree | 28d92036bc949032d9fff86628ddbfbb8c0937c6 /test/functional/test_framework | |
parent | fac3800d2c962420303ab5c61b2f02f35b9f693a (diff) |
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
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r-- | test/functional/test_framework/wallet.py | 6 |
1 files changed, 5 insertions, 1 deletions
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)] |