Repository navigation
Commit 0492f59
chore(batch-sell): remove unused batch sell imports and locals (#47635)
## **Description**
Removes unused imports and locals in the batch-sell review flow and the
batch-sell selector tests, as reported by `tsc --noUnusedLocals`. The
helpers `hasAnyEnabledAsset` and `hasAtLeastOneQuoteAvailable` stay;
only an unused import of them in `total-received-modal.tsx` is removed.
The modal still receives `anyEnabledAsset` and
`atLeastOneQuoteAvailable` as props.
Owner set: none (no CODEOWNERS match for any touched file).
| path | removed (file / symbol / class) | why dead |
| --- | --- | --- |
| `ui/pages/batch-sell/pages/review/components/total-received-modal.tsx`
| `useMemo`, `hasAnyEnabledAsset`, `hasAtLeastOneQuoteAvailable` imports
| unused local |
|
`ui/pages/batch-sell/pages/review/hooks/useBatchSellAggregateValidation.ts`
| `BigNumber`, `getNativeAssetForChainId` imports | unused local |
| `ui/pages/batch-sell/pages/review/hooks/useBatchSellQuotesFetching.ts`
| `CaipAssetType` import | unused local |
| `ui/pages/batch-sell/pages/review/utils/buildQuoteRequest.test.ts` |
`ASSET_ID` | unused local |
| `ui/ducks/batch-sell/selectors.test.ts` | `MOCK_SOLANA_ACCOUNT`,
`ALL_NETWORKS`, `MOCK_SOLANA_NETWORK` | unused local
(`MOCK_SOLANA_NETWORK` is a cascade: its only reader was `ALL_NETWORKS`)
|
Every removed item was proven with a whole-repo whole-word search. Other
`MOCK_SOLANA_ACCOUNT` hits are a different export in
`test/data/bridge/mock-bridge-store.ts`. Other `*_ASSET_ID` names in the
selector test are different locals. `hasAnyEnabledAsset` and
`hasAtLeastOneQuoteAvailable` remain used by the review page. Checked
against the diffs of all 562 open PRs: none edit these files.
Declaration blame is June–July 2026, outside the 60-day window, and
these files last changed before the 30-day window. No user-facing
behavior change.
Checks passed: `yarn lint:tsc`, eslint on the touched files, and `yarn
test:unit --coverage=false` for `ui/ducks/batch-sell` plus the touched
review tests (96 tests, no snapshot updates).
Docs/comments updated: none
## **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**
Refs: proactive dead-code cleanup (extension counterpart of
metamask-mobile#37948)
## **Manual testing steps**
N/A — deletes unreachable code. There is no user-facing behavior to
click through.
## **Screenshots/Recordings**
N/A — no UI change
### **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
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/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
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/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]
> **Low Risk**
> Import and test-fixture deletions only; batch-sell logic and UI props
are unchanged.
>
> **Overview**
> Dead-code cleanup in the batch-sell review flow and selector tests so
**`tsc --noUnusedLocals`** stays clean. No runtime or UI behavior
changes.
>
> **Review flow:** Drops unused imports from
**`total-received-modal.tsx`** (`useMemo`, `hasAnyEnabledAsset`,
`hasAtLeastOneQuoteAvailable`); the modal still uses
**`anyEnabledAsset`** and **`atLeastOneQuoteAvailable`** from props.
**`useBatchSellAggregateValidation`** and
**`useBatchSellQuotesFetching`** lose unused **`BigNumber`**,
**`getNativeAssetForChainId`**, and **`CaipAssetType`** imports.
**`buildQuoteRequest.test.ts`** removes an unused **`ASSET_ID`**
constant.
>
> **Tests:** **`selectors.test.ts`** removes unused Solana fixtures
(**`MOCK_SOLANA_ACCOUNT`**, **`MOCK_SOLANA_NETWORK`**,
**`ALL_NETWORKS`**) that nothing referenced after other test setup.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0fe01f8. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>1 parent 79ab2fd commit 0492f59
5 files changed
Lines changed: 1 addition & 35 deletions
File tree
- ui
- ducks/batch-sell
- pages/batch-sell/pages/review
- components
- hooks
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 85 | | |
97 | 86 | | |
98 | 87 | | |
| |||
128 | 117 | | |
129 | 118 | | |
130 | 119 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 120 | | |
149 | 121 | | |
150 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
0 commit comments