Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Sep 5, 2024
1 parent 63449d1 commit cb9d89e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('addEthereumChainHandler', () => {
expect(mocks.setActiveNetwork).toHaveBeenCalledWith(123);
});

it('creates a new networkConfiguration when called with no "blockExplorerUrls" property', async () => {
it('creates a new networkConfiguration when called without "blockExplorerUrls" property', async () => {
const mocks = makeMocks({
permissionsFeatureFlagIsActive: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,11 @@ export function validateAddEthereumChainParams(params, end) {
};

const firstValidRPCUrl = rpcUrls.find((rpcUrl) => isLocalhostOrHttps(rpcUrl));
const firstValidBlockExplorerUrl =
blockExplorerUrls && Array.isArray(blockExplorerUrls)
? blockExplorerUrls.find((blockExplorerUrl) =>
isLocalhostOrHttps(blockExplorerUrl),
)
: null;
const firstValidBlockExplorerUrl = Array.isArray(blockExplorerUrls)
? blockExplorerUrls.find((blockExplorerUrl) =>
isLocalhostOrHttps(blockExplorerUrl),
)
: null;

if (!firstValidRPCUrl) {
throw ethErrors.rpc.invalidParams({
Expand Down

0 comments on commit cb9d89e

Please sign in to comment.