Skip to content
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

feat: Support Permit variants: PermitSingle, PermitBatch, PermitTransferFrom, PermitBatchTransferFrom, TradeOrder, Seaport #26107

Merged
merged 47 commits into from
Jul 30, 2024

Conversation

digiwand
Copy link
Contributor

@digiwand digiwand commented Jul 24, 2024

Description

Covered:

  • feat: Support Permit variants: PermitSingle, PermitBatch, PermitTransferFrom, PermitBatchTransferFrom
  • feat: Support Order variants: TradeOrder (Order), Seaport (OrderComponents)

Additionally:

  • fix: occurrence when value and token decimal has not loaded yet from hook

Blocker:
I caught a bug in this code. When we use tokenDecimals to display the amount, it might not be for the correct token if it is nested. Need to rework the logic to support nested tokenDecimals

Notes:

  • Updated current tests. No test logic changes
  • Supporting tests in follow-up PR (Issue)
  • After precision fix is merged, test cases here will need to be updated

Open in GitHub Codespaces

Related issues

Blocked by: #26105

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2644 (PermitSingle)
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2666 (PermitBatch)
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2701 (PermitTransferFrom)
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2702 (PermitBatchTransferFrom)
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2667 (Order)
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2646 (Seaport OrderComponents)

Manual testing steps

See repro steps in related issue tickets above

Screenshots/Recordings

Before

After

PermitSingle

PermitBatch

Seaport (OrderComponents)

Pre-merge author checklist

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.

@digiwand digiwand requested review from a team as code owners July 24, 2024 23:40
@digiwand digiwand marked this pull request as draft July 24, 2024 23:40
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jul 24, 2024
greptile-apps[bot]

This comment was marked as duplicate.

@digiwand digiwand marked this pull request as ready for review July 25, 2024 09:41
greptile-apps[bot]

This comment was marked as spam.

greptile-apps[bot]

This comment was marked as spam.

matthewwalsh0
matthewwalsh0 previously approved these changes Jul 26, 2024
shared/constants/signatures.ts Outdated Show resolved Hide resolved
ui/pages/confirmations/components/confirm/row/dataTree.tsx Outdated Show resolved Hide resolved
ui/pages/confirmations/components/confirm/row/dataTree.tsx Outdated Show resolved Hide resolved
@digiwand digiwand requested review from jpuri and matthewwalsh0 July 26, 2024 16:04
@digiwand
Copy link
Contributor Author

Thanks for the reviews @jpuri & @matthewwalsh0!

I ended up adding more tests here which included snapshots. The snapshots added ~1500 lines of code. It helped me discover improvements. Hope this is fine. Else, let me know, and I can move them into a separate PR

OGPoyraz
OGPoyraz previously approved these changes Jul 29, 2024
Copy link

@metamaskbot
Copy link
Collaborator

Builds ready [e6e6de5]
Page Load Metrics (506 ± 431 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint642581185024
domContentLoaded9180323617
load442883506898431
domInteractive9180323617
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 264 Bytes (0.01%)
  • ui: 1.62 KiB (0.02%)
  • common: 1.11 KiB (0.02%)

@digiwand digiwand requested a review from OGPoyraz July 29, 2024 11:58
@digiwand digiwand merged commit cd30d78 into develop Jul 30, 2024
76 checks passed
@digiwand digiwand deleted the feat-permit-variants branch July 30, 2024 10:11
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Jul 30, 2024
@digiwand
Copy link
Contributor Author

digiwand commented Aug 2, 2024

Related bug found and fixed: #26292

@digiwand
Copy link
Contributor Author

digiwand commented Aug 2, 2024

Related bug and improvements: #26324

@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants