test that proposal thresholds are inclusively checked
This commit is contained in:
parent
f6298ba839
commit
25ae7ce820
2 changed files with 7 additions and 6 deletions
|
|
@ -715,20 +715,20 @@ mkMockEffects useAuthScript n = effects
|
||||||
effectsPerGroup
|
effectsPerGroup
|
||||||
(zip effectScripts effectMetadata)
|
(zip effectScripts effectMetadata)
|
||||||
|
|
||||||
numberOfVotesThatExceedsTheMinimumRequirement :: Integer
|
numberOfVotesThatJustMeetsTheMinimumRequirement :: Integer
|
||||||
numberOfVotesThatExceedsTheMinimumRequirement =
|
numberOfVotesThatJustMeetsTheMinimumRequirement =
|
||||||
untag (def @ProposalThresholds).execute + 1
|
untag (def @ProposalThresholds).execute
|
||||||
|
|
||||||
mkWinnerVotes :: Index -> (Winner, Integer)
|
mkWinnerVotes :: Index -> (Winner, Integer)
|
||||||
mkWinnerVotes idx =
|
mkWinnerVotes idx =
|
||||||
( EffectAt idx
|
( EffectAt idx
|
||||||
, numberOfVotesThatExceedsTheMinimumRequirement
|
, numberOfVotesThatJustMeetsTheMinimumRequirement
|
||||||
)
|
)
|
||||||
|
|
||||||
ambiguousWinnerVotes :: (Winner, Integer)
|
ambiguousWinnerVotes :: (Winner, Integer)
|
||||||
ambiguousWinnerVotes =
|
ambiguousWinnerVotes =
|
||||||
( All
|
( All
|
||||||
, numberOfVotesThatExceedsTheMinimumRequirement
|
, numberOfVotesThatJustMeetsTheMinimumRequirement
|
||||||
)
|
)
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import Agora.Proposal (
|
||||||
ProposalId (ProposalId),
|
ProposalId (ProposalId),
|
||||||
ProposalRedeemer (Vote),
|
ProposalRedeemer (Vote),
|
||||||
ProposalStatus (VotingReady),
|
ProposalStatus (VotingReady),
|
||||||
|
ProposalThresholds (vote),
|
||||||
ProposalVotes (ProposalVotes),
|
ProposalVotes (ProposalVotes),
|
||||||
ResultTag (ResultTag),
|
ResultTag (ResultTag),
|
||||||
)
|
)
|
||||||
|
|
@ -421,7 +422,7 @@ mkValidOwnerVoteBundle stakes =
|
||||||
{ numStakes = stakes
|
{ numStakes = stakes
|
||||||
, stakeInputParameters =
|
, stakeInputParameters =
|
||||||
StakeInputParameters
|
StakeInputParameters
|
||||||
{ perStakeGTs = 114514
|
{ perStakeGTs = (def :: ProposalThresholds).vote
|
||||||
}
|
}
|
||||||
, stakeOutputParameters =
|
, stakeOutputParameters =
|
||||||
StakeOutputParameters
|
StakeOutputParameters
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue