countingVote,create,startVoting to execute,create,vote
Let's embrace consistancy between Haskell types and Plutarch types.
This commit is contained in:
parent
014ef050d2
commit
8e9dd16613
7 changed files with 18 additions and 18 deletions
|
|
@ -189,11 +189,11 @@ governorDatumValid = phoistAcyclic $
|
|||
plam $ \datum -> unTermCont $ do
|
||||
thresholds <-
|
||||
tcont $
|
||||
pletFields @'["execute", "draft", "vote"] $
|
||||
pletFields @'["execute", "create", "vote"] $
|
||||
pfield @"proposalThresholds" # datum
|
||||
|
||||
PDiscrete execute' <- pmatchC thresholds.execute
|
||||
PDiscrete draft' <- pmatchC thresholds.draft
|
||||
PDiscrete draft' <- pmatchC thresholds.create
|
||||
PDiscrete vote' <- pmatchC thresholds.vote
|
||||
|
||||
execute <- tclet $ pextract # execute'
|
||||
|
|
|
|||
|
|
@ -140,14 +140,14 @@ PlutusTx.makeIsDataIndexed ''ProposalStatus [('Draft, 0), ('VotingReady, 1), ('L
|
|||
to 'Proposal's when they are created.
|
||||
-}
|
||||
data ProposalThresholds = ProposalThresholds
|
||||
{ countVoting :: Tagged GTTag Integer
|
||||
{ execute :: Tagged GTTag Integer
|
||||
-- ^ How much GT minimum must a particular 'ResultTag' accumulate for it to pass.
|
||||
, create :: Tagged GTTag Integer
|
||||
-- ^ How much GT required to "create" a proposal.
|
||||
--
|
||||
-- It is recommended this be a high enough amount, in order to prevent DOS from bad
|
||||
-- actors.
|
||||
, startVoting :: Tagged GTTag Integer
|
||||
, vote :: Tagged GTTag Integer
|
||||
-- ^ How much GT required to allow voting to happen.
|
||||
-- (i.e. to move into 'VotingReady')
|
||||
}
|
||||
|
|
@ -327,7 +327,7 @@ newtype PProposalThresholds (s :: S) = PProposalThresholds
|
|||
s
|
||||
( PDataRecord
|
||||
'[ "execute" ':= PDiscrete GTTag
|
||||
, "draft" ':= PDiscrete GTTag
|
||||
, "create" ':= PDiscrete GTTag
|
||||
, "vote" ':= PDiscrete GTTag
|
||||
]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue