-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat: use Infura gas API #23717
feat: use Infura gas API #23717
Conversation
@metamaskbot update-policies |
Policies updated |
5997d1e
to
6be0acb
Compare
@metamaskbot update-policies |
Policy update failed. You can review the logs or retry the policy update here |
@metamaskbot update-policies |
Policies updated |
test/e2e/mock-e2e.js
Outdated
@@ -190,6 +190,54 @@ async function setupMocking(server, testSpecificMock, { chainId }) { | |||
}; | |||
}); | |||
|
|||
// Both are added to support swaps e2e tests |
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.
Gas prices are fetch within swaps UI
I am not sure why chainId is override in the tests
Basically if we don't put these mocks then swaps e2e tests will fail, because it's not being caught by XHR mocks and auth modal will appear (as expected in the screenshot)
This is a quick fix but just patching the current implementation, fyi
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.
To clarify, are you saying you believe this wasn't being mocked previously and was hitting the real endpoint?
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.
Indeed, this issue went unnoticed previously because the former endpoint shared the same domain, allowing it to bypass the privacy snapshot. However, the new endpoint is protected by authentication, which explains why it is prompting for credentials, as in the screenshot.
Builds ready [2949a1b]
Page Load Metrics (980 ± 533 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #23717 +/- ##
===========================================
+ Coverage 69.11% 69.17% +0.05%
===========================================
Files 1160 1160
Lines 44296 44263 -33
Branches 11850 11832 -18
===========================================
Hits 30615 30615
+ Misses 13681 13648 -33 ☔ View full report in Codecov by Sentry. |
test/e2e/mock-e2e.js
Outdated
@@ -190,6 +190,54 @@ async function setupMocking(server, testSpecificMock, { chainId }) { | |||
}; | |||
}); | |||
|
|||
// Both are added to support swaps e2e tests |
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.
To clarify, are you saying you believe this wasn't being mocked previously and was hitting the real endpoint?
Builds ready [afbf079]
Page Load Metrics (1451 ± 599 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@metamaskbot update-policies |
Policies updated |
Builds ready [83216da]
Page Load Metrics (1221 ± 604 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
The PR looks great to me. All basic gas fee flows as well as different gas settings work as expected. |
Builds ready [4281423]
Page Load Metrics (1799 ± 684 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This PR introduces an updated
GasFeeController
that transitions to the new Infura gas API.Preview
GasFeeController
PR: MetaMask/core#4068Important Note: With the introduction of these changes, developers must complete two critical steps within their Infura project:
Access this section via
https://app.infura.io/key/<INFURA_PROJECT_ID>/all-endpoints
. Please replace<INFURA_PROJECT_ID>
with the project ID found in your.metamaskrc
file.REQUIRE API KEY SECRET FOR ALL REQUESTS
option is disabled.Access this section via
https://app.infura.io/key/<INFURA_PROJECT_ID>/settings
. Again,<INFURA_PROJECT_ID>
with the project ID found in your.metamaskrc
file.Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2254
Manual testing steps
Although there are no functional changes, the update to the gas API URL warrants manual testing of gas-related components to ensure they remain operational.
Screenshots/Recordings
N/A
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist