-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.x] fix: support ethermint's EIP712 implementation #333
[14.x] fix: support ethermint's EIP712 implementation #333
Conversation
+1 |
1 similar comment
+1 |
src/wallet.ts
Outdated
@@ -500,7 +500,7 @@ WalletMiddlewareOptions): JsonRpcMiddleware<any, Block> { | |||
*/ | |||
function validateVerifyingContract(data: string) { | |||
const { domain: { verifyingContract } = {} } = parseTypedMessage(data); | |||
if (verifyingContract && !isValidHexAddress(verifyingContract)) { | |||
if (verifyingContract && !(isValidHexAddress(verifyingContract) || verifyingContract == 'cosmos')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (verifyingContract && !(isValidHexAddress(verifyingContract) || verifyingContract == 'cosmos')) { | |
if (verifyingContract && !isValidHexAddress(verifyingContract) && verifyingContract !== 'cosmos') { |
Needs adjusting of types as well.
(FWIW: The linting can also be run locally by yarn lint
and yarn build
, and tests by yarn test
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx. fixed
* 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 <jyotipuri@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com> * Version 14.0.2 (#339) * Version 14.0.2 * Fix typo Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com> --------- Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com> --------- Co-authored-by: Jyoti Puri <jyotipuri@gmail.com> Co-authored-by: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
This has been published as |
MM is broken since v12.1.1 for cosmos chains that use
https://github.com/evmos/ethermint
as EVM adapter.Ethermint
uses hard coded"cosmos"
string as theVerifyingContract
field, which is broken sincevalidateVerifyingContract
was introduced in MM.This PR adds support to allow "cosmos" as the
VerifyingContract
value.