diff --git a/agora-specs/Sample/Proposal/PrivilegeEscalate.hs b/agora-specs/Sample/Proposal/PrivilegeEscalate.hs index 24f4e30..2c305de 100644 --- a/agora-specs/Sample/Proposal/PrivilegeEscalate.hs +++ b/agora-specs/Sample/Proposal/PrivilegeEscalate.hs @@ -8,7 +8,7 @@ module Sample.Proposal.PrivilegeEscalate ( import Agora.Proposal ( ProposalDatum (..), ProposalId (ProposalId), - ProposalRedeemer (Unlock, Vote), + ProposalRedeemer (UnlockStake, Vote), ProposalStatus (VotingReady), ProposalVotes (ProposalVotes), ResultTag (ResultTag), @@ -102,7 +102,7 @@ mkProposalInputOutputDatum op = in wrap op (,) proposal proposalWithVotes mkProposalRedeemer :: Operation -> ProposalRedeemer -mkProposalRedeemer op = wrap op const (Vote defResultTag) Unlock +mkProposalRedeemer op = wrap op const (Vote defResultTag) UnlockStake proposalRef :: TxOutRef proposalRef = TxOutRef proposalTxRef 1 diff --git a/agora-specs/Sample/Proposal/Unlock.hs b/agora-specs/Sample/Proposal/Unlock.hs index 09f30e4..e36ba5f 100644 --- a/agora-specs/Sample/Proposal/Unlock.hs +++ b/agora-specs/Sample/Proposal/Unlock.hs @@ -35,7 +35,7 @@ import Agora.Proposal ( ProposalDatum (..), ProposalEffectGroup, ProposalId (..), - ProposalRedeemer (Unlock), + ProposalRedeemer (UnlockStake), ProposalStatus (..), ProposalVotes (..), ResultTag (..), @@ -210,7 +210,7 @@ proposalRef :: TxOutRef proposalRef = TxOutRef stakeTxRef 0 proposalRedeemer :: ProposalRedeemer -proposalRedeemer = Unlock +proposalRedeemer = UnlockStake mkProposalInputDatum :: StakeParameters -> diff --git a/agora/Agora/Proposal.hs b/agora/Agora/Proposal.hs index 9ef0ed7..652b330 100644 --- a/agora/Agora/Proposal.hs +++ b/agora/Agora/Proposal.hs @@ -381,7 +381,7 @@ data ProposalRedeemer -- proposal, provided enough GT is shared among them. Cosign | -- | Allow unlocking one or more stakes with votes towards particular 'ResultTag'. - Unlock + UnlockStake | -- | Advance the proposal, performing the required checks for whether that is legal. -- -- These are roughly the checks for each possible transition: @@ -421,7 +421,7 @@ PlutusTx.makeIsDataIndexed ''ProposalRedeemer [ ('Vote, 0) , ('Cosign, 1) - , ('Unlock, 2) + , ('UnlockStake, 2) , ('AdvanceProposal, 3) ] @@ -750,7 +750,7 @@ deriving via (DerivePConstantViaDataList ProposalDatum PProposalDatum) instance data PProposalRedeemer (s :: S) = PVote (Term s (PDataRecord '["resultTag" ':= PResultTag])) | PCosign (Term s (PDataRecord '[])) - | PUnlock (Term s (PDataRecord '[])) + | PUnlockStake (Term s (PDataRecord '[])) | PAdvanceProposal (Term s (PDataRecord '[])) deriving stock ( -- | @since 0.1.0 diff --git a/agora/Agora/Proposal/Scripts.hs b/agora/Agora/Proposal/Scripts.hs index 69b139e..bfff2b4 100644 --- a/agora/Agora/Proposal/Scripts.hs +++ b/agora/Agora/Proposal/Scripts.hs @@ -12,7 +12,7 @@ module Agora.Proposal.Scripts ( import Agora.Proposal ( PProposalDatum (PProposalDatum), - PProposalRedeemer (PAdvanceProposal, PCosign, PUnlock, PVote), + PProposalRedeemer (PAdvanceProposal, PCosign, PUnlockStake, PVote), PProposalStatus (PDraft, PFinished, PLocked, PVotingReady), PProposalVotes (PProposalVotes), ProposalStatus (Draft, Finished, Locked, VotingReady), @@ -520,7 +520,7 @@ proposalValidator = ---------------------------------------------------------------------- - PUnlock _ -> spendStakes $ \sctxF -> do + PUnlockStake _ -> spendStakes $ \sctxF -> do let expectedVotes = pfoldl # plam diff --git a/agora/Agora/Stake/Redeemers.hs b/agora/Agora/Stake/Redeemers.hs index 052dabb..f03e9aa 100644 --- a/agora/Agora/Stake/Redeemers.hs +++ b/agora/Agora/Stake/Redeemers.hs @@ -16,7 +16,7 @@ module Agora.Stake.Redeemers ( import Agora.Proposal ( PProposalId, - PProposalRedeemer (PCosign, PUnlock, PVote), + PProposalRedeemer (PCosign, PUnlockStake, PVote), ProposalStatus (Finished), ) import Agora.Stake ( @@ -266,7 +266,7 @@ pretractVote = pvoteHelper #$ phoistAcyclic $ flip pmatch $ \ctxF -> pmatch ctxF.proposalContext $ \case PSpendProposal pid s r -> pmatch r $ \case - PUnlock _ -> + PUnlockStake _ -> let mode = pif (s #== pconstant Finished)