Page MenuHomePhabricator

[electrum] estime tx size without serializing
ClosedPublic

Authored by PiRK on Sep 5 2023, 09:21.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC916974e1436d: [electrum] estime tx size without serializing
Summary

This removes some overhead from the transaction size estimation, by removing the need to serialize the transaction to an hexadecimal string.

Fix txinputs so it works also for inputs that don't have a "scriptSig" field (transaction that were not constructed by deserialization, partially signed transactions).
Note that input_script uses the existing "scriptSig" if available, so in this case it does not add much overhead.

Refactor the boilerplate code for checking the txid in tests, and test the tx size as well.

Depends on D14447

Test Plan

python test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
deser_tx
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24944
Build 49476: Build Diffelectrum-tests
Build 49475: arc lint + arc unit

Event Timeline

PiRK requested review of this revision.Sep 5 2023, 09:21

add a test for the size estimation of the unsigned tx

Fabien added a subscriber: Fabien.
Fabien added inline comments.
electrum/electrumabc/transaction.py
1140

nit: 4 + 4 instead of 8 so it better reflects the comment

This revision is now accepted and ready to land.Sep 5 2023, 12:20
This revision was automatically updated to reflect the committed changes.