Skip to content

Commit

Permalink
Decouple MetaMetricsController from TxController (#21330)
Browse files Browse the repository at this point in the history
## **Description**
With ongoing effort of `TransactionController` alignment between mobile
and extension, this PR aims to decouple `MetaMetricsController`
functions from `TransactionController` and targets to make `MetaMetrics`
event triggers client specific.

## **Manual testing steps**

No functional changes. 

## **Related issues**

Fixes MetaMask/MetaMask-planning#1053

## **Pre-merge author checklist**

- [X] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [X] I've clearly explained:
  - [X] What problem this PR is solving.
  - [X] How this problem was solved.
  - [X] How reviewers can test my changes.
- [X] I’ve indicated what issue this PR is linked to: Fixes #???
- [X] I’ve included tests if applicable.
- [X] I’ve documented any added code.
- [X] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
- [x] I’ve properly set the pull request status:
  - [x] In case it's not yet "ready for review", I've set it to "draft".
- [x] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **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.
  • Loading branch information
OGPoyraz authored Oct 19, 2023
1 parent 31ecd11 commit f748db3
Show file tree
Hide file tree
Showing 11 changed files with 1,736 additions and 1,572 deletions.
626 changes: 29 additions & 597 deletions app/scripts/controllers/transactions/index.js

Large diffs are not rendered by default.

927 changes: 1 addition & 926 deletions app/scripts/controllers/transactions/index.test.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/scripts/lib/createRPCMethodTrackingMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../../../shared/constants/security-provider';
///: END:ONLY_INCLUDE_IN

import getSnapAndHardwareInfoForMetrics from './snap-keyring/metrics';
import { getSnapAndHardwareInfoForMetrics } from './snap-keyring/metrics';

/**
* These types determine how the method tracking middleware handles incoming
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/snap-keyring/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type SnapAndHardwareMessenger = RestrictedControllerMessenger<
never
>;

export default async function getSnapAndHardwareInfoForMetrics(
export async function getSnapAndHardwareInfoForMetrics(
getSelectedAddress: () => string,
getAccountType: (address: string) => Promise<string>,
getDeviceModel: (address: string) => Promise<string>,
Expand Down
Loading

0 comments on commit f748db3

Please sign in to comment.