ITADN

Extract transaction evaluation pipeline from cardano-rpc into cardano-api

#1204Opencarbolymer 创建于 2026-05-14
C
carbolymercommented
## Summary Following review feedback on #1193, the transaction evaluation pipeline in `evalTxMethod` should be extracted from `cardano-rpc` into `cardano-api` as a reusable function. ## Motivation cardano-api has the individual building blocks for transaction evaluation: - `evaluateTransactionExecutionUnits` - evaluates scripts, returns per-redeemer units - `evaluateTransactionFee` - computes fee (needs units already substituted) - `evaluateTransactionBalance` - checks balance (needs fee already set) - `makeTransactionBodyAutoBalance` - does everything, but also adds a change output There is no function that runs the **evaluate + compute fee + check balance** pipeline without constructing a change output. `evalTxMethod` in cardano-rpc fills this gap as a read-only diagnostic: "here's what your tx would cost and whether it's balanced", without modifying the transaction. Currently cardano-rpc orchestrates this manually using ledger internals (`setMinFeeTxUtxo`, `evalBalanceTxBody`, redeemer substitution). This sequencing logic would be useful as a standalone cardano-api function. ## Scope - Add a function to cardano-api that takes a signed transaction, protocol parameters, UTxO, and ledger context, and returns per-redeemer execution units (or errors), computed minimum fee, and transaction balance - without adding a change output - Refactor `evalTxMethod` to use this new function ## Context - PR: #1193 - Review comment from Jimbo4350
0 条评论