Skip to content

Commit 6c47a2e

Browse files
committed
chore(runway): cherry-pick fix: cp-7.49.0 eth_signTypedData_v4 on Multichain API (#16318)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** The following [PR](#16054) accidentally undid the changes to the `eth_signTypedData_v4` RPC method handler previously brought in by [this PR](#15837). So we want to make sure to bring in these changes again. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Related issues** Fixes: MetaMask/MetaMask-planning#4951 ## **Manual testing steps** 1. Go to [Multichain Test Dapp](https://metamask.github.io/test-dapp-multichain/latest/) via in app browser 2. Connect to an EVM Chain 3. Make sure per dapp selected network is set to the chain in which the `eth_signTypedData_v4` request will be sent 4. In the scope for the selected chain, select the `eth_signTypedData_v4` method and press "Invoke Method" button ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://github.com/user-attachments/assets/a7e9c607-c879-409d-a8ba-eedd4d0f52e5 ### **After** https://github.com/user-attachments/assets/3533951c-ee00-4414-99e7-efed3d21b2ee ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent ffb22bd commit 6c47a2e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/core/RPCMethods/RPCMethodMiddleware.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,11 @@ export const getRpcMethodMiddleware = ({
818818
});
819819
},
820820

821-
// TODO: Fix for Multichain API call via wallet_invokeMethod. Currently this RPC method is broken for Multichain.
822-
// ticket with details regarding the issue here: https://github.com/MetaMask/MetaMask-planning/issues/4951
823821
eth_signTypedData_v4: async () => {
824-
const data = JSON.parse(req.params[1]);
822+
const data =
823+
typeof req.params[1] === 'string'
824+
? JSON.parse(req.params[1])
825+
: req.params[1];
825826
const chainId = data.domain.chainId;
826827

827828
trace(

0 commit comments

Comments
 (0)