feat: support updated EIP-5792 specification#30967
Conversation
|
Updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
7244dda to
cdc0dec
Compare
Update unit tests.
Remove capabilities.
Add constants. Add version validation.
298b977 to
6aa2f5b
Compare
Builds ready [6940043]
Page Load Metrics (3290 ± 1452 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| // Temporary fix for E2E tests that rely on `gasLimit` being ignored | ||
| // and resulting `eth_estimateGas` delaying confirmation. | ||
| if (process.env.IN_TEST && transactionParams.gasLimit?.length) { | ||
| transactionParams.gasLimit = undefined; |
There was a problem hiding this comment.
Upgrading @metamask/transaction-controller past 48.2.0 includes a fix that supports both gas and gasLimit in params.
Many of the E2E tests use the #sendButton to create legacy transactions via the test dApp, which includes gasLimit.
As this was previously ignored, the transaction controller would automatically estimate the gas limit via eth_estimateGas which would slightly delay the display of the confirmation.
Some of these tests were reliant on that timing, meaning they now break since the confirmations display quicker as no estimate is performed since the gasLimit is provided.
This is the quickest and least invasive fix as it doesn't require new releases, doesn't require refactoring multiple E2E tests, and doesn't require a patch which would be very large since the test dApp code is minimised to a single line.
Description
Support updated EIP-5792 specification.
See #363 for specification changes.
Specifically:
GetCallsStatushook.wallet_sendCalls.versionnot supported inwallet_sendCalls.batchId.wallet_getCapabilities.statuscode fromwallet_getCallsStatus.@metamask/transaction-controllerto49.0.0.@metamask/eth-json-rpc-middlewareto16.0.0.Related issues
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist