-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: Change visibility of AmountRow
in contract interaction
#29131
fix: Change visibility of AmountRow
in contract interaction
#29131
Conversation
@@ -27,3 +33,80 @@ export const getAmountColors = (credit?: boolean, debit?: boolean) => { | |||
} | |||
return { color, backgroundColor }; | |||
}; | |||
|
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.
Perhaps it would be good to add unit tests to these util methods
const simulationDataMock = { | ||
tokenBalanceChanges: [], | ||
nativeBalanceChange: { | ||
difference: '0x3782dace9d900000' as Hex, |
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.
Can you use decimal test number constants and convert them to hex using a util, so the numbers are human readable?
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.
Make sense, done in 9a6e27a
): boolean { | ||
const value = transactionMeta?.txParams?.value ?? '0x0'; | ||
const nativeBalanceChange = | ||
transactionMeta?.simulationData?.nativeBalanceChange; |
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.
It will be nice to test cover util methods also
Builds ready [7b160db]
Page Load Metrics (1728 ± 63 ms)
Bundle size diffs
|
@@ -36,3 +41,103 @@ describe('getIsRevokeSetApprovalForAll', () => { | |||
expect(actual).toEqual(true); | |||
}); | |||
}); | |||
|
|||
describe('hasValueAndNativeBalanceMismatch', () => { |
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.
Nit: if method is simulation specific and places in utils, may be we name it as something simulationHasValueAndNativeBalanceMismatch
Builds ready [fcc975e]
Page Load Metrics (1826 ± 76 ms)
Bundle size diffs
|
Description
This PR makes two visibility change on
AmountRow
in transaction details.AmountRow
AmountRow
must be visible.Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3783
Manual testing steps
Scenario I
Scenario II
{ to: "0x4805a248c9611c22a43ce956489c9aadb6108433", value: "0xDE0B6B3A7640000", data: "0x3158952e", }
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist