Skip to content

Commit

Permalink
fix: consider all delegation strategies (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaituVR authored Nov 27, 2024
1 parent 0ab0f56 commit 67b07bd
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 67b07bd

Please sign in to comment.