Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Nov 20, 2023
1 parent 89f4dbb commit 024005a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion modules/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/multisig/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions modules/client/test/unit/multisig-client/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions modules/client/test/unit/tokenVoting-client  /utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 024005a

Please sign in to comment.