check thresholds inclusively

This commit is contained in:
Hongrui Fang 2022-10-24 18:09:04 +08:00
parent f6fe01910a
commit 3238335cdb
No known key found for this signature in database
GPG key ID: F10AB2CCE24113DD
2 changed files with 4 additions and 4 deletions

View file

@ -891,7 +891,7 @@ pwinner' = phoistAcyclic $
exceedQuorum =
ptraceIfFalse "Highest vote count should exceed the minimum threshold" $
quorum #< highestVotes
quorum #<= highestVotes
pure $
pif

View file

@ -423,7 +423,7 @@ proposalValidator =
# proposalInputDatumF.cosigners
pguardC "Less cosigners than maximum limit" $
plength # updatedSigs #< maximumCosigners
plength # updatedSigs #<= maximumCosigners
pguardC "Meet minimum GT requirement" $
pfromData thresholdsF.cosign #<= stakeF.stakedAmount
@ -467,7 +467,7 @@ proposalValidator =
# sctxF.inputStakes
pguardC "Exceed minimum amount" $
thresholdsF.vote #< totalStakeAmount
thresholdsF.vote #<= totalStakeAmount
pguardC "Input proposal must be in VotingReady state" $
currentStatus #== pconstant VotingReady
@ -646,7 +646,7 @@ proposalValidator =
pmatchC notTooLate >>= \case
PTrue -> do
pguardC "More cosigns than minimum amount" $
punsafeCoerce (pfromData thresholdsF.toVoting) #< sctxF.totalAmount
punsafeCoerce (pfromData thresholdsF.toVoting) #<= sctxF.totalAmount
pguardC "All new cosigners are witnessed by their Stake datums" $
plistEqualsBy