1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

patch breaking change in signTypeData param validation (#11309)

This commit is contained in:
Alex Donesky 2021-06-15 13:17:38 -05:00 committed by ryanml
parent bb389686c3
commit 9f0ec1c18f

View File

@ -1,5 +1,5 @@
import EventEmitter from 'events'; import EventEmitter from 'events';
import { strict as assert } from 'assert'; import assert from 'assert';
import { ObservableStore } from '@metamask/obs-store'; import { ObservableStore } from '@metamask/obs-store';
import { ethErrors } from 'eth-rpc-errors'; import { ethErrors } from 'eth-rpc-errors';
import { typedSignatureHash, TYPED_MESSAGE_SCHEMA } from 'eth-sig-util'; import { typedSignatureHash, TYPED_MESSAGE_SCHEMA } from 'eth-sig-util';
@ -177,7 +177,7 @@ export default class TypedMessageManager extends EventEmitter {
break; break;
case 'V3': case 'V3':
case 'V4': { case 'V4': {
assert.equal( assert.strictEqual(
typeof params.data, typeof params.data,
'string', 'string',
'"params.data" must be a string.', '"params.data" must be a string.',
@ -191,7 +191,7 @@ export default class TypedMessageManager extends EventEmitter {
data.primaryType in data.types, data.primaryType in data.types,
`Primary type of "${data.primaryType}" has no type definition.`, `Primary type of "${data.primaryType}" has no type definition.`,
); );
assert.equal( assert.strictEqual(
validation.errors.length, validation.errors.length,
0, 0,
'Signing data must conform to EIP-712 schema. See https://git.io/fNtcx.', 'Signing data must conform to EIP-712 schema. See https://git.io/fNtcx.',