Skip to content

Commit

Permalink
Use utxoBalanceShortfall in Cardano.CoinSelection.BalanceSpec.
Browse files Browse the repository at this point in the history
Instead of using the `balanceMissing` function (which is now just a lens
on the `utxoBalanceShortfall` field), we use the `utxoBalanceShortfall`
field directly.
  • Loading branch information
jonathanknowles committed Feb 6, 2023
1 parent 42a4da7 commit 3146e8d
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -65,7 +65,6 @@ import Cardano.CoinSelection.Balance
, addMintValuesToChangeMaps
, assetSelectionLens
, assignCoinsToChangeMaps
, balanceMissing
, coinSelectionLens
, collateNonUserSpecifiedAssetQuantities
, computeDeficitInOut
Expand Down Expand Up @@ -994,7 +993,7 @@ prop_performSelection mockConstraints params coverage =
"available balance" $
report utxoBalanceRequired
"required balance" $
report (balanceMissing e)
report errorBalanceShortfall
"missing balance" $
verify
(not $ isUTxOBalanceSufficient params)
Expand All @@ -1006,14 +1005,16 @@ prop_performSelection mockConstraints params coverage =
(utxoBalanceRequired == errorBalanceRequired)
"utxoBalanceRequired == errorBalanceRequired" $
verify
(balanceMissing e == view #difference utxoBalanceSufficiencyInfo)
"balanceMissing e == view #difference utxoBalanceSufficiencyInfo" $
(errorBalanceShortfall == balanceSufficiencyShortfall)
"errorBalanceShortfall == balanceSufficiencyShortfall" $
property True
where
balanceSufficiencyShortfall =
view #difference utxoBalanceSufficiencyInfo
BalanceInsufficientError
errorBalanceAvailable
errorBalanceRequired
_errorBalanceShortfall = e
errorBalanceShortfall = e

onSelectionLimitReached
:: SelectionLimitReachedError TestSelectionContext -> Property
Expand Down

0 comments on commit 3146e8d

Please sign in to comment.