-
Notifications
You must be signed in to change notification settings - Fork 105
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
feat: update unbonding period calculation #1034
Conversation
queryFn: async () => { | ||
const parameters = await fetchChainParameters(api); | ||
|
||
const unbondingPeriodInEpochs = |
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.
I think this is good! :) But maybe it's worth moving it to some common/utility space(component?) if it's used in multiple places?
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.
Thanks! I'll move it to a dedicated function. But the idea here is to keep it attached to the atom, then anytime we needed, we pull the value directly from the atom and we don't need to care about the math/parameters anymore
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.
I've not reviewed the code, but just on the TODO replacement: I think "a 13 hours unbonding schedule" doesn't read right. It could either be "a 13-hour unbonding schedule" or "an unbonding schedule of 13 hours". Maybe the second is easier since the string formatting doesn't need to change.
const signedTx = await sdk.signing.sign(encodedTx, signingKey); | ||
|
||
console.log("Broadcasting transaction..."); |
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.
lint was complaining about the console.log
Update Unbonding Period calculation
chain.unbondingPeriod
on the atom layer, removing it from different components and any reference forunbondingPeriodInEpochs
which leads to distributed and confused calculationsservice
, than it'll be used only to execute the indexer request, and all data transformation will happen on the atom layerStaking/IncrementBonding.tsx
Closes #1020