Skip to content

Commit

Permalink
feat: handle checkWeightAmount
Browse files Browse the repository at this point in the history
  • Loading branch information
amandakelake committed Apr 24, 2024
1 parent e39f895 commit 5e4d19d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/service/contributor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ export class ContributorService {

checkWeightAmount(contributors: Contributor[]) {
const sum = contributors.reduce(
(prev, cur) => prev + Number(cur.voteWeight),
(prev, cur) => prev + Number(cur.voteWeight) * 100,
0,
);
if (sum !== 1) {
if (sum !== 100) {
throw new HttpException(
Code.WEIGHT_AMOUNT_ERROR.message,
Code.WEIGHT_AMOUNT_ERROR.code,
Expand Down

0 comments on commit 5e4d19d

Please sign in to comment.