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

Setting balance to 0x0 when the original value is undefined #10634

Merged
merged 2 commits into from
Mar 12, 2021

Conversation

NiranjanaBinoy
Copy link
Contributor

Fixes: #10553

Explanation:

Issue: TypeError: Cannot read property 'toString' of undefined error is thrown if the balance value returned for any of the accounts is undefined.
Sentry logged around 294K events from https://costone.flare.network/ext/bc/C/rpc network alone for the past 4 months(seems to start by the end of November 2020) and 2.4 K from Infura from starting around the same time.

Fix: The balance value for each account is checked for undefined, if true it will be set to 0x0 otherwise it will be passed to bnToHex() to convert the BigNumber to Hex.

@NiranjanaBinoy NiranjanaBinoy requested a review from a team as a code owner March 12, 2021 01:42
@NiranjanaBinoy NiranjanaBinoy self-assigned this Mar 12, 2021
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@NiranjanaBinoy NiranjanaBinoy requested review from danjm and removed request for danjm March 12, 2021 02:14
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@NiranjanaBinoy NiranjanaBinoy merged commit 84b1379 into develop Mar 12, 2021
@NiranjanaBinoy NiranjanaBinoy deleted the account-balance-undefined branch March 12, 2021 15:20
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2021
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.

TypeError: Cannot read property 'toString' of undefined
3 participants