diff --git a/modules/client/CHANGELOG.md b/modules/client/CHANGELOG.md index 98ac0b830..1bb4a2f3d 100644 --- a/modules/client/CHANGELOG.md +++ b/modules/client/CHANGELOG.md @@ -20,7 +20,8 @@ TEMPLATE: ## [UPCOMING] ### Fixed -- Compute of proposal status bu adding the `isSignaling`field +- Classify signalling multisig proposals as succeeded even after the end date is passed using the subgraph `isSignalling` attribute. + ## [1.19.0] diff --git a/modules/client/src/multisig/internal/utils.ts b/modules/client/src/multisig/internal/utils.ts index 1663b551f..61f08e90f 100644 --- a/modules/client/src/multisig/internal/utils.ts +++ b/modules/client/src/multisig/internal/utils.ts @@ -150,7 +150,7 @@ export function computeProposalStatus( // and the approval threshold is not reached // If the end date is in the future this means that you can still vote // so the status becomes ACTIVE - if (now < endDate) { + if (now <= endDate) { return ProposalStatus.ACTIVE; } // If none of the other conditions are met the status becomes DEFEATED diff --git a/modules/client/test/unit/addresslistVoting-client/utils.test.ts b/modules/client/test/unit/addresslistVoting-client/utils.test.ts index 7e4512d75..5aaf61e7a 100644 --- a/modules/client/test/unit/addresslistVoting-client/utils.test.ts +++ b/modules/client/test/unit/addresslistVoting-client/utils.test.ts @@ -40,7 +40,7 @@ describe("addresslistVoting-client utils", () => { earlyExecutable: false, } as SubgraphAddresslistVotingProposal)).toBe(ProposalStatus.ACTIVE); }); - it("should return SUCCEDED if approvalReached = true", () => { + it("should return SUCCEEDED if approvalReached = true", () => { const endDate = Date.now() / 1000; const startDate = (Date.now() / 1000) - 500; @@ -52,7 +52,7 @@ describe("addresslistVoting-client utils", () => { earlyExecutable: false, } as SubgraphAddresslistVotingProposal)).toBe(ProposalStatus.SUCCEEDED); }); - it("should return SUCCEDED if earlyExecutable = true", () => { + it("should return SUCCEEDED if earlyExecutable = true", () => { const endDate = (Date.now() / 1000) + 500; const startDate = (Date.now() / 1000) - 500; diff --git a/modules/client/test/unit/multisig-client/utils.test.ts b/modules/client/test/unit/multisig-client/utils.test.ts index b745524d1..142d85e6b 100644 --- a/modules/client/test/unit/multisig-client/utils.test.ts +++ b/modules/client/test/unit/multisig-client/utils.test.ts @@ -37,7 +37,7 @@ describe("multisig-client utils", () => { executed: false, } as SubgraphMultisigProposal)).toBe(ProposalStatus.ACTIVE); }); - it("should return SUCCEDED if approvalReached = true", () => { + it("should return SUCCEEDED if approvalReached = true", () => { const endDate = (Date.now() / 1000) + 500; const startDate = (Date.now() / 1000) - 500; @@ -49,8 +49,8 @@ describe("multisig-client utils", () => { } as SubgraphMultisigProposal)).toBe(ProposalStatus.SUCCEEDED); }); it("should return DEFEATED", () => { - const endDate = (Date.now() / 1000) - 5000; - const startDate = (Date.now() / 1000) - 10000; + const endDate = (Date.now() / 1000) - 200; + const startDate = (Date.now() / 1000) - 500; expect(computeProposalStatus({ endDate: endDate.toString(), diff --git "a/modules/client/test/unit/tokenVoting-client\302\240 /utils.test.ts" "b/modules/client/test/unit/tokenVoting-client\302\240 /utils.test.ts" index 9702fc142..2badeb80e 100644 --- "a/modules/client/test/unit/tokenVoting-client\302\240 /utils.test.ts" +++ "b/modules/client/test/unit/tokenVoting-client\302\240 /utils.test.ts" @@ -112,7 +112,7 @@ describe("tokenVoting-client utils", () => { earlyExecutable: false, } as SubgraphTokenVotingProposal)).toBe(ProposalStatus.ACTIVE); }); - it("should return SUCCEDED if executable = true", () => { + it("should return SUCCEEDED if executable = true", () => { const endDate = Date.now() / 1000; const startDate = (Date.now() / 1000) - 500; @@ -124,7 +124,7 @@ describe("tokenVoting-client utils", () => { earlyExecutable: false, } as SubgraphTokenVotingProposal)).toBe(ProposalStatus.SUCCEEDED); }); - it("should return SUCCEDED if earlyExecutable = true", () => { + it("should return SUCCEEDED if earlyExecutable = true", () => { const endDate = (Date.now() / 1000) + 500; const startDate = (Date.now() / 1000) - 500; @@ -136,7 +136,7 @@ describe("tokenVoting-client utils", () => { earlyExecutable: true, } as SubgraphTokenVotingProposal)).toBe(ProposalStatus.SUCCEEDED); }); - it("should return SUCCEDED for a signalng proposal", () => { + it("should return SUCCEEDED for a signalng proposal", () => { const endDate = (Date.now() / 1000) + 500; const startDate = (Date.now() / 1000) - 500;