chore: Bulk register actions in InstitutionalSnapController#41439
chore: Bulk register actions in InstitutionalSnapController#41439GuillaumeRx merged 10 commits intomainfrom
InstitutionalSnapController#41439Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [6fcb881]
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 2 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
6fcb881 to
2ef0448
Compare
Builds ready [2ef0448]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 0 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
19998e4 to
8bf5301
Compare
Builds ready [8bf5301]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 12 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
8bf5301 to
6fd6f27
Compare
app/scripts/controllers/institutional-snap/InstitutionalSnapController.ts
Show resolved
Hide resolved
Builds ready [6fd6f27]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 12 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Builds ready [080660b]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 12 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
cryptodev-2s
left a comment
There was a problem hiding this comment.
One small suggestion otherwise; looks good to me!
Builds ready [e965e70]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|
… `institutional-snap-controller`
e965e70 to
492d266
Compare
Builds ready [492d266]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|
## **Description** This PR updates the `InstitutionalSnapController` to use `registerMethodActionHandlers` and `MESSENGER_EXPOSED_METHODS` to register actions. ## **Changelog** CHANGELOG entry:null ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk because it changes how messenger actions are registered and renames a public hook method, which could break callers if any still reference the old handler name or types. > > **Overview** > Refactors `InstitutionalSnapController` messenger wiring to use `registerMethodActionHandlers` with an explicit `MESSENGER_EXPOSED_METHODS` list, and renames the hook implementation from `deferPublicationHook` to `publishHook`. > > Introduces an auto-generated `InstitutionalSnapController-method-action-types.ts` and updates controller messenger typings/imports (including `TransactionController` init messenger) to consume these generated action types. Tooling is updated by bumping `@metamask/messenger` and adding `@metamask/messenger-cli`, with new `messenger-action-types` check/generate steps integrated into `lint` and `lint:fix`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 492d266. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|



Description
This PR updates the
InstitutionalSnapControllerto useregisterMethodActionHandlersandMESSENGER_EXPOSED_METHODSto register actions.Changelog
CHANGELOG entry:null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Moderate risk because it changes how messenger actions are registered and renames a public hook method, which could break callers if any still reference the old handler name or types.
Overview
Refactors
InstitutionalSnapControllermessenger wiring to useregisterMethodActionHandlerswith an explicitMESSENGER_EXPOSED_METHODSlist, and renames the hook implementation fromdeferPublicationHooktopublishHook.Introduces an auto-generated
InstitutionalSnapController-method-action-types.tsand updates controller messenger typings/imports (includingTransactionControllerinit messenger) to consume these generated action types. Tooling is updated by bumping@metamask/messengerand adding@metamask/messenger-cli, with newmessenger-action-typescheck/generate steps integrated intolintandlint:fix.Reviewed by Cursor Bugbot for commit 492d266. Bugbot is set up for automated code reviews on this repo. Configure here.