Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an onboarding crash happening with some web3 provider setups (#442)
When calling getBalance(), it was possible to sometimes get another value than an big integer as a string. Having `null` as a result, and passing it to the BN.js constructor, could lead to an infinit loop [1]. To prevent this issue to happen again: - In the app, `balance` is now always represented by a BN.js instance. To represent an unknown balance, `new BN(-1)` is now used rather than `null`. - The result of getbalance() is now filtered to ensure that we are passing an integer to BN.js. Otherwise, we pass "-1". [1] indutny/bn.js#186
- Loading branch information
Showing
5 changed files
with
84 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters