MetaMask / MetaMask/metamask-mobile
Use controller messenger rather than raw ApprovalController in STX publish hook
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
### What is this about?
From: https://github.com/MetaMask/metamask-mobile/pull/9442#discussion_r1588996919
> Rather than passing in an entire ApprovalController instance, ideally we want to communicate via the controller messenger so we could instead provide a messenger instance as we do in the extension?
Right now we just pass an ApprovalController instance around to the STX publish hook to call its functions directly. Ideally we want to communicate via the controller messenger, so provide a messenger instance instead.
### Scenario
_No response_
### Design
_No response_
### Technical Details
_No response_
### Threat Modeling Framework
_No response_
### Acceptance Criteria
The STX feature still works the same with the controller messenger as it did with the raw ApprovalController
### Stakeholder review needed before the work gets merged
- [X] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)
### References
https://github.com/MetaMask/metamask-mobile/pull/9442#discussion_r1588996919
Contributor guide
Research direction
Trace the STX publish hook and its current ApprovalController dependency, using the discussion in PR #9442 as context for the intended controller-messenger boundary. Identify the messenger entry points and related tests before changing the integration; done means the STX feature behaves as before while receiving a controller messenger rather than the raw controller.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100