You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
makeTransactionBodyAutoBalance tries to compute change output by considering only inputs, minted value & outputs here but ada source could also come from stake/drep credential unregistration as well. This can cause the makeUnsignedTx function called shortly afterwards to fail as this computed change could be negative. This was not the case for cardano-api-9.1.0.0 where such a conversion was not being performed at least before the ada value in change output was set to maximum word limit.
Also, the utxo parameter expected by makeTransactionBodyAutoBalance is suppose to include reference inputs, collateral inputs as well and not just spending inputs but totalValueAtSpendableUTxO seems to suggest that it's only spending inputs. This is not a big deal if our goal is just to overestimate but thought I'd also mention this misnomer.
Version
Using tag cardano-api-10.1.0.0.
The text was updated successfully, but these errors were encountered:
Thank you for the detailed analysis and a proposed fix! I confirm that GHC exception is being thrown at the beginning of makeTransactionBodyAutoBalance when the calculated change is negative.
External
Area
Tx balancing.
Summary
makeTransactionBodyAutoBalance
tries to compute change output by considering only inputs, minted value & outputs here but ada source could also come from stake/drep credential unregistration as well. This can cause themakeUnsignedTx
function called shortly afterwards to fail as this computed change could be negative. This was not the case forcardano-api-9.1.0.0
where such a conversion was not being performed at least before the ada value in change output was set to maximum word limit.Also, the
utxo
parameter expected bymakeTransactionBodyAutoBalance
is suppose to include reference inputs, collateral inputs as well and not just spending inputs buttotalValueAtSpendableUTxO
seems to suggest that it's only spending inputs. This is not a big deal if our goal is just to overestimate but thought I'd also mention this misnomer.Version
Using tag
cardano-api-10.1.0.0
.The text was updated successfully, but these errors were encountered: