check only PST is minted while creating proposals

This commit is contained in:
方泓睿 2022-09-15 21:41:08 +08:00
parent e6eb21988b
commit bf1b4692fc
2 changed files with 48 additions and 44 deletions

View file

@ -311,10 +311,14 @@ governorValidator as =
pguardC "Exactly one proposal token must be minted" $
let vMap = pfromData $ pto txInfoF.mint
tnMap = plookup # ppstSymbol # vMap
in pmaybe
# pconstant False
# plam (#== AssocMap.psingleton # pconstant "" # 1)
# tnMap
-- Ada and PST
onlyPST = plength # pto vMap #== 2
onePST =
pmaybe
# pconstant False
# plam (#== AssocMap.psingleton # pconstant "" # 1)
# tnMap
in onlyPST #&& onePST
-- Check that a stake is spent to create the propsal,
-- and the value it contains meets the requirement.