Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

LL-6072 LL-6161 [Polkadot] Dynamically fetch minimum bond value #1280

Merged
merged 6 commits into from Jul 6, 2021
Merged

LL-6072 LL-6161 [Polkadot] Dynamically fetch minimum bond value #1280

merged 6 commits into from Jul 6, 2021

Conversation

ghost
Copy link

@ghost ghost commented Jun 28, 2021

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.

@ghost ghost self-requested a review June 28, 2021 17:33
@vercel
Copy link

vercel bot commented Jun 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ledgerhq/ledger-live-common/FhvtFpxyohRhm7Ayy5DAEKjvZJvW
✅ Preview: https://ledger-live-common-git-fork-ledger-coin-integra-c7406b-ledgerhq.vercel.app

@ghost ghost changed the title LL-6072 LL-6161 [Polkadot] Provide endpoint to dynamically fetch minimum bond value LL-6072 LL-6161 [Polkadot] Dynamically fetch minimum bond value Jul 1, 2021
@ghost ghost marked this pull request as ready for review July 2, 2021 14:08
@ghost ghost requested review from gre and IAmMorrow July 2, 2021 14:09
@@ -56,11 +58,15 @@ function fromHydratePreloadData(data: mixed): PolkadotPreloadData {
bondingDuration: Number(bondingDuration) || 28,
};
}

// $FlowFixMe
minimumBondBalance = BigNumber(data.minimumBondBalance);
Copy link
Contributor

@gre gre Jul 6, 2021

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.

Copy link
Contributor

@gre gre left a 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants