1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-21 17:37:01 +01:00

Update message manager and signature controller (#19370)

* Update message manager and signature controller

The packages `@metamask/message-manager` and
`@metamask/signature-controller` have been updated to the latest
versions. These versions were part of part of the [core monorepo v53](MetaMask/core#1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.

These releases included a few breaking changes, but none that affect
the extension. Both packages now expect `getCurrentChainId` to return
`Hex`, but that was already the case here. Additionally the signature
controller now has a peer dependency on the approval controller v3,
which is already present and at the correct version.

Relates to #19271

* Ignore error caused by TS bug

* Update types to omit metadata for encryption requests

* Update lavamoat policy
This commit is contained in:
Mark Stacey 2023-06-14 11:27:41 -02:30 committed by GitHub
parent 40d1df1e0d
commit b43900f743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 52 additions and 338 deletions

View File

@ -45,7 +45,7 @@ export type CoreMessage = AbstractMessage & {
};
export type StateMessage = Required<
Omit<AbstractMessage, 'securityProviderResponse'>
Omit<AbstractMessage, 'securityProviderResponse' | 'metadata'>
>;
export type DecryptMessageControllerState = {

View File

@ -45,7 +45,7 @@ export type CoreMessage = AbstractMessage & {
};
export type StateMessage = Required<
Omit<AbstractMessage, 'securityProviderResponse'>
Omit<AbstractMessage, 'securityProviderResponse' | 'metadata'>
> & {
msgParams: string;
};

View File

@ -1573,8 +1573,8 @@
},
"@metamask/message-manager": {
"packages": {
"@metamask/message-manager>@metamask/base-controller": true,
"@metamask/message-manager>@metamask/controller-utils": true,
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager>jsonschema": true,
"browserify>buffer": true,
"browserify>events": true,
@ -1583,28 +1583,6 @@
"uuid": true
}
},
"@metamask/message-manager>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/message-manager>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/message-manager>jsonschema": {
"packages": {
"browserify>url": true
@ -1734,37 +1712,15 @@
"console.info": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager": true,
"@metamask/signature-controller>@metamask/base-controller": true,
"@metamask/signature-controller>@metamask/controller-utils": true,
"browserify>buffer": true,
"browserify>events": true,
"eth-rpc-errors": true,
"ethereumjs-util": true
}
},
"@metamask/signature-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/signature-controller>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/smart-transactions-controller": {
"globals": {
"URLSearchParams": true,

View File

@ -1644,8 +1644,8 @@
},
"@metamask/message-manager": {
"packages": {
"@metamask/message-manager>@metamask/base-controller": true,
"@metamask/message-manager>@metamask/controller-utils": true,
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager>jsonschema": true,
"browserify>buffer": true,
"browserify>events": true,
@ -1654,28 +1654,6 @@
"uuid": true
}
},
"@metamask/message-manager>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/message-manager>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/message-manager>jsonschema": {
"packages": {
"browserify>url": true
@ -1924,37 +1902,15 @@
"console.info": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager": true,
"@metamask/signature-controller>@metamask/base-controller": true,
"@metamask/signature-controller>@metamask/controller-utils": true,
"browserify>buffer": true,
"browserify>events": true,
"eth-rpc-errors": true,
"ethereumjs-util": true
}
},
"@metamask/signature-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/signature-controller>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/smart-transactions-controller": {
"globals": {
"URLSearchParams": true,

View File

@ -1644,8 +1644,8 @@
},
"@metamask/message-manager": {
"packages": {
"@metamask/message-manager>@metamask/base-controller": true,
"@metamask/message-manager>@metamask/controller-utils": true,
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager>jsonschema": true,
"browserify>buffer": true,
"browserify>events": true,
@ -1654,28 +1654,6 @@
"uuid": true
}
},
"@metamask/message-manager>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/message-manager>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/message-manager>jsonschema": {
"packages": {
"browserify>url": true
@ -1924,37 +1902,15 @@
"console.info": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager": true,
"@metamask/signature-controller>@metamask/base-controller": true,
"@metamask/signature-controller>@metamask/controller-utils": true,
"browserify>buffer": true,
"browserify>events": true,
"eth-rpc-errors": true,
"ethereumjs-util": true
}
},
"@metamask/signature-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/signature-controller>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/smart-transactions-controller": {
"globals": {
"URLSearchParams": true,

View File

@ -1573,8 +1573,8 @@
},
"@metamask/message-manager": {
"packages": {
"@metamask/message-manager>@metamask/base-controller": true,
"@metamask/message-manager>@metamask/controller-utils": true,
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager>jsonschema": true,
"browserify>buffer": true,
"browserify>events": true,
@ -1583,28 +1583,6 @@
"uuid": true
}
},
"@metamask/message-manager>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/message-manager>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/message-manager>jsonschema": {
"packages": {
"browserify>url": true
@ -1734,37 +1712,15 @@
"console.info": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager": true,
"@metamask/signature-controller>@metamask/base-controller": true,
"@metamask/signature-controller>@metamask/controller-utils": true,
"browserify>buffer": true,
"browserify>events": true,
"eth-rpc-errors": true,
"ethereumjs-util": true
}
},
"@metamask/signature-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/signature-controller>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/smart-transactions-controller": {
"globals": {
"URLSearchParams": true,

View File

@ -1794,8 +1794,8 @@
},
"@metamask/message-manager": {
"packages": {
"@metamask/message-manager>@metamask/base-controller": true,
"@metamask/message-manager>@metamask/controller-utils": true,
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager>jsonschema": true,
"browserify>buffer": true,
"browserify>events": true,
@ -1804,28 +1804,6 @@
"uuid": true
}
},
"@metamask/message-manager>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/message-manager>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/message-manager>jsonschema": {
"packages": {
"browserify>url": true
@ -1955,37 +1933,15 @@
"console.info": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/message-manager": true,
"@metamask/signature-controller>@metamask/base-controller": true,
"@metamask/signature-controller>@metamask/controller-utils": true,
"browserify>buffer": true,
"browserify>events": true,
"eth-rpc-errors": true,
"ethereumjs-util": true
}
},
"@metamask/signature-controller>@metamask/base-controller": {
"packages": {
"immer": true
}
},
"@metamask/signature-controller>@metamask/controller-utils": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"ethereumjs-util": true,
"ethjs>ethjs-unit": true
}
},
"@metamask/smart-transactions-controller": {
"globals": {
"URLSearchParams": true,

View File

@ -980,7 +980,6 @@
"packages": {
"@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>are-we-there-yet": true,
"@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge": true,
"@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>console-control-strings": true,
"@storybook/react>@storybook/node-logger>npmlog>console-control-strings": true,
"nyc>yargs>set-blocking": true
}
@ -1009,9 +1008,6 @@
"@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>aproba": true,
"@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>string-width": true,
"@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>strip-ansi": true,
"@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>console-control-strings": true,
"@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>has-unicode": true,
"@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>wide-align": true,
"@storybook/react>@storybook/node-logger>npmlog>console-control-strings": true,
"@storybook/react>@storybook/node-logger>npmlog>gauge>has-unicode": true,
"@storybook/react>@storybook/node-logger>npmlog>gauge>wide-align": true,
@ -1137,33 +1133,11 @@
"@metamask/jazzicon>color>color-convert>color-name": true
}
},
"@sentry/cli>mkdirp": {
"builtin": {
"fs": true,
"path.dirname": true,
"path.resolve": true
}
},
"@storybook/addon-knobs>qs": {
"packages": {
"string.prototype.matchall>side-channel": true
}
},
"@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>has-unicode": {
"builtin": {
"os.type": true
},
"globals": {
"process.env.LANG": true,
"process.env.LC_ALL": true,
"process.env.LC_CTYPE": true
}
},
"@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>wide-align": {
"packages": {
"yargs>string-width": true
}
},
"@storybook/core>@storybook/core-server>x-default-browser>default-browser-id>untildify>os-homedir": {
"builtin": {
"os.homedir": true
@ -4912,20 +4886,9 @@
},
"packages": {
"@storybook/core>@storybook/core-server>x-default-browser>default-browser-id>untildify>os-homedir": true,
"gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": true,
"gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": true
}
},
"gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": {
"builtin": {
"os.homedir": true
},
"globals": {
"process.env": true,
"process.getuid": true,
"process.platform": true
}
},
"gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": {
"globals": {
"process.env.SystemRoot": true,
@ -4947,34 +4910,9 @@
"setTimeout": true
},
"packages": {
"gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": true,
"nyc>glob": true
}
},
"gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": {
"builtin": {
"assert": true,
"events.EventEmitter": true,
"fs": true,
"path.join": true,
"path.resolve": true,
"util": true
},
"globals": {
"console.error": true,
"process.cwd": true,
"process.nextTick": true,
"process.platform": true
},
"packages": {
"eslint>minimatch": true,
"gulp-watch>path-is-absolute": true,
"nyc>glob>fs.realpath": true,
"nyc>glob>inflight": true,
"pump>once": true,
"pumpify>inherits": true
}
},
"gulp-watch>chokidar>fsevents>node-pre-gyp>semver": {
"globals": {
"console": true,
@ -8308,7 +8246,14 @@
"path.dirname": true
},
"packages": {
"@sentry/cli>mkdirp": true
"stylelint>file-entry-cache>flat-cache>write>mkdirp": true
}
},
"stylelint>file-entry-cache>flat-cache>write>mkdirp": {
"builtin": {
"fs": true,
"path.dirname": true,
"path.resolve": true
}
},
"stylelint>global-modules": {

View File

@ -247,7 +247,7 @@
"@metamask/jazzicon": "^2.0.0",
"@metamask/key-tree": "^7.0.0",
"@metamask/logo": "^3.1.1",
"@metamask/message-manager": "^5.0.0",
"@metamask/message-manager": "^6.0.0",
"@metamask/metamask-eth-abis": "^3.0.0",
"@metamask/notification-controller": "^3.0.0",
"@metamask/obs-store": "^8.1.0",
@ -260,7 +260,7 @@
"@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.34.0-flask.1",
"@metamask/safe-event-emitter": "^2.0.0",
"@metamask/scure-bip39": "^2.0.3",
"@metamask/signature-controller": "^2.0.0",
"@metamask/signature-controller": "^3.0.0",
"@metamask/slip44": "^3.0.0",
"@metamask/smart-transactions-controller": "^3.1.0",
"@metamask/snaps-controllers": "^0.32.2",

View File

@ -4311,18 +4311,19 @@ __metadata:
languageName: node
linkType: hard
"@metamask/message-manager@npm:^5.0.0":
version: 5.0.0
resolution: "@metamask/message-manager@npm:5.0.0"
"@metamask/message-manager@npm:^6.0.0":
version: 6.0.0
resolution: "@metamask/message-manager@npm:6.0.0"
dependencies:
"@metamask/base-controller": ^2.0.0
"@metamask/controller-utils": ^3.4.0
"@metamask/base-controller": ^3.0.0
"@metamask/controller-utils": ^4.0.0
"@metamask/utils": ^5.0.2
"@types/uuid": ^8.3.0
eth-sig-util: ^3.0.0
ethereumjs-util: ^7.0.10
jsonschema: ^1.2.4
uuid: ^8.3.2
checksum: 078c7eeca03975c3a899dcaa7485ce7aaff6d97b53c2a8e8563ec4e17791b836914fbc0f57a64cbf263be231609e0ffc77eabbe9a98fdcc1240af09a733ba574
checksum: f1601145317739e06cb83aefb99cb12ecd717a164103e6094a753197dbf1b62e8eaa1e4aff8dd849d67d21358933cba7a6e1551eede0fcc32b7657496c4a2f2e
languageName: node
linkType: hard
@ -4641,33 +4642,21 @@ __metadata:
languageName: node
linkType: hard
"@metamask/signature-controller@npm:2.0.0":
version: 2.0.0
resolution: "@metamask/signature-controller@npm:2.0.0"
"@metamask/signature-controller@npm:^3.0.0":
version: 3.0.0
resolution: "@metamask/signature-controller@npm:3.0.0"
dependencies:
"@metamask/approval-controller": ^2.1.1
"@metamask/base-controller": ^2.0.0
"@metamask/controller-utils": ^3.4.0
"@metamask/message-manager": ^5.0.0
"@metamask/approval-controller": ^3.0.0
"@metamask/base-controller": ^3.0.0
"@metamask/controller-utils": ^4.0.0
"@metamask/message-manager": ^6.0.0
"@metamask/utils": ^5.0.2
eth-rpc-errors: ^4.0.2
ethereumjs-util: ^7.0.10
immer: ^9.0.6
checksum: aa7a37079cb108bd9dcb23292f82690b6796b3cde5a2b841db7f636fa9f19a5eaaa8eea7461d757dcfd664d1a6a5da3af8ea25a402c6fe575c3204390ff3964f
languageName: node
linkType: hard
"@metamask/signature-controller@patch:@metamask/signature-controller@npm%3A2.0.0#./.yarn/patches/@metamask-signature-controller-npm-2.0.0-f441f2596e.patch::locator=metamask-crx%40workspace%3A.":
version: 2.0.0
resolution: "@metamask/signature-controller@patch:@metamask/signature-controller@npm%3A2.0.0#./.yarn/patches/@metamask-signature-controller-npm-2.0.0-f441f2596e.patch::version=2.0.0&hash=6947b7&locator=metamask-crx%40workspace%3A."
dependencies:
"@metamask/approval-controller": ^2.1.1
"@metamask/base-controller": ^2.0.0
"@metamask/controller-utils": ^3.4.0
"@metamask/message-manager": ^5.0.0
eth-rpc-errors: ^4.0.2
ethereumjs-util: ^7.0.10
immer: ^9.0.6
checksum: e7bf00b7470f49a9b466cded53e77fdb9354ec66b13d9bdcf473f6a3cd9a33fe67ab5b4248c8a12c1af34aadf21c09f67c8b5b9b67f6d6f3ead702d06dec5d7a
peerDependencies:
"@metamask/approval-controller": ^3.0.0
checksum: 9afc2b8bc09d7cc6bab9d3e0bed1e70fd852cb78b0b07321afadac395cc0d7775697f99e1a846edd68afe8279929e3f763f09aa9b91eac682f0caed3e1c4fd5f
languageName: node
linkType: hard
@ -24061,7 +24050,7 @@ __metadata:
"@metamask/jazzicon": ^2.0.0
"@metamask/key-tree": ^7.0.0
"@metamask/logo": ^3.1.1
"@metamask/message-manager": ^5.0.0
"@metamask/message-manager": ^6.0.0
"@metamask/metamask-eth-abis": ^3.0.0
"@metamask/notification-controller": ^3.0.0
"@metamask/obs-store": ^8.1.0
@ -24075,7 +24064,7 @@ __metadata:
"@metamask/rpc-methods-flask": "npm:@metamask/rpc-methods@0.34.0-flask.1"
"@metamask/safe-event-emitter": ^2.0.0
"@metamask/scure-bip39": ^2.0.3
"@metamask/signature-controller": ^2.0.0
"@metamask/signature-controller": ^3.0.0
"@metamask/slip44": ^3.0.0
"@metamask/smart-transactions-controller": ^3.1.0
"@metamask/snaps-controllers": ^0.32.2