Page MenuHomePhabricator

[electrum] check output type in Transaction and fix a callsites that still passes a regular tuple
ClosedPublic

Authored by PiRK on Sep 20 2023, 08:12.

Details

Summary

As of D14448, the transaction size estimation requires outputs to be a TxOutput. As of D14502, the tx serializaation also requires a TxOuput.
Enforce this with assertions in the various output setters in Transaction, add typehints to functions that call these setters.

Fix a callsite in the fusion plugin that was still passing a regular tuple.

Test Plan

python test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Sep 20 2023, 08:12
Fabien added inline comments.
electrum/electrumabc/transaction.py
1154 ↗(On Diff #42284)

is that really needed since you have the type hints ?

Fabien added inline comments.
electrum/electrumabc/transaction.py
1154 ↗(On Diff #42284)

That's a linter job that's not enabled on this code yet (mypy)

This revision is now accepted and ready to land.Sep 20 2023, 09:41