HomePhabricator

[electrum] add a TxInput class

Description

[electrum] add a TxInput class

Summary:
The end goal is to replace the clumsy "coin" dictionary full of hex strings by this more lightweight object.

An intermediate goal is to use its size() method to compute/estimate transaction sizes without having to construct and serialize the tx.
This will likely yield a performance improvement for some operation and allow the coinchooser to not produce transactions that can't be relayed due to the maximum 100 kB size policy.

The __eq__ methods in OutPoint and TxInput are used for testing equality between two instances.
The __str__ methods are implemented for convenience/debugging, as they make assertEqual produce a more helpful log in case a test fails.

Depends on D14433

Test Plan: python test_runner.py

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien, bytesofman

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

Details

Provenance
PiRKAuthored on Aug 29 2023, 16:27
PiRKPushed on Sep 1 2023, 07:39
Reviewer
Restricted Project
Differential Revision
D14434: [electrum] add a TxInput class
Parents
rABC66da2d63d45d: [electrum] remove dead servers
Branches
Unknown
Tags
Unknown