Skip to content

Commit eba23bb

Browse files
Matt561OGPoyraz
andauthored
fix: cp-7.62.0 disable stablecoin lending batch deposit flow (#25008)
<!-- 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** Disabling the redesigned confirmation screens for the batch lending deposit. This is meant to be temporary until the lending batch deposit flow is completed. <!-- 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: removed lendingDeposit and lendingWithdraw from the redesigned transaction confirmations constant ## **Related issues** Fixes: [MUSD-232: Redesigned lending flow is not feature flagged off](https://consensyssoftware.atlassian.net/browse/MUSD-232) ## **Manual testing steps** Attempt to deposit any stablecoin asset into lending. You should see the legacy "2-step" flow. This flow has separate transactions for the ERC-20 approve and transfer steps. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/1f7d2f04-3a06-48e2-889e-37a12f114d49 ## **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] > Temporarily disables the redesigned lending batch deposit flow and reverts deposits to the legacy confirmation. > > - In `EarnInputView`, introduce `isBatchDepositEnabled = false` and always navigate to `LENDING_DEPOSIT_CONFIRMATION`; redesigned batch path is disabled > - Update tests: skip redesigned lending deposit confirmation test; keep legacy lending navigation assertions > - Confirmation UI tweaks: map `lendingDeposit`/`lendingWithdraw` to generic `ContractInteraction` info; remove `lendingDeposit` from `FULL_SCREEN_CONFIRMATIONS` > - Narrow `useConfirmationRedesignEnabled` tests to exclude lending deposit/withdraw for the contract interaction flag > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 14c7f76. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Goktug Poyraz <omergoktugpoyraz@gmail.com>
1 parent 51f8b9a commit eba23bb

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

app/components/UI/Earn/Views/EarnInputView/EarnInputView.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ describe('EarnInputView', () => {
11221122
});
11231123
});
11241124

1125-
it('navigates to redesigned lending deposit confirmation', async () => {
1125+
it.skip('navigates to redesigned lending deposit confirmation', async () => {
11261126
// Enable stablecoin lending feature flag
11271127
selectStablecoinLendingEnabledFlagMock.mockReturnValue(true);
11281128

app/components/UI/Earn/Views/EarnInputView/EarnInputView.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,10 @@ const EarnInputView = () => {
481481
});
482482
};
483483

484-
if (isStakingDepositRedesignedEnabled) {
484+
// Temp: Will be brought back in subsequent PR.
485+
const isBatchDepositEnabled = false;
486+
487+
if (isBatchDepositEnabled) {
485488
createRedesignedLendingDepositConfirmation(earnToken, selectedAccount);
486489
} else {
487490
createLegacyLendingDepositConfirmation(
@@ -493,21 +496,20 @@ const EarnInputView = () => {
493496
selectedAccount,
494497
earnToken,
495498
shouldLogStablecoinEvent,
499+
amountTokenMinimalUnit,
496500
trackEvent,
497501
createEventBuilder,
498502
network?.name,
499503
balanceValue,
500504
amountToken,
501505
isFiat,
502-
amountTokenMinimalUnit,
503506
networkClientId,
504507
navigation,
505508
token,
506509
amountFiatNumber,
507510
annualRewardsToken,
508511
annualRewardsFiat,
509512
annualRewardRate,
510-
isStakingDepositRedesignedEnabled,
511513
]);
512514

513515
const handlePooledStakingFlow = useCallback(async () => {

app/components/Views/confirmations/components/info-root/info-root.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ const ConfirmationInfoComponentMap = {
6464
case TransactionType.perpsDeposit:
6565
return PerpsDepositInfo;
6666
// Default to contract interaction as generic transaction confirmation
67+
case TransactionType.lendingDeposit:
68+
case TransactionType.lendingWithdraw:
6769
default:
6870
return ContractInteraction;
6971
}

app/components/Views/confirmations/constants/confirmations.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export const REDESIGNED_TRANSACTION_TYPES = [
1313
TransactionType.batch,
1414
TransactionType.contractInteraction,
1515
TransactionType.deployContract,
16-
TransactionType.lendingDeposit,
17-
TransactionType.lendingWithdraw,
1816
TransactionType.musdConversion,
1917
TransactionType.perpsDeposit,
2018
TransactionType.revokeDelegation,
@@ -28,6 +26,8 @@ export const REDESIGNED_TRANSACTION_TYPES = [
2826
TransactionType.tokenMethodTransfer,
2927
TransactionType.tokenMethodTransferFrom,
3028
TransactionType.tokenMethodSafeTransferFrom,
29+
TransactionType.lendingDeposit,
30+
TransactionType.lendingWithdraw,
3131
];
3232

3333
export const REDESIGNED_APPROVE_TYPES = [
@@ -52,7 +52,6 @@ export const REDESIGNED_CONTRACT_INTERACTION_TYPES = [
5252
];
5353

5454
export const FULL_SCREEN_CONFIRMATIONS = [
55-
TransactionType.lendingDeposit,
5655
TransactionType.musdConversion,
5756
TransactionType.perpsDeposit,
5857
TransactionType.predictDeposit,

app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,7 @@ describe('useConfirmationRedesignEnabled', () => {
287287
expect(result.current.isRedesignedEnabled).toBe(true);
288288
});
289289

290-
it.each([
291-
[TransactionType.contractInteraction],
292-
[TransactionType.lendingDeposit],
293-
[TransactionType.lendingWithdraw],
294-
])(
290+
it.each([[TransactionType.contractInteraction]])(
295291
'returns true when flag is enabled for %s transaction',
296292
async (transactionType) => {
297293
confirmationRedesignFlagsMock.mockReturnValue({

0 commit comments

Comments
 (0)