-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix (cherry-pick): Adding patch on eth-json-rpc-middleware to disable…
… verifyContract field validation for cosmos (#27065) Cherry-picks #27021 (4ee09fc) ## **Description** Adding patch on eth-json-rpc-middleware to disable verifyContract field validation for cosmos ## **Related issues** Fixes: #26980 ## **Manual testing steps** 1. Submit a types signature request with verifyingContract set to `cosmos` 2. Ensure that you are able to sign it ## **Screenshots/Recordings** <img width="360" alt="Screenshot 2024-09-10 at 4 08 00 PM" src="https://github.com/user-attachments/assets/a56bb8bd-abed-4fae-9c50-a3a25addd5b5"> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [ ] 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-extension/blob/develop/.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.
- Loading branch information
Showing
3 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.yarn/patches/@metamask-eth-json-rpc-middleware-npm-14.0.1-b6c2ccbe8c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/dist/wallet.js b/dist/wallet.js | ||
index fce8272ab926443df4c5971c811664f849791425..9237ffcaaea2260e01182feecec667b10edd35a0 100644 | ||
--- a/dist/wallet.js | ||
+++ b/dist/wallet.js | ||
@@ -293,7 +293,7 @@ exports.createWalletMiddleware = createWalletMiddleware; | ||
*/ | ||
function validateVerifyingContract(data) { | ||
const { domain: { verifyingContract } = {} } = (0, normalize_1.parseTypedMessage)(data); | ||
- if (verifyingContract && !(0, utils_1.isValidHexAddress)(verifyingContract)) { | ||
+ if (verifyingContract && verifyingContract !== 'cosmos' && !(0, utils_1.isValidHexAddress)(verifyingContract)) { | ||
throw rpc_errors_1.rpcErrors.invalidInput(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters