Skip to content

Commit d53139a

Browse files
authored
chore: remove 'minBalanceUSD' from eligibility response (#7248)
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> This PR removes `minBalanceUSD` from eligibility response. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs) - [x] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Remove `minBalanceUSD` from subscription eligibility and update related tests/mocks. > > - **Types**: > - Remove `minBalanceUSD` from `SubscriptionEligibility` in `packages/subscription-controller/src/types.ts`. > - **Tests**: > - Update mocks and expectations in `packages/subscription-controller/src/SubscriptionController.test.ts` and `packages/subscription-controller/src/SubscriptionService.test.ts` to drop `minBalanceUSD` from eligibility payloads and defaults. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 53c0a5c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 9b0c926 commit d53139a

File tree

4 files changed

+1
-4
lines changed

4 files changed

+1
-4
lines changed

packages/subscription-controller/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

12+
- Removed `minBalanceUSD` field from the `SubscriptionEligibility` type. ([#7248](https://github.com/MetaMask/core/pull/7248))
1213
- Updated `submitShieldSubscriptionCryptoApproval` to handle change payment method transaction if subscription already existed ([#7231](https://github.com/MetaMask/core/pull/7231))
1314
- Bump `@metamask/transaction-controller` from `^62.0.0` to `^62.3.0` ([#7215](https://github.com/MetaMask/core/pull/7215), [#7220](https://github.com/MetaMask/core/pull/7220), [#7236](https://github.com/MetaMask/core/pull/7236))
1415
- Move peer dependencies for controller and service packages to direct dependencies ([#7209](https://github.com/MetaMask/core/pull/7209))

packages/subscription-controller/src/SubscriptionController.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,6 @@ describe('SubscriptionController', () => {
14251425
const MOCK_SUBSCRIPTION_ELIGIBILITY: SubscriptionEligibility = {
14261426
product: PRODUCT_TYPES.SHIELD,
14271427
canSubscribe: true,
1428-
minBalanceUSD: 100,
14291428
canViewEntryModal: true,
14301429
modalType: MODAL_TYPE.A,
14311430
cohorts: [],

packages/subscription-controller/src/SubscriptionService.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ function createMockEligibilityResponse(overrides = {}) {
9898
return {
9999
product: PRODUCT_TYPES.SHIELD,
100100
canSubscribe: true,
101-
minBalanceUSD: 100,
102101
canViewEntryModal: true,
103102
cohorts: [],
104103
assignedCohort: null,
@@ -474,7 +473,6 @@ describe('SubscriptionService', () => {
474473
handleFetchMock.mockResolvedValue([
475474
{
476475
product: PRODUCT_TYPES.SHIELD,
477-
minBalanceUSD: 100,
478476
},
479477
]);
480478

packages/subscription-controller/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ export type Cohort = {
273273
export type SubscriptionEligibility = {
274274
product: ProductType;
275275
canSubscribe: boolean;
276-
minBalanceUSD: number;
277276
canViewEntryModal: boolean;
278277
modalType?: ModalType;
279278
cohorts: Cohort[];

0 commit comments

Comments
 (0)