-
Notifications
You must be signed in to change notification settings - Fork 93
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
APR calculation fix to use block time for a given block #1389
Conversation
Visit the preview URL for this PR (updated for commit 040647f): https://astar-apps--pr1389-fix-past-block-time-op10c16r.web.app (expires Tue, 01 Oct 2024 14:04:53 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: dd76fe72958fe2910fef9d53f0b4539b82b849db |
public async getBlockTimeInSeconds(blockNumber?: number): Promise<number> { | ||
const api = await this.api.getApi(blockNumber); | ||
|
||
if (api.consts.aura) { |
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.
is it means that the async backing enabled?
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.
Actually this means that aura
pallet is not present on chain, which is the case if you ask for block time for some very old block.
* Remove Age of Chronos promotion (#1386) * Fetch block time from chain (#1384) * Fetch block time to store * Apr calculation fix * Type fix * PR comments fix and code cleanup * Fix/selected dapp index (#1387) * Voting wizard search bug fix * Keep selected dApps while switching categories * APR calculation fix to use block time for a given block (#1389) * APR calculation fix to use block time for a given block * Small fix
* Remove Age of Chronos promotion (#1386) * Fetch block time from chain (#1384) * Fetch block time to store * Apr calculation fix * Type fix * PR comments fix and code cleanup * Fix/selected dapp index (#1387) * Voting wizard search bug fix * Keep selected dApps while switching categories * APR calculation fix to use block time for a given block (#1389) * APR calculation fix to use block time for a given block * Small fix * Fix for re-staking on unregistered dApps (#1392)
Pull Request Summary
I made an oversight in #1384 when I forgot to provide block number when fetching block time in APR calculations
Check list