This PR uses built-in Set and Map operations to simplify the creation of the "index of preselected UTxOs" (formerly known as the "externally selected UTxO index") within balanceTx.
Context
The caller of balanceTx can provide a partial transaction that already has inputs. These inputs must resolve to UTxOs in the reference UTxO set. Provided that all inputs can be resolved, we then construct an index of preselected UTxOs. If one or more inputs cannot be resolved, we fail with ErrBalanceTxUnresolvedInputs.
Issue
ADP-3272
Performance
Mean and standard deviation of CPU time over 8 runs of cabal test cardano-balance-tx:
This PR uses built-in
Set
andMap
operations to simplify the creation of the "index of preselected UTxOs" (formerly known as the "externally selected UTxO index") withinbalanceTx
.Context
The caller of
balanceTx
can provide a partial transaction that already has inputs. These inputs must resolve to UTxOs in the reference UTxO set. Provided that all inputs can be resolved, we then construct an index of preselected UTxOs. If one or more inputs cannot be resolved, we fail withErrBalanceTxUnresolvedInputs
.Issue
ADP-3272
Performance
Mean and standard deviation of CPU time over 8 runs of
cabal test cardano-balance-tx
:42.7 s
2.7 s
41.6 s
1.8 s
(no significant change)