HomePhabricator

[electrum] use TxInput (almost) everywhere in transaction.py

Description

[electrum] use TxInput (almost) everywhere in transaction.py

Summary:
This makes the Transaction class use TxInput everywhere internally, except for a few remaining methods that work with fetched_inputs which still need to be converted.

Input setters and their callsites are also converted:

  • Transaction.add_inputs
  • Transaction.set_inputs
  • Transaction.update_input
  • Transaction.from_io

As of this diff, sweep uses TxInput objects to estimate the tx size, so the test needs to be adjusted to have properly formed scriptsigs that can be parsed by TxInput.

Depends on D14510

Test Plan:
python test_runner.py

Send and receive transaction with the application.
Send transactions with hardware wallet.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
PiRKAuthored on Sep 19 2023, 14:35
PiRKPushed on Sep 20 2023, 15:26
Reviewer
Restricted Project
Differential Revision
D14472: [electrum] use TxInput (almost) everywhere in transaction.py
Parents
rABC0f414650168d: [electrum] add prev_tx to TxInput
Branches
Unknown
Tags
Unknown