Skip to content

Commit

Permalink
fix: consider all delegation strategies
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaituVR committed Nov 26, 2024
1 parent 2b025d4 commit befb258
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ async function getScores(
`${SCORE_API_URL}/api/scores`
);

const totalScores = result.reduce((acc, scores) => {
for (const [delegate, score] of Object.entries(scores)) {
acc[delegate] = (acc[delegate] ?? 0) + score;
}
return acc;
}, {});

scores = {
...scores,
...result[0]
...totalScores
};
}

Expand Down

0 comments on commit befb258

Please sign in to comment.