rename proposal redeemer Unlock to UnlockStake
This commit is contained in:
parent
3238335cdb
commit
9aa8557183
5 changed files with 11 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 ->
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue