-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: issue where wallet_addEtherumChain
was incorrectly enforcing inclusion of a blockExplorerUrls property which is not required
#26938
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ export function validateAddEthereumChainParams(params, end) { | |
|
||
const firstValidRPCUrl = rpcUrls.find((rpcUrl) => isLocalhostOrHttps(rpcUrl)); | ||
const firstValidBlockExplorerUrl = | ||
blockExplorerUrls !== null && Array.isArray(blockExplorerUrls) | ||
blockExplorerUrls && Array.isArray(blockExplorerUrls) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does the first part of the check need to be there in the first place? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like we can scrap it! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done here cb9d89e |
||
? blockExplorerUrls.find((blockExplorerUrl) => | ||
isLocalhostOrHttps(blockExplorerUrl), | ||
) | ||
|
@@ -132,12 +132,6 @@ export function validateAddEthereumChainParams(params, end) { | |
}); | ||
} | ||
|
||
if (blockExplorerUrls !== null && !firstValidBlockExplorerUrl) { | ||
throw ethErrors.rpc.invalidParams({ | ||
message: `Expected null or array with at least one valid string HTTPS URL 'blockExplorerUrl'. Received: ${blockExplorerUrls}`, | ||
}); | ||
} | ||
|
||
if (typeof chainName !== 'string' || !chainName) { | ||
throw ethErrors.rpc.invalidParams({ | ||
message: `Expected non-empty string 'chainName'. Received:\n${chainName}`, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit of course
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done here cb9d89e