-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore(runway): cherry-pick feat: add new metrics key to transactions cp-7.61.0 #23708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(runway): cherry-pick feat: add new metrics key to transactions cp-7.61.0 #23708
Conversation
…cp-7.61.0 (#23585) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR adds `account_hardware_type` to transaction events when the account is a hardware account. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1259?atlOrigin=eyJpIjoiNGE0MjcyYTY0YjE0NGEyNGEwNWVjZGYwYWMzYjFkMWEiLCJwIjoiaiJ9 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** No visual changes. <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **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 - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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. ## **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] > Adds `account_hardware_type` to transaction metrics and standardizes QR account type to "QR Hardware", updating analytics usage and tests. > > - **Analytics/Transactions**: > - Add `account_hardware_type` to `generateDefaultTransactionMetrics` in `transaction-controller/utils.ts`; populated when `isHardwareAccount(from)` is true, else `null`. > - Update tests in `transaction-controller/utils.test.ts` to expect `account_hardware_type`, add hardware wallet scenarios, and refactor address mocks. > - **Address utilities**: > - Change `getAddressAccountType` to return `"QR Hardware"` for `qr` keyrings in `app/util/address/index.ts` and update related tests. > - **UI Analytics**: > - In `EditAccountName.tsx`, map `account_type` to `hardware` when type is `"QR Hardware"` for the ACCOUNT_RENAMED event. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8e4d25d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Charly Chevalier <[email protected]>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes affect critical parts of the application:
Selected Tags Justification:
The changes have comprehensive test coverage but touch critical transaction paths. The risk is HIGH because:
While the changes include thorough unit tests, E2E testing is warranted to ensure the integration works correctly across transaction flows, hardware wallet interactions, and account management. |
|
|
No release label on PR. Adding release label release-7.61.0 on PR, as PR was cherry-picked in branch 7.61.0. |



Description
This PR adds
account_hardware_typeto transaction events when theaccount is a hardware account.
Changelog
CHANGELOG entry: null
Related issues
Fixes:
https://consensyssoftware.atlassian.net/browse/MUL-1259?atlOrigin=eyJpIjoiNGE0MjcyYTY0YjE0NGEyNGEwNWVjZGYwYWMzYjFkMWEiLCJwIjoiaiJ9
Manual testing steps
Screenshots/Recordings
Before
No visual changes.
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Adds
account_hardware_typeto transaction metrics for hardware accounts and renames QR account type to "QR Hardware" across code and tests.account_hardware_typetogenerateDefaultTransactionMetrics(null for non-HW; set to account type for HW viaisHardwareAccount).getAddressAccountTypeto return"QR Hardware"(was"QR")."QR Hardware".EditAccountNameanalytics mapping to treat"QR Hardware"as"hardware"foraccount_type.Written by Cursor Bugbot for commit 4c200fd. This will update automatically on new commits. Configure here.
Co-authored-by: Charly Chevalier [email protected] e47bcb5