Merge pull request #120 from Liqwid-Labs/seungheonoh/renameProposalThreshold

`countingVote`,`create`,`startVoting` to `execute`,`create`,`vote`
This commit is contained in:
Emily 2022-06-16 20:49:02 +02:00 committed by GitHub
commit 25f7f58880
7 changed files with 18 additions and 18 deletions

View file

@ -185,7 +185,7 @@ invalidNewGovernorDatum =
GovernorDatum GovernorDatum
{ proposalThresholds = { proposalThresholds =
def def
{ countVoting = Tagged (-1) { vote = Tagged (-1)
} }
, nextProposalId = ProposalId 42 , nextProposalId = ProposalId 42
, proposalTimings = def , proposalTimings = def

View file

@ -532,7 +532,7 @@ advanceProposalSuccess params =
outcome0WinningVotes = outcome0WinningVotes =
ProposalVotes $ ProposalVotes $
updateMap updateMap
(\_ -> Just $ untag (def :: ProposalThresholds).countVoting + 1) (\_ -> Just $ untag (def :: ProposalThresholds).vote + 1)
(ResultTag 0) (ResultTag 0)
emptyVotes' emptyVotes'
@ -611,7 +611,7 @@ advanceProposalFailureTimeout params =
outcome0WinningVotes = outcome0WinningVotes =
ProposalVotes $ ProposalVotes $
updateMap updateMap
(\_ -> Just $ untag (def :: ProposalThresholds).countVoting + 1) (\_ -> Just $ untag (def :: ProposalThresholds).vote + 1)
(ResultTag 0) (ResultTag 0)
emptyVotes' emptyVotes'
@ -720,7 +720,7 @@ advanceFinishedPropsoal =
outcome0WinningVotes = outcome0WinningVotes =
ProposalVotes $ ProposalVotes $
AssocMap.fromList AssocMap.fromList
[ (ResultTag 0, untag (def :: ProposalThresholds).countVoting + 1) [ (ResultTag 0, untag (def :: ProposalThresholds).vote + 1)
, (ResultTag 1, 0) , (ResultTag 1, 0)
] ]

View file

@ -189,9 +189,9 @@ proposalValidatorAddress = scriptHashAddress proposalValidatorHash
instance Default ProposalThresholds where instance Default ProposalThresholds where
def = def =
ProposalThresholds ProposalThresholds
{ countVoting = Tagged 1000 { execute = Tagged 1000
, create = Tagged 1 , create = Tagged 1
, startVoting = Tagged 10 , vote = Tagged 10
} }
authorityToken :: AuthorityToken authorityToken :: AuthorityToken

View file

@ -185,7 +185,7 @@ specs =
( ResultTag 0 ( ResultTag 0
, case initialState of , case initialState of
Draft -> 0 Draft -> 0
_ -> untag (def :: ProposalThresholds).countVoting + 1 _ -> untag (def :: ProposalThresholds).vote + 1
) )
, (ResultTag 1, 0) , (ResultTag 1, 0)
] ]
@ -232,7 +232,7 @@ specs =
( ResultTag 0 ( ResultTag 0
, case initialState of , case initialState of
Draft -> 0 Draft -> 0
_ -> untag (def :: ProposalThresholds).countVoting + 1 _ -> untag (def :: ProposalThresholds).vote + 1
) )
, (ResultTag 1, 0) , (ResultTag 1, 0)
] ]
@ -301,7 +301,7 @@ specs =
, votes = , votes =
ProposalVotes ProposalVotes
( AssocMap.fromList ( AssocMap.fromList
[ (ResultTag 0, untag (def :: ProposalThresholds).countVoting + 1) [ (ResultTag 0, untag (def :: ProposalThresholds).vote + 1)
, (ResultTag 1, 0) , (ResultTag 1, 0)
] ]
) )

View file

@ -189,11 +189,11 @@ governorDatumValid = phoistAcyclic $
plam $ \datum -> unTermCont $ do plam $ \datum -> unTermCont $ do
thresholds <- thresholds <-
tcont $ tcont $
pletFields @'["execute", "draft", "vote"] $ pletFields @'["execute", "create", "vote"] $
pfield @"proposalThresholds" # datum pfield @"proposalThresholds" # datum
PDiscrete execute' <- pmatchC thresholds.execute PDiscrete execute' <- pmatchC thresholds.execute
PDiscrete draft' <- pmatchC thresholds.draft PDiscrete draft' <- pmatchC thresholds.create
PDiscrete vote' <- pmatchC thresholds.vote PDiscrete vote' <- pmatchC thresholds.vote
execute <- tclet $ pextract # execute' execute <- tclet $ pextract # execute'

View file

