diff --git a/explorer/package-lock.json b/explorer/package-lock.json index c5f21e991..e484eda6d 100644 --- a/explorer/package-lock.json +++ b/explorer/package-lock.json @@ -1269,9 +1269,9 @@ "integrity": "sha512-DetpxZw1fzPD5xUBrIAoplLChO2VB8DlL5Gg+I1IR9b2wPqYIca2WSUxL5g1vLeR4MsQq1NeWriXAVffV+U1Fw==" }, "@solana/web3.js": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-0.41.2.tgz", - "integrity": "sha512-KHHnKNJLkleSFc8kj+SvhlchlBScQHUEoD/M8idzhL067sqa/EsPMnrcXMKwp8Ro4t2QiyFMmmqkVaZbTMhEWQ==", + "version": "0.42.2", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-0.42.2.tgz", + "integrity": "sha512-Dci8Nju2IUgGCNqY8tAzpnXLgCOTtAZ/EsxjjF+jCj2jKhIZGzgv/rNdVkWFfK/sKh+A1Jr6q09yk6bNTctBHQ==", "requires": { "@babel/runtime": "^7.3.1", "bn.js": "^5.0.0", diff --git a/explorer/package.json b/explorer/package.json index b38c859eb..bd4d4bd90 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "@solana/web3.js": "^0.41.2", + "@solana/web3.js": "^0.42.2", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", diff --git a/explorer/src/providers/accounts.tsx b/explorer/src/providers/accounts.tsx index cb0bda93b..8295341c9 100644 --- a/explorer/src/providers/accounts.tsx +++ b/explorer/src/providers/accounts.tsx @@ -178,21 +178,21 @@ export async function fetchAccountInfo( const result = await new Connection(url).getAccountInfo( new PublicKey(address) ); - lamports = result.lamports; - details = { - space: result.data.length, - executable: result.executable, - owner: result.owner - }; - status = Status.Success; - } catch (error) { - if (error.toString() === "Error: Invalid request") { + if (result === null) { lamports = 0; status = Status.NotFound; } else { - console.error("Failed to fetch account info", error); - status = Status.CheckFailed; + lamports = result.lamports; + details = { + space: result.data.length, + executable: result.executable, + owner: result.owner + }; + status = Status.Success; } + } catch (error) { + console.error("Failed to fetch account info", error); + status = Status.CheckFailed; } dispatch({ type: ActionType.Update, status, lamports, details, address }); }