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

fix: Redesign Signature Message date values #27249

Merged
merged 9 commits into from
Sep 20, 2024

Conversation

digiwand
Copy link
Contributor

@digiwand digiwand commented Sep 18, 2024

Description

Fix date values:

  • Formerly, conversations were converting values as if they were milliseconds. However, these values come from Solidity where these timestamps are unix timestamps in seconds.
  • Support -1 (no expiration) value
  • Display "expiry" as a date instead of a unix timestamp

This PR fixes the conversion.

Open in GitHub Codespaces

Related issues

Fixes: #27137

Manual testing steps

  1. Go to test-dapp
  2. Request Permit or another TypedSign request
  3. Observe deadlines and dates

Screenshots/Recordings

Before

Test-dapp Permit

Deadline: -1

After

Test-dapp Permit

Deadline: -1

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.

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.

@github-actions github-actions bot added the team-confirmations Push issues to confirmations team label Sep 18, 2024
Copy link

sonarcloud bot commented Sep 18, 2024

@digiwand digiwand changed the title Fix: Redesign Signature Message date values fix: Redesign Signature Message date values Sep 19, 2024
return DateTime.fromMillis(dateInMillis)
.setZone('utc')
return DateTime.fromSeconds(unixTimestamp)
.toUTC()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.toUTC() is equivalent to .setZone('utc')

Copy link

sonarcloud bot commented Sep 20, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [1bdfda2]
Page Load Metrics (1759 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26421841692358172
domContentLoaded15932129173312962
load16012186175914168
domInteractive217137168
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 394 Bytes (0.01%)
  • common: 50 Bytes (0.00%)

@digiwand digiwand marked this pull request as ready for review September 20, 2024 09:22
@digiwand digiwand requested review from a team as code owners September 20, 2024 09:22
@digiwand digiwand merged commit f41ef9b into develop Sep 20, 2024
80 checks passed
@digiwand digiwand deleted the fix-redesign-sign-date-displays branch September 20, 2024 11:21
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 20, 2024
@digiwand digiwand added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 20, 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.

[Bug]: Expiration and deadline dates in redesigned signatures
4 participants