diff --git a/modules/client/src/addresslistVoting/internal/utils.ts b/modules/client/src/addresslistVoting/internal/utils.ts index c5ab09704..b6c4013d2 100644 --- a/modules/client/src/addresslistVoting/internal/utils.ts +++ b/modules/client/src/addresslistVoting/internal/utils.ts @@ -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) { diff --git a/modules/client/src/multisig/internal/utils.ts b/modules/client/src/multisig/internal/utils.ts index 420aa41cd..5fe33804c 100644 --- a/modules/client/src/multisig/internal/utils.ts +++ b/modules/client/src/multisig/internal/utils.ts @@ -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; @@ -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 = { diff --git a/modules/client/src/tokenVoting/internal/utils.ts b/modules/client/src/tokenVoting/internal/utils.ts index d480fe5b0..c30e250cb 100644 --- a/modules/client/src/tokenVoting/internal/utils.ts +++ b/modules/client/src/tokenVoting/internal/utils.ts @@ -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) {