tag TokenName with ValidatorHash of script ST is sent to

This commit is contained in:
Emily Martins 2022-02-22 22:26:26 +01:00
parent b5ea62ca4d
commit b48d797747
2 changed files with 34 additions and 15 deletions

View file

@ -95,6 +95,17 @@ pexpectJust escape ma f =
PJust v -> f v
PNothing -> escape
-- | Get the sum of all values belonging to a particular CurrencySymbol
psymbolValueOf :: Term s (PCurrencySymbol :--> PValue :--> PInteger)
psymbolValueOf =
phoistAcyclic $
plam $ \sym value'' -> P.do
PValue value' <- pmatch value''
PMap value <- pmatch value'
m' <- pexpectJust 0 (plookup # pdata sym # value)
PMap m <- pmatch (pfromData m')
pfoldr # (plam $ \x v -> (pfromData $ psndBuiltin # x) + v) # 0 # m
passetClassValueOf ::
Term s (PCurrencySymbol :--> PTokenName :--> PValue :--> PInteger)
passetClassValueOf =