Skip to content

Commit

Permalink
Inline definition of withOutputsIndexed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Feb 6, 2024
1 parent 231627b commit 30abe73
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/balance-tx/lib/internal/Internal/Cardano/Write/Tx/Balance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1589,15 +1589,14 @@ validateTxOutputs constraints outs =
where
errors :: [ErrBalanceTxOutputError]
errors = uncurry ErrBalanceTxOutputErrorOf <$> F.fold
[ withOutputsIndexed $
mapMaybe (traverse (validateTxOutputSize constraints))
, withOutputsIndexed $
foldMap (traverse validateTxOutputTokenQuantities)
, withOutputsIndexed $
mapMaybe (traverse (validateTxOutputAdaQuantity constraints))
[ mapMaybe (traverse (validateTxOutputSize constraints))
outputsIndexed
, foldMap (traverse validateTxOutputTokenQuantities)
outputsIndexed
, mapMaybe (traverse (validateTxOutputAdaQuantity constraints))
outputsIndexed
]
where
withOutputsIndexed f = f outputsIndexed
outputsIndexed = zip [0 ..] outs

-- | Validates the size of a transaction output.
Expand Down

0 comments on commit 30abe73

Please sign in to comment.