Skip to content

Commit 9034b5b

Browse files
Gudahttjpurimtsitrinmikesposito
authored
Update main with changes from v14.0.2 (#340)
* Request validation should not throw if verifyingContract is not defined in typed signature (#328) (#330) * 14.0.1 (#331) * [14.x] fix: support ethermint's EIP712 implementation (#333) * setting cosmos as allowed string for verifyingContract field * fixed and linter * readability * Update condition to match main branch * Remove duplicate copy of test --------- Co-authored-by: Jyoti Puri <[email protected]> Co-authored-by: Mark Stacey <[email protected]> * Version 14.0.2 (#339) * Version 14.0.2 * Fix typo Co-authored-by: Michele Esposito <[email protected]> --------- Co-authored-by: Michele Esposito <[email protected]> --------- Co-authored-by: Jyoti Puri <[email protected]> Co-authored-by: Michael Tsitrin <[email protected]> Co-authored-by: Michele Esposito <[email protected]>
1 parent 7fbac8b commit 9034b5b

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [14.0.2]
10+
### Fixed
11+
- Allow the string "cosmos" in the "verifyingContract" field of EIP-712 signatures ([#333](https://github.com/MetaMask/eth-json-rpc-middleware/pull/333))
12+
- This change was made to support Ethermint's EIP-712 implementation, which was broken by validation added in v14.0.0
13+
914
## [14.0.1]
1015
### Fixed
1116
- Request validation should not throw if verifyingContract is not defined in typed signature ([#328](https://github.com/MetaMask/eth-json-rpc-middleware/pull/328))
@@ -206,7 +211,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
206211
- `[email protected]` ([#53](https://github.com/MetaMask/eth-json-rpc-middleware/pull/53))
207212
- `[email protected]` ([#55](https://github.com/MetaMask/eth-json-rpc-middleware/pull/55))
208213

209-
[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.1...HEAD
214+
[Unreleased]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.2...HEAD
215+
[14.0.2]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.1...v14.0.2
210216
[14.0.1]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v14.0.0...v14.0.1
211217
[14.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v13.0.0...v14.0.0
212218
[13.0.0]: https://github.com/MetaMask/eth-json-rpc-middleware/compare/v12.1.2...v13.0.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/eth-json-rpc-middleware",
3-
"version": "14.0.1",
3+
"version": "14.0.2",
44
"description": "Ethereum-related json-rpc-engine middleware.",
55
"repository": {
66
"type": "git",

src/wallet.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,10 @@ WalletMiddlewareOptions): JsonRpcMiddleware<any, Block> {
461461
* Validates verifyingContract of typedSignMessage.
462462
*
463463
* @param data - The data passed in typedSign request.
464+
* This function allows the verifyingContract to be either:
465+
* - A valid hex address
466+
* - The string "cosmos" (as it is hard-coded in some Cosmos ecosystem's EVM adapters)
467+
* - An empty string
464468
*/
465469
function validateVerifyingContract(data: string) {
466470
const { domain: { verifyingContract } = {} } = parseTypedMessage(data);

0 commit comments

Comments
 (0)