Commit 54d632d
authored
fix: Manually construct
Manually construct `keyring_resolveAccountAddress` request to bypass
usage of `SnapKeyring`. This is required because the `SnapKeyring`
abstraction is only available when the wallet in unlocked.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Switches address resolution in `MultichainRouter` to call
`SnapController:handleRequest` with `HandlerType.OnKeyringRequest` and
`keyring_resolveAccountAddress`, avoiding dependence on `SnapKeyring`
during lock state.
>
> - Removes `resolveAccountAddress` from `SnapKeyring` and related test
mocks/utilities
> - Adds result validation (`isObject`/`assert`) and parses returned
CAIP account ID
> - Updates tests to mock `SnapController:handleRequest` for keyring
address resolution and adjust expectations
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d686e67. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->keyring_resolveAccountAddress request (#3822)1 parent 0278899 commit 54d632d
File tree
3 files changed
+64
-32
lines changed- packages/snaps-controllers/src
- multichain
- test-utils
3 files changed
+64
-32
lines changedLines changed: 41 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
| 233 | + | |
237 | 234 | | |
238 | 235 | | |
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
242 | 239 | | |
243 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
244 | 252 | | |
245 | 253 | | |
246 | 254 | | |
| |||
271 | 279 | | |
272 | 280 | | |
273 | 281 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 282 | + | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
288 | 304 | | |
289 | 305 | | |
290 | 306 | | |
| |||
315 | 331 | | |
316 | 332 | | |
317 | 333 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 334 | + | |
324 | 335 | | |
325 | 336 | | |
326 | 337 | | |
327 | 338 | | |
328 | 339 | | |
329 | 340 | | |
330 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
331 | 355 | | |
332 | 356 | | |
333 | 357 | | |
| |||
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
| |||
137 | 133 | | |
138 | 134 | | |
139 | 135 | | |
140 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| |||
151 | 149 | | |
152 | 150 | | |
153 | 151 | | |
154 | | - | |
155 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
156 | 166 | | |
157 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
158 | 171 | | |
159 | 172 | | |
160 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
| |||
106 | 103 | | |
107 | 104 | | |
108 | 105 | | |
109 | | - | |
| 106 | + | |
110 | 107 | | |
111 | | - | |
112 | 108 | | |
113 | 109 | | |
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
117 | 113 | | |
118 | | - | |
119 | 114 | | |
120 | 115 | | |
121 | 116 | | |
0 commit comments