-
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: Missing "Unlimited" as value for the DAI permit #29597
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. |
Builds ready [715eb4f]
Page Load Metrics (1654 ± 47 ms)
|
Builds ready [6c106c2]
Page Load Metrics (1646 ± 84 ms)
|
6c106c2
to
c2b7ffb
Compare
Builds ready [c2b7ffb]
Page Load Metrics (1760 ± 77 ms)
|
c2b7ffb
to
fb248dc
Compare
Builds ready [fb248dc]
Page Load Metrics (1693 ± 36 ms)
|
fb248dc
to
5c23171
Compare
Builds ready [0d72d36]
Page Load Metrics (1620 ± 61 ms)
Bundle size diffs
|
0d72d36
to
9a68eba
Compare
Builds ready [9a68eba]
Page Load Metrics (1660 ± 61 ms)
Bundle size diffs
|
} else if (message.allowed === false) { | ||
// revoke permit | ||
descriptionKey = 'revokeSimulationDetailsDesc'; | ||
} else { |
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.
Minor, rather than setting the fallback with an else
, could we assign it by default when we define descriptionKey
?
@@ -31,6 +31,9 @@ import { | |||
import { TOKEN_VALUE_UNLIMITED_THRESHOLD } from '../../../shared/constants'; | |||
import { getAmountColors } from '../../../utils'; | |||
|
|||
export const DAI_CONTRACT_ADDRESS = |
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.
Minor, is this better in ui/pages/confirmations/components/confirm/info/shared/constants.ts
?
@@ -136,6 +152,20 @@ const getDescription = ( | |||
if (tokenStandard === TokenStandard.ERC721) { | |||
return t('confirmTitleDescApproveTransaction'); | |||
} | |||
|
|||
const msgData = (confirmation as SignatureRequestType)?.msgParams?.data; |
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.
Should we add a utility such as isRevokeDAIPermit
to avoid the duplication?
9a68eba
to
489e1a8
Compare
Builds ready [489e1a8]
Page Load Metrics (1757 ± 53 ms)
Bundle size diffs
|
Description
Introduces a new logical path for displaying "Unlimited" in the permit simulation, for when the
allowed
property in the signature message is set and the permit is for the token DAI. This is as is specified in ERC-2612's "Backwards Compatibility" section:This PR also fixes a bug that prevents boolean values from being displayed in the key value display in the message section of signatures.
Related issues
Fixes: #28964
Manual testing steps
"allowed": true
to"allowed": false
in the aforementioned code and execute it to see the revocation screen.Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist