Skip to content

Commit

Permalink
Add a note in the Haddock of currencySymbolValueOf (#6444)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliu41 committed Sep 4, 2024
1 parent 365a39d commit 02e63ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plutus-ledger-api/src/PlutusLedgerApi/V1/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ valueOf (Value mp) cur tn =
{-# INLINABLE currencySymbolValueOf #-}
-- | Get the total value of the currency symbol in the 'Value' map.
-- Assumes that the underlying map doesn't contain duplicate keys.
--
-- Note that each token of the currency symbol may have a value that is positive,
-- zero or negative.
currencySymbolValueOf :: Value -> CurrencySymbol -> Integer
currencySymbolValueOf (Value mp) cur = case Map.lookup cur mp of
Nothing -> 0
Expand Down

0 comments on commit 02e63ba

Please sign in to comment.