atlas icon indicating copy to clipboard operation
atlas copied to clipboard

Return `GYBalancedTx` (or similar) when raising `BuildTxBodyErrorAutoBalance` to have more information

Open TotallyNotChase opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. Currently, when BuildTxBodyErrorAutoBalance is raised, there is barely any information about what really happened. Especially when a validator error is raised.

Describe the solution you'd like It'd be useful to return our balanced transaction (as selecting inputs and collateral can indeed influence script behavior) with the error.

Describe alternatives you've considered N/A

Additional context The addition is simple. Amend the BuildTxBodyErrorAutoBalance constructor to contain GYBalancedTx and amend attach this data type within makeTransactionBodyAutoBalanceWrapper. It should not prompt any API changes.

TotallyNotChase avatar Jul 10 '24 03:07 TotallyNotChase

I might have a better idea actually. I've been looking into the ledger and realized that I might be able to add the ability to retrieve the exact ScriptContext used with every plutus script in a transaction into CLB. Which means we can see it during validation failures in the "emulator log".

TotallyNotChase avatar Jul 24 '24 00:07 TotallyNotChase