apply suggestions
Rename `PVoting` -> `PVotingReady` to match Haskell-level
This commit is contained in:
parent
baf209843a
commit
42f74f3d37
2 changed files with 8 additions and 8 deletions
|
|
@ -488,8 +488,8 @@ deriving via
|
||||||
data PProposalStatus (s :: S)
|
data PProposalStatus (s :: S)
|
||||||
= -- | @since 0.2.0
|
= -- | @since 0.2.0
|
||||||
PDraft
|
PDraft
|
||||||
| -- | @since 0.2.0
|
| -- | @since 1.0.0
|
||||||
PVoting
|
PVotingReady
|
||||||
| -- | @since 0.2.0
|
| -- | @since 0.2.0
|
||||||
PLocked
|
PLocked
|
||||||
| -- | @since 0.2.0
|
| -- | @since 0.2.0
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import Agora.Proposal (
|
||||||
PProposalRedeemer (PAdvanceProposal, PCosign, PUnlock, PVote),
|
PProposalRedeemer (PAdvanceProposal, PCosign, PUnlock, PVote),
|
||||||
PProposalVotes (PProposalVotes),
|
PProposalVotes (PProposalVotes),
|
||||||
ProposalStatus (Draft, Finished, Locked, VotingReady),
|
ProposalStatus (Draft, Finished, Locked, VotingReady),
|
||||||
|
PProposalStatus (PDraft, PFinished, PLocked, PVotingReady),
|
||||||
pretractVotes,
|
pretractVotes,
|
||||||
pwinner',
|
pwinner',
|
||||||
)
|
)
|
||||||
|
|
@ -53,7 +54,6 @@ import Plutarch.Api.V2 (
|
||||||
import Plutarch.Extra.AssetClass (passetClass, passetClassValueOf)
|
import Plutarch.Extra.AssetClass (passetClass, passetClassValueOf)
|
||||||
import Plutarch.Extra.Comonad (pextract)
|
import Plutarch.Extra.Comonad (pextract)
|
||||||
import Plutarch.Extra.Field (pletAllC)
|
import Plutarch.Extra.Field (pletAllC)
|
||||||
import Plutarch.Extra.IsData (pmatchEnum)
|
|
||||||
import Plutarch.Extra.List (pisUniq', pmapMaybe, pmergeBy, pmsortBy)
|
import Plutarch.Extra.List (pisUniq', pmapMaybe, pmergeBy, pmsortBy)
|
||||||
import Plutarch.Extra.Map (plookup, pupdate)
|
import Plutarch.Extra.Map (plookup, pupdate)
|
||||||
import Plutarch.Extra.Maybe (passertPJust, pfromJust, pisJust)
|
import Plutarch.Extra.Maybe (passertPJust, pfromJust, pisJust)
|
||||||
|
|
@ -627,8 +627,8 @@ proposalValidator as maximumCosigners =
|
||||||
|
|
||||||
pure $ pconstant ()
|
pure $ pconstant ()
|
||||||
pure $
|
pure $
|
||||||
pmatchEnum (pto currentStatus) $ \case
|
pmatch currentStatus $ \case
|
||||||
Draft ->
|
PDraft ->
|
||||||
withMultipleStakes $ \totalStakedAmount sortedStakeOwners ->
|
withMultipleStakes $ \totalStakedAmount sortedStakeOwners ->
|
||||||
pmatchC inDraftPeriod >>= \case
|
pmatchC inDraftPeriod >>= \case
|
||||||
PTrue -> do
|
PTrue -> do
|
||||||
|
|
@ -647,8 +647,8 @@ proposalValidator as maximumCosigners =
|
||||||
pguardC "Advance to failed state" $ proposalOutStatus #== pconstant Finished
|
pguardC "Advance to failed state" $ proposalOutStatus #== pconstant Finished
|
||||||
|
|
||||||
pure $ pconstant ()
|
pure $ pconstant ()
|
||||||
Finished -> ptraceError "Finished proposals cannot be advanced"
|
PFinished -> ptraceError "Finished proposals cannot be advanced"
|
||||||
Locked -> unTermCont $ do
|
PLocked -> unTermCont $ do
|
||||||
let notTooLate = inExecutionPeriod
|
let notTooLate = inExecutionPeriod
|
||||||
notTooEarly = pnot # inLockedPeriod
|
notTooEarly = pnot # inLockedPeriod
|
||||||
pguardC "Not too early" notTooEarly
|
pguardC "Not too early" notTooEarly
|
||||||
|
|
@ -666,7 +666,7 @@ proposalValidator as maximumCosigners =
|
||||||
pure $ pconstant ()
|
pure $ pconstant ()
|
||||||
)
|
)
|
||||||
toFailedState
|
toFailedState
|
||||||
VotingReady -> unTermCont $ do
|
PVotingReady -> unTermCont $ do
|
||||||
-- Check the timings.
|
-- Check the timings.
|
||||||
let notTooLate = inLockedPeriod
|
let notTooLate = inLockedPeriod
|
||||||
notTooEarly = pnot # inVotingPeriod
|
notTooEarly = pnot # inVotingPeriod
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue