Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Nov 15, 2023
1 parent 7cd47bd commit 2faccb3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/client/src/addresslistVoting/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function computeProposalStatus(
if (startDate >= now) {
return ProposalStatus.PENDING;
}
if (proposal.potentiallyExecutable || proposal.earlyExecutable) {
if (proposal.approvalReached || proposal.earlyExecutable) {
return ProposalStatus.SUCCEEDED;
}
if (endDate >= now) {
Expand Down
17 changes: 14 additions & 3 deletions modules/client/src/multisig/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,19 @@ export function computeProposalStatus(
if (now < startDate) {
return ProposalStatus.PENDING;
}
if (proposal.potentiallyExecutable && now < endDate) {
return ProposalStatus.SUCCEEDED;
if (proposal.approvalReached) {
if(proposal.actions.length === 0){
// Signalling proposals (having an empty actions array) don't need to be executed
// and should remain with `ProposalStatus.SUCCEEDED` after `endDate` has passed
return ProposalStatus.SUCCEEDED;
} else {

// Conventional proposals become `ProposalStatus.SUCCEEDED` before the `endDate` has passed.
// If they don't get executed afterwards, they will become `ProposalStatus.DEFEATED`
if (now < endDate) {
return ProposalStatus.SUCCEEDED;
}
}
}
if (now < endDate) {
return ProposalStatus.ACTIVE;
Expand All @@ -151,7 +162,7 @@ export function computeProposalStatusFilter(status: ProposalStatus) {
where = { executed: true };
break;
case ProposalStatus.SUCCEEDED:
where = { potentiallyExecutable: true, endDate_gte: now };
where = { potentiallyExecutable: true, endDate_gte: now }; // TODO rename to
break;
case ProposalStatus.DEFEATED:
where = {
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/tokenVoting/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export function computeProposalStatus(
if (startDate >= now) {
return ProposalStatus.PENDING;
}
if (proposal.potentiallyExecutable || proposal.earlyExecutable) {
if (proposal.approvalReached || proposal.earlyExecutable) {
return ProposalStatus.SUCCEEDED;
}
if (endDate >= now) {
Expand Down

0 comments on commit 2faccb3

Please sign in to comment.