apply Emily's suggestions
This commit is contained in:
parent
034e55c34f
commit
feb3f2daaf
4 changed files with 24 additions and 24 deletions
|
|
@ -408,7 +408,7 @@ mkTransitionTxInfo ::
|
|||
ProposalStartingTime ->
|
||||
-- | Valid time range of the transaction.
|
||||
POSIXTimeRange ->
|
||||
-- | Add a unchanged stake or not.
|
||||
-- | Whether to add an unchanged stake or not.
|
||||
Bool ->
|
||||
TxInfo
|
||||
mkTransitionTxInfo from to effects votes startingTime validTime shouldAddUnchangedStake =
|
||||
|
|
|
|||
|
|
@ -369,9 +369,9 @@ newtype PProposalVotes (s :: S)
|
|||
deriving (PlutusType, PIsData) via (DerivePNewtype PProposalVotes (PMap 'Unsorted PResultTag PInteger))
|
||||
|
||||
-- | Retract votes given the option and the amount of votes.
|
||||
pretractVotes :: Term s (PProposalVotes :--> PResultTag :--> PInteger :--> PProposalVotes)
|
||||
pretractVotes :: Term s (PResultTag :--> PInteger :--> PProposalVotes :--> PProposalVotes)
|
||||
pretractVotes = phoistAcyclic $
|
||||
plam $ \votes rt count ->
|
||||
plam $ \rt count votes ->
|
||||
let voteMap :: Term _ (PMap 'Unsorted PResultTag PInteger)
|
||||
voteMap = pto votes
|
||||
in pcon $
|
||||
|
|
|
|||
|
|
@ -416,19 +416,19 @@ proposalValidator proposal =
|
|||
pguardC "Stake input relevant" $
|
||||
pmatch stakeUsage $ \case
|
||||
PDidNothing ->
|
||||
ptrace "Not relevant" $
|
||||
ptraceIfFalse "Stake should be relevant" $
|
||||
pconstant False
|
||||
PCreated ->
|
||||
ptraceIfFalse "Too early" $
|
||||
ptraceIfFalse "Removing creator's locks means status is Finished" $
|
||||
proposalF.status #== pconstantData Finished
|
||||
PVotedFor rt ->
|
||||
ptraceIfFalse "Result tag not match" $
|
||||
ptraceIfFalse "Result tag should match the one given in the redeemer" $
|
||||
rt #== retractFrom
|
||||
|
||||
-- The count of removing votes is equal to the 'stakeAmount' of input stake.
|
||||
retractCount <-
|
||||
pletC $
|
||||
pmatch stakeInF.stakedAmount $ (\(PDiscrete v) -> pextract # v)
|
||||
pmatch stakeInF.stakedAmount $ \(PDiscrete v) -> pextract # v
|
||||
|
||||
-- The votes can only change when the proposal still allows voting.
|
||||
let shouldUpdateVotes =
|
||||
|
|
@ -439,7 +439,7 @@ proposalValidator proposal =
|
|||
pif
|
||||
shouldUpdateVotes
|
||||
( let -- Remove votes and leave other parts of the proposal as it.
|
||||
expectedVotes = pretractVotes # proposalF.votes # retractFrom # retractCount
|
||||
expectedVotes = pretractVotes # retractFrom # retractCount # proposalF.votes
|
||||
|
||||
expectedProposalOut =
|
||||
mkRecordConstr
|
||||
|
|
|
|||
32
bench.csv
32
bench.csv
|
|
@ -2,32 +2,32 @@ name,cpu,mem,size
|
|||
Agora/Effects/Treasury Withdrawal Effect/effect/Simple,289461528,703055,3191
|
||||
Agora/Effects/Treasury Withdrawal Effect/effect/Simple with multiple treasuries ,448521458,1070167,3518
|
||||
Agora/Effects/Treasury Withdrawal Effect/effect/Mixed Assets,408085321,966048,3383
|
||||
Agora/Effects/Governor Mutation Effect/validator/valid new governor datum/governor validator should pass,83758582,229228,7665
|
||||
Agora/Effects/Governor Mutation Effect/validator/valid new governor datum/governor validator should pass,83758582,229228,7664
|
||||
Agora/Effects/Governor Mutation Effect/validator/valid new governor datum/effect validator should pass,97345575,266935,3358
|
||||
Agora/Stake/policy/stakeCreation,43114795,124549,2156
|
||||
Agora/Stake/validator/stakeDepositWithdraw deposit,171823342,464745,4189
|
||||
Agora/Stake/validator/stakeDepositWithdraw withdraw,171823342,464745,4177
|
||||
Agora/Proposal/policy/proposalCreation,23140177,69194,1518
|
||||
Agora/Proposal/validator/cosignature/proposal,204675349,564476,6565
|
||||
Agora/Proposal/validator/cosignature/proposal,204675349,564476,6654
|
||||
Agora/Proposal/validator/cosignature/stake,114125937,284821,4726
|
||||
Agora/Proposal/validator/voting/proposal,166129664,437310,6494
|
||||
Agora/Proposal/validator/voting/proposal,166129664,437310,6583
|
||||
Agora/Proposal/validator/voting/stake,107127768,275725,4700
|
||||
Agora/Proposal/validator/advancing/successfully advance to next state/Draft -> VotringReady,162018766,433842,6392
|
||||
Agora/Proposal/validator/advancing/successfully advance to next state/VotingReady -> Locked,161175344,432339,6395
|
||||
Agora/Proposal/validator/advancing/successfully advance to next state/Locked -> Finished,162871811,435945,6395
|
||||
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Draft -> Finished,160888965,431112,6394
|
||||
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/VotingReady -> Finished,159480054,428407,6395
|
||||
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Locked -> Finished,160611032,430811,6395
|
||||
Agora/Proposal/validator/unlocking/legal/retract votes and unlock stake while voting,171592676,462566,6467
|
||||
Agora/Proposal/validator/unlocking/legal/unlock the stake that has been used to create the proposal,149988973,407906,6474
|
||||
Agora/Proposal/validator/unlocking/legal/unlock stake after voting/Locked,149056062,408201,6468
|
||||
Agora/Proposal/validator/unlocking/legal/unlock stake after voting/Finished,149056062,408201,6468
|
||||
Agora/Proposal/validator/advancing/successfully advance to next state/Draft -> VotringReady,162018766,433842,6481
|
||||
Agora/Proposal/validator/advancing/successfully advance to next state/VotingReady -> Locked,161175344,432339,6484
|
||||
Agora/Proposal/validator/advancing/successfully advance to next state/Locked -> Finished,162871811,435945,6484
|
||||
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Draft -> Finished,160888965,431112,6483
|
||||
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/VotingReady -> Finished,159480054,428407,6484
|
||||
Agora/Proposal/validator/advancing/successfully advance to failed state: timeout/Locked -> Finished,160611032,430811,6484
|
||||
Agora/Proposal/validator/unlocking/legal/retract votes and unlock stake while voting,171454676,461966,6556
|
||||
Agora/Proposal/validator/unlocking/legal/unlock the stake that has been used to create the proposal,149988973,407906,6563
|
||||
Agora/Proposal/validator/unlocking/legal/unlock stake after voting/Locked,149056062,408201,6557
|
||||
Agora/Proposal/validator/unlocking/legal/unlock stake after voting/Finished,149056062,408201,6557
|
||||
Agora/AuthorityToken/singleAuthorityTokenBurned/Correct simple,21017788,55883,806
|
||||
Agora/AuthorityToken/singleAuthorityTokenBurned/Correct many inputs,33204186,88241,900
|
||||
Agora/Treasury/Validator/Positive/Allows for effect changes,29938856,79744,1390
|
||||
Agora/AuthorityToken/singleAuthorityTokenBurned/Correct simple,21017788,55883,806
|
||||
Agora/AuthorityToken/singleAuthorityTokenBurned/Correct many inputs,33204186,88241,900
|
||||
Agora/Governor/policy/GST minting,43087287,120125,1829
|
||||
Agora/Governor/validator/proposal creation,261928725,689487,8181
|
||||
Agora/Governor/validator/GATs minting,352305185,937264,8302
|
||||
Agora/Governor/validator/mutate governor state,84905433,234687,7766
|
||||
Agora/Governor/validator/proposal creation,262494214,690689,8180
|
||||
Agora/Governor/validator/GATs minting,351739696,936062,8301
|
||||
Agora/Governor/validator/mutate governor state,84905433,234687,7765
|
||||
|
|
|
|||
|
Loading…
Add table
Add a link
Reference in a new issue