get rid of pownCurrencySymbol

This commit is contained in:
fanghr 2022-04-28 17:44:18 +08:00
parent 8630b7190d
commit c47d0ca857
2 changed files with 8 additions and 17 deletions

View file

@ -78,8 +78,7 @@ import Agora.Utils (
pfindTxInByTxOutRef,
pisDJust,
pisJust,
pisUxtoSpent,
pownCurrencySymbol,
pisUTXOSpent,
psymbolValueOf,
ptxSignedBy,
pvalueSpent,
@ -95,7 +94,7 @@ import Plutarch.Api.V1 (
PDatumHash,
PMap,
PMintingPolicy,
PScriptPurpose (PSpending),
PScriptPurpose (PSpending, PMinting),
PTxOut,
PValidator,
PValidatorHash,
@ -244,12 +243,13 @@ governorPolicy :: Governor -> ClosedTerm PMintingPolicy
governorPolicy gov =
plam $ \_ ctx' -> P.do
let oref = pconstant gov.gstOutRef
ownSymbol = pownCurrencySymbol # ctx'
PMinting ((pfield @"_0" #) -> ownSymbol) <- pmatch (pfromData $ pfield @"purpose" # ctx')
mintValue <- plet $ pownMintValue # ctx'
passert "Referenced utxo should be spent" $
pisUxtoSpent # oref #$ pfield @"txInfo" # ctx'
pisUTXOSpent # oref #$ pfield @"txInfo" # ctx'
passert "Exactly one token should be minted" $
psymbolValueOf # ownSymbol # mintValue #== 1