1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Fix issue with chainId comparison in sign typed message param validation (#11900)

This commit is contained in:
Alex Donesky 2021-08-24 11:23:29 -05:00 committed by GitHub
parent 0d63aa0402
commit 33849bfec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,7 +204,7 @@ export default class TypedMessageManager extends EventEmitter {
`Cannot sign messages for chainId "${chainId}", because MetaMask is switching networks.`,
);
if (typeof chainId === 'string') {
chainId = parseInt(chainId, 16);
chainId = parseInt(chainId, chainId.startsWith('0x') ? 16 : 10);
}
assert.equal(
chainId,