Commit fc3b5d4
- chore: bump @metamask/smart-transactions-controller to ^24.0.0
(#28943)
## **Description**
Bumps `@metamask/smart-transactions-controller` from `^23.0.0` to
`^24.0.0` and handles the v24 breaking change.
**Breaking change in v24:** The `getBearerToken` constructor parameter
was removed. The controller now calls
`AuthenticationController:getBearerToken` directly through its own
runtime messenger.
Changes made:
- `AuthenticationController:getBearerToken` moved from the init
messenger to the controller's runtime messenger
(`getSmartTransactionsControllerMessenger`)
- Removed the `getBearerToken` wrapper closure from
`smart-transactions-controller-init.ts`
- Mobile-specific: `setSentinelApiAuth` still needs the bearer token and
now calls
`controllerMessenger.call('AuthenticationController:getBearerToken')`
directly
- Updated unit tests to match the new constructor signature
No behavior change — the bearer token is still fetched and sent with
authenticated requests.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: STX-503
## **Manual testing steps**
```gherkin
Feature: smart transactions controller bump
Scenario: no behavior change
Given the app is open
When smart transactions are used
Then they behave identically to before the bump
```
## **Screenshots/Recordings**
### **Before**
N/A
### **After**
N/A
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] 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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
#### Performance checks (if applicable)
N/A — no runtime behavior change.
## **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**
> Touches auth token plumbing and messenger delegation for Smart
Transactions/Sentinel requests; incorrect wiring could silently drop
authenticated headers or break controller calls, though the change is
narrowly scoped and covered by updated tests.
>
> **Overview**
> Updates `@metamask/smart-transactions-controller` to `^24.0.0` and
adjusts the engine integration for the v24 breaking change that removes
the controller constructor’s `getBearerToken` option.
>
> `AuthenticationController:getBearerToken` delegation is moved to the
Smart Transactions *runtime* messenger, and init-time delegation is
removed; `smart-transactions-controller-init` now configures Sentinel
auth via `setSentinelApiAuth` using a token getter that calls
`controllerMessenger.call('AuthenticationController:getBearerToken')`.
Unit tests are updated to assert the new constructor signature and to
validate Sentinel auth setup/token retrieval behavior.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
e0e1eb3. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[0e57cdc](0e57cdc)
Co-authored-by: Remi ARQUEVAUX <r.arquevaux@gmail.com>
1 parent 4c406ba commit fc3b5d4
6 files changed
Lines changed: 47 additions & 48 deletions
Lines changed: 34 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
64 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | | - | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
Lines changed: 3 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 81 | + | |
86 | 82 | | |
87 | 83 | | |
88 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9934 | 9934 | | |
9935 | 9935 | | |
9936 | 9936 | | |
9937 | | - | |
9938 | | - | |
9939 | | - | |
| 9937 | + | |
| 9938 | + | |
| 9939 | + | |
9940 | 9940 | | |
9941 | 9941 | | |
9942 | 9942 | | |
| |||
9948 | 9948 | | |
9949 | 9949 | | |
9950 | 9950 | | |
9951 | | - | |
| 9951 | + | |
9952 | 9952 | | |
9953 | 9953 | | |
| 9954 | + | |
9954 | 9955 | | |
9955 | 9956 | | |
9956 | 9957 | | |
| |||
9968 | 9969 | | |
9969 | 9970 | | |
9970 | 9971 | | |
9971 | | - | |
| 9972 | + | |
9972 | 9973 | | |
9973 | 9974 | | |
9974 | 9975 | | |
| |||
35972 | 35973 | | |
35973 | 35974 | | |
35974 | 35975 | | |
35975 | | - | |
| 35976 | + | |
35976 | 35977 | | |
35977 | 35978 | | |
35978 | 35979 | | |
| |||
0 commit comments