HomePhabricator

[electrum] use the default sequence as fallback for Transaction.txinputs()

Description

[electrum] use the default sequence as fallback for Transaction.txinputs()

Summary:
The sequence is not necessarily defined for transaction inputs. As the tx size estimation now depends on txinputs, it needs to work when building a fresh transaction from inputs and outputs. Use the default sequence, like the rest of the Transaction code does in this case.

Add a unit test to catch this particular regression.

Also add __hash__ methods to the various objects so that TxInput can be used in sets. This simplifies the comparison of randomized lists of inputs.

Test Plan:
python test_runner.py

In the application, go to the send tab, paste an address and type in a value, click "preview" and check that there is no error pop-up.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14454

Details

Provenance
PiRKAuthored on Sep 6 2023, 06:53
PiRKPushed on Sep 6 2023, 11:09
Reviewer
Restricted Project
Differential Revision
D14454: [electrum] use the default sequence as fallback for Transaction.txinputs()
Parents
rABC71354da40087: [mock-chronik-client] minor README formatting updates
Branches
Unknown
Tags
Unknown