Commit 5e5cef8
authored
chore: Bulk register actions in
## **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 -->InstitutionalSnapController (#41439)1 parent 4c20c28 commit 5e5cef8
7 files changed
Lines changed: 86 additions & 68 deletions
File tree
- app/scripts
- controller-init/messengers
- accounts
- controllers/institutional-snap
Lines changed: 8 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 5 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 6 | + | |
| 7 | + | |
20 | 8 | | |
21 | 9 | | |
22 | 10 | | |
| |||
26 | 14 | | |
27 | 15 | | |
28 | 16 | | |
29 | | - | |
| 17 | + | |
30 | 18 | | |
31 | 19 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 20 | + | |
| 21 | + | |
38 | 22 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 23 | + | |
| 24 | + | |
43 | 25 | | |
44 | 26 | | |
45 | 27 | | |
| |||
54 | 36 | | |
55 | 37 | | |
56 | 38 | | |
57 | | - | |
| 39 | + | |
58 | 40 | | |
59 | 41 | | |
60 | 42 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
Lines changed: 12 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 44 | | |
55 | 45 | | |
56 | 46 | | |
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
63 | | - | |
64 | | - | |
| 58 | + | |
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
| |||
100 | 94 | | |
101 | 95 | | |
102 | 96 | | |
103 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
104 | 101 | | |
105 | 102 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 103 | + | |
109 | 104 | | |
110 | 105 | | |
111 | 106 | | |
| |||
128 | 123 | | |
129 | 124 | | |
130 | 125 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 126 | | |
144 | 127 | | |
145 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
268 | | - | |
| 270 | + | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| |||
351 | 353 | | |
352 | 354 | | |
353 | 355 | | |
354 | | - | |
| 356 | + | |
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
| |||
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
| 533 | + | |
531 | 534 | | |
532 | 535 | | |
533 | 536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7118 | 7118 | | |
7119 | 7119 | | |
7120 | 7120 | | |
7121 | | - | |
7122 | | - | |
7123 | | - | |
7124 | | - | |
| 7121 | + | |
| 7122 | + | |
| 7123 | + | |
| 7124 | + | |
| 7125 | + | |
| 7126 | + | |
| 7127 | + | |
| 7128 | + | |
| 7129 | + | |
| 7130 | + | |
| 7131 | + | |
| 7132 | + | |
| 7133 | + | |
| 7134 | + | |
| 7135 | + | |
| 7136 | + | |
| 7137 | + | |
| 7138 | + | |
| 7139 | + | |
| 7140 | + | |
| 7141 | + | |
| 7142 | + | |
| 7143 | + | |
| 7144 | + | |
| 7145 | + | |
| 7146 | + | |
| 7147 | + | |
| 7148 | + | |
| 7149 | + | |
7125 | 7150 | | |
7126 | 7151 | | |
7127 | 7152 | | |
| |||
34139 | 34164 | | |
34140 | 34165 | | |
34141 | 34166 | | |
34142 | | - | |
| 34167 | + | |
| 34168 | + | |
34143 | 34169 | | |
34144 | 34170 | | |
34145 | 34171 | | |
| |||
0 commit comments