1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Fix the Sentry error for eth_getBalance (#14953)

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
This commit is contained in:
Filip Sekulic 2022-07-18 17:50:52 +02:00 committed by GitHub
parent 81a876f979
commit 769b16eaa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,8 +243,17 @@ export default class AccountTracker {
* @returns {Promise} after the account balance is updated
*/
async _updateAccount(address) {
let balance = '0x0';
// query balance
const balance = await this._query.getBalance(address);
try {
balance = await this._query.getBalance(address);
} catch (error) {
if (error.data.request.method !== 'eth_getBalance') {
throw error;
}
}
const result = { address, balance };
// update accounts state
const { accounts } = this.store.getState();