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

Fix error when staking bond amount in chainspec is a bigint #1119

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

nathanwhit
Copy link
Contributor

@nathanwhit nathanwhit commented Jun 12, 2023

Currently if you have a chainspec with a staking bond amount that is large enough to be serialized as a bigint, you'll
hit an error in zombienet when calculating the balance for validator nodes:

Fail to add balance for nodes: [object Object],[object Object],[object Object],[object Object]

 Unexpected error:       TypeError: Cannot mix BigInt and other types, use explicit conversions

This is because the calculation is performed assuming the stakingBond is a number when it can, in fact, be a bigint in the chain spec.

This PR fixes this by performing the balance calculation entirely using bigints.

@nathanwhit nathanwhit force-pushed the staking-bond-bigint-fix branch from ab443bb to 1b207aa Compare June 12, 2023 19:42
@pepoviola pepoviola requested review from wirednkod and l0r1s June 15, 2023 01:54
@pepoviola pepoviola merged commit b4ab842 into paritytech:main Jun 15, 2023
@pepoviola
Copy link
Collaborator

thanks @nathanwhit!

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.

4 participants