Skip to content

Commit

Permalink
foldMap
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mueller committed Mar 2, 2021
1 parent 9cb6f31 commit 84dce88
Show file tree
Hide file tree
Showing 6 changed files with 20,765 additions and 20,895 deletions.
8 changes: 2 additions & 6 deletions plutus-ledger-api/src/Plutus/V1/Ledger/Contexts.hs
Expand Up @@ -265,16 +265,12 @@ signsTransaction (Signature sig) (PubKey (LedgerBytes pk)) (TxInfo{txInfoId=TxId
{-# INLINABLE valueSpent #-}
-- | Get the total value of inputs spent by this transaction.
valueSpent :: TxInfo -> Value
valueSpent p =
let inputs' = map txInInfoValue (txInfoInputs p)
in mconcat inputs'
valueSpent = foldMap txInInfoValue . txInfoInputs

{-# INLINABLE valueProduced #-}
-- | Get the total value of outputs produced by this transaction.
valueProduced :: TxInfo -> Value
valueProduced p =
let inputs' = map txOutValue (txInfoOutputs p)
in mconcat inputs'
valueProduced = foldMap txOutValue . txInfoOutputs

{-# INLINABLE ownCurrencySymbol #-}
-- | The 'CurrencySymbol' of the current validator script.
Expand Down

0 comments on commit 84dce88

Please sign in to comment.