Skip to content
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

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

bobo-k2
Copy link
Contributor

@bobo-k2 bobo-k2 commented Sep 24, 2024

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

  • contains breaking changes
  • adds new feature
  • modifies existing feature (bug fix or improvements)
  • relies on other tasks
  • documentation changes
  • tested on mobile devices

Copy link

github-actions bot commented Sep 24, 2024

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) {
Copy link
Member

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?

Copy link
Contributor Author

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.

@bobo-k2 bobo-k2 merged commit 9ddb718 into release-hotfix Sep 27, 2024
6 checks passed
@bobo-k2 bobo-k2 deleted the fix/past-block-time branch September 27, 2024 13:02
impelcrypto pushed a commit that referenced this pull request Sep 30, 2024
* 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
impelcrypto pushed a commit that referenced this pull request Oct 1, 2024
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants