From df195073d7bc7d349a973d0b22286f87ef8449cf Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 18 Apr 2024 04:26:34 +0000 Subject: [PATCH] Move `adjustedPartialTx` to `where` clause and add type signature. --- .../lib/internal/Internal/Cardano/Write/Tx/Balance.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Balance.hs b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Balance.hs index 54a47bbdc60..c2096943c37 100644 --- a/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Balance.hs +++ b/lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Balance.hs @@ -531,9 +531,7 @@ balanceTransaction s partialTx = do - let adjustedPartialTx = flip (over #tx) partialTx $ - assignMinimalAdaQuantitiesToOutputsWithoutAda pp - balanceWith strategy = + let balanceWith strategy = balanceTransactionWithSelectionStrategyAndNoZeroAdaAdjustment pp timeTranslation @@ -549,6 +547,10 @@ balanceTransaction then balanceWith SelectionStrategyMinimal else throwE e where + adjustedPartialTx :: PartialTx era + adjustedPartialTx = flip (over #tx) partialTx $ + assignMinimalAdaQuantitiesToOutputsWithoutAda pp + -- Determines whether or not the minimal selection strategy is worth trying. -- This depends upon the way in which the optimal selection strategy failed. minimalStrategyIsWorthTrying :: ErrBalanceTx era -> Bool