In rust-bitcoin/rust-miniscript#476 we're sensibly changing the definition of max_satisfaction_weight to "how much more weight would satisfying this input add over TxIn::default()" but it occurred to me that we don't have a .weight() function on TxIn. I think it would be good if TxInto make this a little more concrete.
While we're there I think we might as well add it to TxOut too.
Of course we should stress in the docs that adding a TxIn (or TxOut) to the transaction does not necessarily mean that onlyTxIn::weight() is being added to the total -- it might be more if (i) that TxIn is a segwit input and there have been no segwit inputs added so far and (ii) if it causes the varint length to increase (which is applicable to TxOut too).
In rust-bitcoin/rust-miniscript#476 we're sensibly changing the definition of
max_satisfaction_weightto "how much more weight would satisfying this input add overTxIn::default()" but it occurred to me that we don't have a.weight()function onTxIn. I think it would be good ifTxInto make this a little more concrete.While we're there I think we might as well add it to
TxOuttoo.Of course we should stress in the docs that adding a
TxIn(orTxOut) to the transaction does not necessarily mean that onlyTxIn::weight()is being added to the total -- it might be more if (i) thatTxInis a segwit input and there have been no segwit inputs added so far and (ii) if it causes the varint length to increase (which is applicable toTxOuttoo).