test that proposal thresholds are inclusively checked

This commit is contained in:
Hongrui Fang 2022-10-31 22:02:06 +08:00
parent b23e23da11
commit 891e261657
No known key found for this signature in database
GPG key ID: F10AB2CCE24113DD
2 changed files with 7 additions and 6 deletions

View file

@ -715,20 +715,20 @@ mkMockEffects useAuthScript n = effects
effectsPerGroup
(zip effectScripts effectMetadata)
numberOfVotesThatExceedsTheMinimumRequirement :: Integer
numberOfVotesThatExceedsTheMinimumRequirement =
untag (def @ProposalThresholds).execute + 1
numberOfVotesThatJustMeetsTheMinimumRequirement :: Integer
numberOfVotesThatJustMeetsTheMinimumRequirement =
untag (def @ProposalThresholds).execute
mkWinnerVotes :: Index -> (Winner, Integer)
mkWinnerVotes idx =
( EffectAt idx
, numberOfVotesThatExceedsTheMinimumRequirement
, numberOfVotesThatJustMeetsTheMinimumRequirement
)
ambiguousWinnerVotes :: (Winner, Integer)
ambiguousWinnerVotes =
( All
, numberOfVotesThatExceedsTheMinimumRequirement
, numberOfVotesThatJustMeetsTheMinimumRequirement
)
--------------------------------------------------------------------------------

View file

@ -35,6 +35,7 @@ import Agora.Proposal (
ProposalId (ProposalId),
ProposalRedeemer (Vote),
ProposalStatus (VotingReady),
ProposalThresholds (vote),
ProposalVotes (ProposalVotes),
ResultTag (ResultTag),
)
@ -421,7 +422,7 @@ mkValidOwnerVoteBundle stakes =
{ numStakes = stakes
, stakeInputParameters =
StakeInputParameters
{ perStakeGTs = 114514
{ perStakeGTs = (def :: ProposalThresholds).vote
}
, stakeOutputParameters =
StakeOutputParameters