HomePhabricator

[electrum] use an IntEnum for script types

Description

[electrum] use an IntEnum for script types

Summary:
This simplifies the code and makes it more typesafe.

The plan is to use this enum in the TxInput class and eventually in coin dicts to replace the "p2pkh", "p2sh", "p2pk" and "coinbase" strings (utxo["type"]).

Depends on D14434

Test Plan:
python test_runner.py

I also ran the new test_privkey_from_WIF_privkey before this commit, to check that the behavior didn't change.

Run the application (electrum/electrum-abc), send a transaction to be sure the transaction construction/serialization/deserialization still works.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Aug 30 2023, 14:34
PiRKPushed on Sep 1 2023, 07:39
Reviewer
Restricted Project
Differential Revision
D14436: [electrum] use an IntEnum for script types
Parents
rABCb4412e42c6c6: [electrum] add a TxInput class
Branches
Unknown
Tags
Unknown