Skip to content

Commit 4729b71

Browse files
Jimbo4350gandawa
authored andcommitted
Propagate HasCallStack through fee calculation callers
Add HasCallStack to calcMinFeeRecursive, estimateOrCalculateBalancedTxBody, and constructBalancedTx, which call balanceTxOuts, makeTransactionBodyAutoBalance, estimateBalancedTxBody, and calculateMinimumUTxO that already carry the constraint.
1 parent 696dce8 commit 4729b71

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Fee.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,8 @@ instance Error FeeCalculationError where
751751
-- In practice convergence occurs within 2–3 iterations.
752752
calcMinFeeRecursive
753753
:: forall era
754-
. IsEra era
754+
. HasCallStack
755+
=> IsEra era
755756
=> L.Addr
756757
-- ^ Change address. Any surplus value (ADA and/or native tokens) is
757758
-- sent to a new output at this address, appended at the end of the

cardano-api/src/Cardano/Api/Tx/Internal/Convenience.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ import Data.Map.Strict qualified as Map
3434
import Data.Set (Set)
3535
import Data.Text qualified as Text
3636
import GHC.Exts (IsList (..))
37+
import GHC.Stack (HasCallStack)
3738

3839
-- | Construct a balanced transaction.
3940
-- See Cardano.Api.Query.Internal.Convenience.queryStateForBalancedTx for a
4041
-- convenient way of querying the node to get the required arguements
4142
-- for constructBalancedTx.
4243
constructBalancedTx
4344
:: ()
45+
=> HasCallStack
4446
=> ShelleyBasedEra era
4547
-> TxBodyContent BuildTx era
4648
-> AddressInEra era

cardano-api/src/Cardano/Api/Tx/Internal/Fee.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ instance Error (AutoBalanceError era) where
124124
AutoBalanceCalculationError e -> prettyError e
125125

126126
estimateOrCalculateBalancedTxBody
127-
:: ShelleyBasedEra era
127+
:: HasCallStack
128+
=> ShelleyBasedEra era
128129
-> FeeEstimationMode era
129130
-> L.PParams (ShelleyLedgerEra era)
130131
-> TxBodyContent BuildTx era

0 commit comments

Comments
 (0)