-
Notifications
You must be signed in to change notification settings - Fork 171
LL-6072 LL-6161 [Polkadot] Dynamically fetch minimum bond value #1280
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/ledgerhq/ledger-live-common/FhvtFpxyohRhm7Ayy5DAEKjvZJvW |
src/families/polkadot/preload.js
Outdated
@@ -56,11 +58,15 @@ function fromHydratePreloadData(data: mixed): PolkadotPreloadData { | |||
bondingDuration: Number(bondingDuration) || 28, | |||
}; | |||
} | |||
|
|||
// $FlowFixMe | |||
minimumBondBalance = BigNumber(data.minimumBondBalance); |
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 you should do
BigNumber(data.minimumBondBalance || 0)
because there is a slight possibility that you will first get hydrate() WITHOUT the data when coming on old Live. indeed it also get instantly hydrated after this, but still there is a possibility to get a BigNumber NaN here.
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.
one slight change to do
Context: on Polkadot the minimum amount allowed to bond can now change at any time with a governance decision. We need to fetch it dynamically to adapt the warnings and errors we display to the users.