-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Proposal status and filters for multisig #250
Changes from 4 commits
db408b3
dbc9905
340534c
82705e0
049a362
f02486b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,10 @@ export function computeProposalStatus( | |
if (startDate >= now) { | ||
return ProposalStatus.PENDING; | ||
} | ||
if (proposal.potentiallyExecutable || proposal.earlyExecutable) { | ||
if ( | ||
(now > endDate || proposal.earlyExecutable) && | ||
proposal.potentiallyExecutable | ||
) { | ||
return ProposalStatus.SUCCEEDED; | ||
} | ||
if (endDate >= now) { | ||
|
@@ -64,22 +67,22 @@ export function computeProposalStatusFilter( | |
const now = Math.round(new Date().getTime() / 1000).toString(); | ||
switch (status) { | ||
case ProposalStatus.PENDING: | ||
where = { startDate_gte: now }; | ||
where = { startDate_gte: now, potentiallyExecutable: false, executed: false }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm this means we won't get any pending Multisig proposals with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, good catch |
||
break; | ||
case ProposalStatus.ACTIVE: | ||
where = { startDate_lt: now, endDate_gte: now, executed: false }; | ||
where = { startDate_lt: now, endDate_gte: now, executed: false, potentiallyExecutable: false }; | ||
break; | ||
case ProposalStatus.EXECUTED: | ||
where = { executed: true }; | ||
break; | ||
case ProposalStatus.SUCCEEDED: | ||
where = { potentiallyExecutable: true, endDate_lt: now }; | ||
where = { potentiallyExecutable: true }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if the proposal is potentially executable but the date expired? Isn't this condition tied to any other variable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean the end date only shows you when you can and cant vote, there is not such thing as expired. If now is greater then endDate and potentiallyExecutable is true, congrats, your proposal passed :) |
||
break; | ||
case ProposalStatus.DEFEATED: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't quite work for the TokenVoting proposals. While the Multisig proposal is expired regardless of whether the approval threshold is met when the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep then we are not going to be able to fix it. Either we wait for the split where each plugin has its own compute status function or we create a compute status filter function for the multisig |
||
where = { | ||
potentiallyExecutable: false, | ||
brickpop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
endDate_lt: now, | ||
executed: false, | ||
potentiallyExecutable: false, | ||
}; | ||
break; | ||
default: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be any check for the special case of minApprovals = 1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, i don't think so, the thing was that minApprovals = 1 triggered the potentiallyExecutable = true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But without a check doesn't this mean that we will get s
ucceeded
by default for those proposals whereminApprovals
= 1 without anyone actually having voted? Perhaps we could add a check to see if there exists at least 1 vote whenpotentiallyExecutable
= true?