apply naming suggestions from Emily and Seungheon

* `pid` -> `id`
*  `MutateParams` -> `MutateGovernor`
This commit is contained in:
fanghr 2022-04-17 12:07:06 +08:00
parent be16b80459
commit dd99543449
2 changed files with 5 additions and 5 deletions

View file

@ -100,14 +100,14 @@ data GovernorRedeemer
-- and allows minting GATs for each effect script. -- and allows minting GATs for each effect script.
MintGATs MintGATs
| -- | Allows effects to mutate the parameters. | -- | Allows effects to mutate the parameters.
MutateParams MutateMutateGovernor
deriving stock (Show, GHC.Generic) deriving stock (Show, GHC.Generic)
PlutusTx.makeIsDataIndexed PlutusTx.makeIsDataIndexed
''GovernorRedeemer ''GovernorRedeemer
[ ('CreateProposal, 0) [ ('CreateProposal, 0)
, ('MintGATs, 1) , ('MintGATs, 1)
, ('MutateParams, 2) , ('MutateMutateGovernor, 2)
] ]
-- | Parameters for creating Governor scripts. -- | Parameters for creating Governor scripts.
@ -145,7 +145,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 '[]))
| PMutateParams (Term s (PDataRecord '[])) | PMutateGovernor (Term s (PDataRecord '[]))
deriving stock (GHC.Generic) deriving stock (GHC.Generic)
deriving anyclass (Generic) deriving anyclass (Generic)
deriving anyclass (PIsDataRepr) deriving anyclass (PIsDataRepr)
@ -223,7 +223,7 @@ governorValidator params =
-- TODO: waiting for impl of proposal -- TODO: waiting for impl of proposal
ptraceError "Not implemented yet" ptraceError "Not implemented yet"
PMutateParams _ -> P.do PMutateGovernor _ -> P.do
-- check that input has exactly one GAT and will be burnt -- check that input has exactly one GAT and will be burnt
let gatAmount = psymbolValueOf # gatS # mint let gatAmount = psymbolValueOf # gatS # mint
passert "One GAT should be burnt" $ gatAmount #== -1 passert "One GAT should be burnt" $ gatAmount #== -1

View file

@ -441,4 +441,4 @@ proposalDatumValid proposal =
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
pnextProposalId :: Term s (PProposalId :--> PProposalId) pnextProposalId :: Term s (PProposalId :--> PProposalId)
pnextProposalId = phoistAcyclic $ plam $ \(pto -> id) -> pcon $ PProposalId $ id + 1 pnextProposalId = phoistAcyclic $ plam $ \(pto -> pid) -> pcon $ PProposalId $ pid + 1