Skip to content

Commit

Permalink
ValueParser: expose new functions that avoid using the role
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Nov 6, 2024
1 parent dae49f1 commit 273e276
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cardano-api/internal/Cardano/Api/ValueParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

module Cardano.Api.ValueParser
( parseValue
, parseTxOutMultiAssetValue
, parseMintingMultiAssetValue
, parseUTxOValue
, assetName
, policyId
, ValueRole (..)
Expand Down Expand Up @@ -59,6 +62,15 @@ parseValue role = do
"Lovelace must be zero in minting value: " <> show value
return value

parseTxOutMultiAssetValue :: Parser Value
parseTxOutMultiAssetValue = parseValue RoleUTxO

parseMintingMultiAssetValue :: Parser Value
parseMintingMultiAssetValue = parseValue RoleMint

parseUTxOValue :: Parser Value
parseUTxOValue = parseValue RoleUTxO

-- | Evaluate a 'ValueExpr' and construct a 'Value'.
evalValueExpr :: ValueExpr -> Value
evalValueExpr vExpr =
Expand Down

0 comments on commit 273e276

Please sign in to comment.