1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +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 ryanml
parent 0e7aec27c7
commit 4e686d5590

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,