@ -140,14 +140,14 @@ PlutusTx.makeIsDataIndexed ''ProposalStatus [('Draft, 0), ('VotingReady, 1), ('L
to 'Proposal's when they are created. to 'Proposal's when they are created.
-} -}
data ProposalThresholds = ProposalThresholds data ProposalThresholds = ProposalThresholds
{ countVoting :: Tagged GTTag Integer { execute :: Tagged GTTag Integer
-- ^ How much GT minimum must a particular 'ResultTag' accumulate for it to pass. -- ^ How much GT minimum must a particular 'ResultTag' accumulate for it to pass.
, create :: Tagged GTTag Integer , create :: Tagged GTTag Integer
-- ^ How much GT required to "create" a proposal. -- ^ How much GT required to "create" a proposal.
-- --
-- It is recommended this be a high enough amount, in order to prevent DOS from bad -- It is recommended this be a high enough amount, in order to prevent DOS from bad
-- actors. -- actors.
, startVoting :: Tagged GTTag Integer , vote :: Tagged GTTag Integer
-- ^ How much GT required to allow voting to happen. -- ^ How much GT required to allow voting to happen.
-- (i.e. to move into 'VotingReady') -- (i.e. to move into 'VotingReady')
} }
@ -327,7 +327,7 @@ newtype PProposalThresholds (s :: S) = PProposalThresholds
s s
( PDataRecord ( PDataRecord
'[ "execute" ':= PDiscrete GTTag '[ "execute" ':= PDiscrete GTTag
, "draft" ':= PDiscrete GTTag , "create" ':= PDiscrete GTTag
, "vote" ':= PDiscrete GTTag , "vote" ':= PDiscrete GTTag
] ]
) )

View file

@ -13,11 +13,11 @@ Agora/Proposal/validator/cosignature/stake,162540553,402961,4561
Agora/Proposal/validator/voting/proposal,181998338,491168,5652 Agora/Proposal/validator/voting/proposal,181998338,491168,5652
Agora/Proposal/validator/voting/stake,127693475,328703,4614 Agora/Proposal/validator/voting/stake,127693475,328703,4614
Agora/Proposal/validator/advancing/successfully advance to next state/Draft -> VotringReady,98071575,260351,5030 Agora/Proposal/validator/advancing/successfully advance to next state/Draft -> VotringReady,98071575,260351,5030
Agora/Proposal/validator/advancing/successfully advance to next state/VotingReady -> Locked,97228153,258848,5039 Agora/Proposal/validator/advancing/successfully advance to next state/VotingReady -> Locked,97228153,258848,5033
Agora/Proposal/validator/advancing/successfully advance to next state/Locked -> Finished,98924620,262454,5039 Agora/Proposal/validator/advancing/successfully advance to next state/Locked -> Finished,98924620,262454,5033
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Draft -> Finished,96941774,257621,5032 Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Draft -> Finished,96941774,257621,5032
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/VotingReady -> Finished,95532863,254916,5039 Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/VotingReady -> Finished,95532863,254916,5033
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Locked -> Finished,96663841,257320,5039 Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Locked -> Finished,96663841,257320,5033
Agora/AuthorityToken/singleAuthorityTokenBurned/Correct simple,21017788,55883,806 Agora/AuthorityToken/singleAuthorityTokenBurned/Correct simple,21017788,55883,806
Agora/AuthorityToken/singleAuthorityTokenBurned/Correct many inputs,33204186,88241,900 Agora/AuthorityToken/singleAuthorityTokenBurned/Correct many inputs,33204186,88241,900
Agora/Treasury/Validator/Positive/Allows for effect changes,29938856,79744,1841 Agora/Treasury/Validator/Positive/Allows for effect changes,29938856,79744,1841

1 name cpu mem size
13 Agora/Proposal/validator/voting/proposal 181998338 491168 5652
14 Agora/Proposal/validator/voting/stake 127693475 328703 4614
15 Agora/Proposal/validator/advancing/successfully advance to next state/Draft -> VotringReady 98071575 260351 5030
16 Agora/Proposal/validator/advancing/successfully advance to next state/VotingReady -> Locked 97228153 258848 5039 5033
17 Agora/Proposal/validator/advancing/successfully advance to next state/Locked -> Finished 98924620 262454 5039 5033
18 Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Draft -> Finished 96941774 257621 5032
19 Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/VotingReady -> Finished 95532863 254916 5039 5033
20 Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Locked -> Finished 96663841 257320 5039 5033
21 Agora/AuthorityToken/singleAuthorityTokenBurned/Correct simple 21017788 55883 806
22 Agora/AuthorityToken/singleAuthorityTokenBurned/Correct many inputs 33204186 88241 900
23 Agora/Treasury/Validator/Positive/Allows for effect changes 29938856 79744 1841