Skip to content

Commit

Permalink
Fix collator last session blocks (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Nov 22, 2023
1 parent 9044e6f commit b2c9ade
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hooks/use-collator-last-session-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ export const useCollatorLastSessionBlocks = (defaultValue: DefaultValue) => {

const handle = (points: Codec) => {
const [_, collatorPoints] = points.toJSON() as [number, { [address: string]: number }]; // [totalPoint, { collator: collatorPoint }]
const staticNumber = 20; // this staticNumber = 20 was given by the backend

setCollatorLastSessionBlocks(
Object.keys(collatorPoints).reduce((acc, cur) => {
const collatorPoint = collatorPoints[cur];
const blocks = collatorPoint / staticNumber;
return { ...acc, [cur]: blocks };
return { ...acc, [cur]: collatorPoint };
}, {})
);
};
Expand Down

0 comments on commit b2c9ade

Please sign in to comment.