Skip to content

Commit

Permalink
Use isDust to simplify noDust.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed May 12, 2020
1 parent 0d9b066 commit a842a82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/library/Cardano/CoinSelection/Algorithm/Migration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import Cardano.CoinSelection.Fee
, FeeBalancingPolicy (..)
, FeeEstimator (..)
, FeeOptions (..)
, isDust
)
import Control.Monad.Trans.State
( State, evalState, get, put )
Expand Down Expand Up @@ -124,7 +125,7 @@ selectCoins options (BatchSize batchSize) utxo =
threshold = unDustThreshold dustThreshold
noDust :: Coin -> Maybe Coin
noDust c
| c <= threshold = Nothing
| isDust dustThreshold c = Nothing
| otherwise = Just c

-- | Attempt to balance the coin selection by reducing or increasing the
Expand Down
1 change: 1 addition & 0 deletions src/library/Cardano/CoinSelection/Fee.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module Cardano.CoinSelection.Fee

-- * Dust Processing
, DustThreshold (..)
, isDust
, coalesceDust

-- # Internal Functions
Expand Down

0 comments on commit a842a82

Please sign in to comment.