-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change openings reward display #4745
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
title={`Reward per ${rewardPeriod?.toString()} blocks`} | ||
value={rewardPeriod?.mul(opening.rewardPerBlock)} | ||
title={'Reward per week'} | ||
value={rewardPeriod?.mul(opening.rewardPerBlock).mul(new BN(7))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code now makes the assumption that opening.rewardPerBlock
is a day , which is fine but in this case there's no need to use the api rewardPerBlock
(because if the api returns something else than 14400
then rewardPerBlock * 7
won't be a week anymore).
So IMO this would be a lot clearer:
value={rewardPeriod?.mul(opening.rewardPerBlock).mul(new BN(7))} | |
value={opening.rewardPerBlock.muln(A_WEEK / MILLISECONDS_PER_BLOCK} |
Or even:
value={rewardPeriod?.mul(opening.rewardPerBlock).mul(new BN(7))} | |
value={opening.rewardPerBlock.muln(BLOCKS_PER_WEEK} |
(With BLOCKS_PER_WEEK
defined as a constant somewhere).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #4516