apply hlint suggestions
This commit is contained in:
parent
a9df050af7
commit
bd300de832
1 changed files with 6 additions and 7 deletions
|
|
@ -54,6 +54,7 @@ import Apropos (
|
||||||
import Apropos.Gen.Contexts (scriptContext, txInInfo)
|
import Apropos.Gen.Contexts (scriptContext, txInInfo)
|
||||||
import Apropos.Gen.Value (currencySymbol)
|
import Apropos.Gen.Value (currencySymbol)
|
||||||
import Apropos.Script (ScriptModel (expect, runScriptTestsWhere, script))
|
import Apropos.Script (ScriptModel (expect, runScriptTestsWhere, script))
|
||||||
|
import Data.Bifunctor (Bifunctor (first))
|
||||||
import Data.Set (Set)
|
import Data.Set (Set)
|
||||||
import Plutarch.Api.V1 (PCurrencySymbol, PScriptContext)
|
import Plutarch.Api.V1 (PCurrencySymbol, PScriptContext)
|
||||||
import Plutarch.Builtin (pforgetData)
|
import Plutarch.Builtin (pforgetData)
|
||||||
|
|
@ -121,9 +122,7 @@ authorityTokensValidIn cs out =
|
||||||
PubKeyCredential _ -> False
|
PubKeyCredential _ -> False
|
||||||
ScriptCredential (ValidatorHash vh) ->
|
ScriptCredential (ValidatorHash vh) ->
|
||||||
all (\tn -> vh == unTokenName tn) $ keys m
|
all (\tn -> vh == unTokenName tn) $ keys m
|
||||||
in case tokenMap of
|
in maybe True validCred tokenMap
|
||||||
Nothing -> True
|
|
||||||
Just m -> validCred m
|
|
||||||
|
|
||||||
instance HasLogicalModel TreasuryTxProp TreasuryTxModel where
|
instance HasLogicalModel TreasuryTxProp TreasuryTxModel where
|
||||||
satisfiesProperty :: TreasuryTxProp -> TreasuryTxModel -> Bool
|
satisfiesProperty :: TreasuryTxProp -> TreasuryTxModel -> Bool
|
||||||
|
|
@ -177,7 +176,7 @@ replaceValue (Value v) cs tn n = Value $ unionWith (\_ x -> x) v v'
|
||||||
v' = singleton cs $ singleton tn n
|
v' = singleton cs $ singleton tn n
|
||||||
|
|
||||||
kmap :: (k -> k') -> Map k v -> Map k' v
|
kmap :: (k -> k') -> Map k v -> Map k' v
|
||||||
kmap g = fromList . fmap (\(x, y) -> (g x, y)) . toList
|
kmap g = fromList . fmap (first g) . toList
|
||||||
|
|
||||||
fixTokenNames :: TxInInfo -> TxInInfo
|
fixTokenNames :: TxInInfo -> TxInInfo
|
||||||
fixTokenNames inf =
|
fixTokenNames inf =
|
||||||
|
|
@ -271,8 +270,8 @@ instance ScriptModel TreasuryTxProp TreasuryTxModel where
|
||||||
result :: Term s POpaque
|
result :: Term s POpaque
|
||||||
result =
|
result =
|
||||||
treasuryValidator cs
|
treasuryValidator cs
|
||||||
# (pforgetData $ pdata d)
|
# pforgetData (pdata d)
|
||||||
# (pforgetData $ pdata r)
|
# pforgetData (pdata r)
|
||||||
# ctx
|
# ctx
|
||||||
|
|
||||||
cs :: CurrencySymbol
|
cs :: CurrencySymbol
|
||||||
|
|
@ -285,7 +284,7 @@ instance ScriptModel TreasuryTxProp TreasuryTxModel where
|
||||||
adaStateThread = pconstant $ CurrencySymbol ""
|
adaStateThread = pconstant $ CurrencySymbol ""
|
||||||
|
|
||||||
fields :: Term _ (PDataRecord '["stateThread" ':= PCurrencySymbol])
|
fields :: Term _ (PDataRecord '["stateThread" ':= PCurrencySymbol])
|
||||||
fields = pdcons # (pdata adaStateThread) # pdnil
|
fields = pdcons # pdata adaStateThread # pdnil
|
||||||
|
|
||||||
r :: Term s PTreasuryRedeemer
|
r :: Term s PTreasuryRedeemer
|
||||||
r = pcon $ PAlterTreasuryParams pdnil
|
r = pcon $ PAlterTreasuryParams pdnil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue