rename redeemer MutateDatum to MutateParams

This commit is contained in:
fanghr 2022-04-16 13:56:39 +08:00
parent 1e9ff7d8f4
commit f30ca26ea5

View file

@ -68,6 +68,8 @@ PlutusTx.makeIsDataIndexed ''GovernorDatum [('GovernorDatum, 0)]
1. The gating of Proposal creation. 1. The gating of Proposal creation.
2. The gating of minting authority tokens. 2. The gating of minting authority tokens.
Parameters of the governor can also be mutated by an effect.
-} -}
data GovernorRedeemer data GovernorRedeemer
= -- | Checks that a proposal was created lawfully, and allows it. = -- | Checks that a proposal was created lawfully, and allows it.
@ -75,15 +77,15 @@ data GovernorRedeemer
| -- | Checks that a SINGLE proposal finished correctly, | -- | Checks that a SINGLE proposal finished correctly,
-- and allows minting GATs for each effect script. -- and allows minting GATs for each effect script.
MintGATs MintGATs
| -- | Allows effects to mutate the datum. | -- | Allows effects to mutate the parameters.
MutateDatum MutateParams
deriving stock (Show, GHC.Generic) deriving stock (Show, GHC.Generic)
PlutusTx.makeIsDataIndexed PlutusTx.makeIsDataIndexed
''GovernorRedeemer ''GovernorRedeemer
[ ('CreateProposal, 0) [ ('CreateProposal, 0)
, ('MintGATs, 1) , ('MintGATs, 1)
, ('MutateDatum, 2) , ('MutateParams, 2)
] ]
-- | Parameters for creating Governor scripts. -- | Parameters for creating Governor scripts.
@ -119,7 +121,7 @@ deriving via (DerivePConstantViaData GovernorDatum PGovernorDatum) instance (PCo
data PGovernorRedeemer (s :: S) data PGovernorRedeemer (s :: S)
= PCreateProposal (Term s (PDataRecord '[])) = PCreateProposal (Term s (PDataRecord '[]))
| PMintGATs (Term s (PDataRecord '[])) | PMintGATs (Term s (PDataRecord '[]))
| PMutateDatum (Term s (PDataRecord '[])) | PMutateParams (Term s (PDataRecord '[]))
deriving stock (GHC.Generic) deriving stock (GHC.Generic)
deriving anyclass (Generic) deriving anyclass (Generic)
deriving anyclass (PIsDataRepr) deriving anyclass (PIsDataRepr)
@ -181,7 +183,7 @@ governorValidator params =
ptraceError "not implemented yet" ptraceError "not implemented yet"
PMintGATs _ -> perror PMintGATs _ -> perror
PMutateDatum _ -> perror PMutateParams _ -> perror
where where
datumNFTValueOf :: Term s (PValue :--> PInteger) datumNFTValueOf :: Term s (PValue :--> PInteger)
datumNFTValueOf = passetClassValueOf' params.datumNFT datumNFTValueOf = passetClassValueOf' params.datumNFT