-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
User to be able to edit approval amount in simulation section of batched confirmation #15572
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
base: main
Are you sure you want to change the base?
Conversation
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. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @jpuri, the new feature is looking great! a couple of requests and suggestions above
app/components/Views/confirmations/components/edit-row-value/edit-row-value.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/SimulationDetails/BatchApprovalRow/BatchApprovalRow.test.tsx
Outdated
Show resolved
Hide resolved
…ovalRow.test.tsx Co-authored-by: digiwand <[email protected]>
…tamask-mobile into approval_amt_editing
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
balance: '0x5' as any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
balance: '0x5' as any, | |
balance: '0x5' as Hex, |
Does Hex works here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that it does not work, it actually needs an instance of BN
but it is not in dependency in project so I am not able to use it like new BN('0x5')
or '0x5' as BN
app/components/UI/SimulationDetails/EditRowValue/EditRowValue.styles.ts
Outdated
Show resolved
Hide resolved
app/components/UI/SimulationDetails/EditRowValue/EditRowValue.styles.ts
Outdated
Show resolved
Hide resolved
<Text | ||
style={styles.text} | ||
color={TextColor.Alternative} | ||
variant={TextVariant.BodyMD} | ||
> | ||
{editTexts?.description} | ||
</Text> | ||
<TextField | ||
style={styles.input} | ||
value={updatedAmount} | ||
onChange={(evt) => setUpdatedAmount(evt.nativeEvent.text)} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we think of re-using TextFieldWithLabel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app/components/Views/confirmations/hooks/7702/useBatchApproveBalanceChanges.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for curiosity - have we ever tried this for approval that has NFTs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yep, I tried approvals of ERC20 only, these changes need to be tested.
const SIGNATURE_LEGACY = 'function approve(address,uint256)'; | ||
const SIGNATURE_PERMIT2 = 'function approve(address,address,uint160,uint48)'; | ||
const SIGNATURE_INCREASE_ALLOWANCE = | ||
'function increaseAllowance(address,uint256)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to put them into app/components/Views/confirmations/constants/approvals.ts
? Also maybe INCREASE_ALLOWANCE_SIGNATURE
maybe a better naming here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the constants, I would prefer to keep name same as extension.
args?._value ?? // ERC-20 - approve | ||
args?.increment ?? // Fiat Token V2 - increaseAllowance | ||
args?.amount; // Permit2 - approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for noting those ❤️
…alanceChanges.test.ts Co-authored-by: OGPoyraz <[email protected]>
…alanceChanges.test.ts Co-authored-by: OGPoyraz <[email protected]>
…styles.ts Co-authored-by: OGPoyraz <[email protected]>
|
Description
User to be able to edit approval amount in simulation section of batched confirmation
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4972
Manual testing steps
Screenshots/Recordings
Screen.Recording.2025-05-23.at.6.08.34.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist