Skip to content

Commit

Permalink
chore: fixed reward warning calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Dec 8, 2024
1 parent 5aaeaea commit c96caba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parser/github-comment-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,10 @@ export class GithubCommentModule extends BaseModule {
this.context.config.erc20RewardToken
);

const rewardsSum = result.comments?.reduce<number>((acc, curr) => acc + (curr.score?.reward ?? 0), 0) ?? 0;
const isCapped = result.total < rewardsSum;
const rewardsSum =
result.comments?.reduce<Decimal>((acc, curr) => acc.add(curr.score?.reward ?? 0), new Decimal(0)) ??
new Decimal(0);
const isCapped = rewardsSum.gt(taskReward);

return `
<details>
Expand Down

0 comments on commit c96caba

Please sign in to comment.