Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## **Description** In v7.10.0, signatures including a `bytes` field with the value `0x` were being encoded differently than before. Previously the string `0x` was interpreted as an "empty" hex number, but as of v7.10.0 they were encoded as the string "0x". This change was not intentional, and it resulted in invalid signatures. This problem was introduced in `@metamask/[email protected]` (see here for details: MetaMask/eth-sig-util#340). This package was introduced to mobile when `@metamask/keyring-controller` was updated to v6 (#7267). The keyrings themselves still use `@metamask/[email protected]`, but the `KeyringController` is signing these messages directly rather than delegating to the keyrings, which is why the newer `@metamask/eth-sig-util` package is used here. This has been resolved by updating all affected versions of `@metamask/eth-sig-util`. ## **Related issues** Fixes #7792 ## **Manual testing steps** 1. Navigate to https://gudahtt.github.io/test-dapp/ in the in-app browser 2. Sign a message using `eth_signTypedData_v4` 3. Attempt to verify that message. On production (v7.10.0) this does not work. It should work correctly on this branch, returning the signing account address. ## **Screenshots/Recordings** **Before** https://recordit.co/xejXpo4mlh **After** https://recordit.co/NnnpxbCVRB ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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. --------- Co-authored-by: legobt <[email protected]>
- Loading branch information