-
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
Check specified chain ID against endpoint return value #9491
Conversation
ui/app/pages/settings/networks-tab/network-form/network-form.component.js
Outdated
Show resolved
Hide resolved
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.
Seems legit
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.
LGTM!
ui/app/pages/settings/networks-tab/network-form/network-form.component.js
Outdated
Show resolved
Hide resolved
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.
LGTM!
886a77f
to
69c71d4
Compare
bfc5902
to
7af85c5
Compare
Builds ready [7af85c5]
Page Load Metrics (493 ± 87 ms)
|
Builds ready [be40a26]
Page Load Metrics (431 ± 50 ms)
|
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.
LGTM!
fb2983a
to
857cfbe
Compare
Builds ready [e376823]
Page Load Metrics (448 ± 59 ms)
|
const jsonRpcResponse = await window.fetch(rpcUrl, { | ||
method: 'POST', | ||
body: JSON.stringify({ | ||
id: Date.now().toString(), | ||
jsonrpc: '2.0', | ||
method: rpcMethod, | ||
params: rpcParams, | ||
}), | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
cache: 'default', | ||
}) | ||
.then((httpResponse) => httpResponse.json()) |
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: .then
=> async/await
const jsonRpcResponse = await window.fetch(rpcUrl, { | |
method: 'POST', | |
body: JSON.stringify({ | |
id: Date.now().toString(), | |
jsonrpc: '2.0', | |
method: rpcMethod, | |
params: rpcParams, | |
}), | |
headers: { | |
'Content-Type': 'application/json', | |
}, | |
cache: 'default', | |
}) | |
.then((httpResponse) => httpResponse.json()) | |
const httpResponse = await window.fetch(rpcUrl, { | |
method: 'POST', | |
body: JSON.stringify({ | |
id: Date.now().toString(), | |
jsonrpc: '2.0', | |
method: rpcMethod, | |
params: rpcParams, | |
}), | |
headers: { | |
'Content-Type': 'application/json', | |
}, | |
cache: 'default', | |
}) | |
const jsonRpcResponse = await httpResponse.json() |
* @param {string} rpcUrl - The RPC endpoint URL to target. | ||
* @param {string} rpcMethod - The RPC method to request. | ||
* @param {Array<unknown>} [rpcParams] - The RPC method params. | ||
* @returns {Promise<unknown|undefined>} Returns the result of the RPC method call, |
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: unknown|undefined
seems redundant 🤔 since undefined
is a valid unknown
value
* @returns {Promise<unknown|undefined>} Returns the result of the RPC method call, | |
* @returns {Promise<unknown>} Returns the result of the RPC method call, |
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.
LGTM! Couple of small suggestions remain, but nothing blocking.
I decided to merge this as-is so that we can get another RC up without further delay |
Adds additional validation to
chainId
values in the network form, by comparing the specified value against the value returned by the endpoint.