Skip to content

Adding option to set Custom Nonce to Confirm Approve Page#10595

Merged
NiranjanaBinoy merged 16 commits intodevelopfrom
approve-token-custom-nonce
Apr 16, 2021
Merged

Adding option to set Custom Nonce to Confirm Approve Page#10595
NiranjanaBinoy merged 16 commits intodevelopfrom
approve-token-custom-nonce

Conversation

@NiranjanaBinoy
Copy link
Contributor

@NiranjanaBinoy NiranjanaBinoy commented Mar 5, 2021

Fixes: #10129

Explanation:

The option to set custom nonce was not available in Confirm Approve Page when the Customize transaction nonce is ON.

This was because <ConfirmApproveContent/> is passed as the contentComponent propertery of <ConfirmTransactionBase/> which prevents rendering of renderDetails() (method in Confirm-Transaction-Base.component.js), which contains the code for Custom Nonce settings.

The new changes includes a section to display the nextNonce number in the approve screen after Transaction Fee and before the collapsing section with Edit button. Upon clicking the edit a new modal will open enabling the user to update the nonce number.

Manual testing steps:

  • Set Customize transaction nonce to 'ON'
  • From the test-dapp connect to the wallet and Create Token
  • Once the Token is added, Click Approve token.
  • In the Approve Token window click the edit button the nonce section , a new modal will appear where the user can customize the nonce value.
Screen.Recording.2021-04-16.at.5.28.42.PM.mov

@NiranjanaBinoy NiranjanaBinoy requested a review from a team as a code owner March 5, 2021 00:05
@NiranjanaBinoy NiranjanaBinoy self-assigned this Mar 5, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2021

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.

@NiranjanaBinoy NiranjanaBinoy force-pushed the approve-token-custom-nonce branch from 9cca8ef to d785737 Compare March 5, 2021 02:41
@metamaskbot
Copy link
Collaborator

Builds ready [d785737]
Page Load Metrics (680 ± 39 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint459865136
domContentLoaded5208606798139
load5218616808139
domInteractive5198596788139

@darkwing
Copy link
Contributor

darkwing commented Mar 8, 2021

Wow @NiranjanaBinoy, this is awesome, super useful! Two quick comments:

  1. I agree we may want to approach the design team; for example, we're showing two different types of errors here, which makes the page "bounce" a bit:
ErrorMadness.mp4
  1. Is there a way we can always treat the nonce value as a number type?

@NiranjanaBinoy
Copy link
Contributor Author

Thanks, @darkwing.

Regarding your questions:

  1. As you have mentioned, we need input from the Design Team on how to manage two types of errors on the page, @rachelcope will be able to help us out 😊

  2. Using type number for nonce might be possible (but have to dig deeper), as the nextNonce returned by nonce-tracker is of type number after typescript migration. But I am afraid that change might be a little too big for this PR, we might need to confirm that with the team.

@NiranjanaBinoy
Copy link
Contributor Author

Design update from @rachelcope
https://www.figma.com/file/Emfl6CRPRtuQtzJEOJJ3hy/Approve-Screen?node-id=1417%3A1

@NiranjanaBinoy NiranjanaBinoy force-pushed the approve-token-custom-nonce branch from d785737 to a11627d Compare March 16, 2021 14:22
@metamaskbot
Copy link
Collaborator

Builds ready [a11627d]
Page Load Metrics (608 ± 31 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint45675563
domContentLoaded3887726076531
load3897746086531
domInteractive3887726076531

@metamaskbot
Copy link
Collaborator

Builds ready [60d47d4]
Page Load Metrics (609 ± 36 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint44795794
domContentLoaded3717886087536
load3727896097536
domInteractive3717886077536

@NiranjanaBinoy NiranjanaBinoy force-pushed the approve-token-custom-nonce branch from 60d47d4 to c7a7653 Compare March 23, 2021 19:43
@metamaskbot
Copy link
Collaborator

Builds ready [c7a7653]
Page Load Metrics (627 ± 28 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint48775984
domContentLoaded5648046265928
load5658056275928
domInteractive5638036265928

@metamaskbot
Copy link
Collaborator

Builds ready [efebbcc]
Page Load Metrics (583 ± 27 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint438157126
domContentLoaded3616465815527
load3626475835527
domInteractive3606465815527

@metamaskbot
Copy link
Collaborator

Builds ready [c1e6ae5]
Page Load Metrics (635 ± 27 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint449561147
domContentLoaded5577676345627
load5597686355527
domInteractive5577666345527

Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

Took my first pass on this, in addition, i'd say as a challenge to see how many of your custom classes and styles can be eliminated by making use of the Typography component as per one of my request comments.

@metamaskbot
Copy link
Collaborator

Builds ready [5dd3463]
Page Load Metrics (654 ± 29 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint4610759147
domContentLoaded5468076536029
load5488076546029
domInteractive5468066536029

@metamaskbot
Copy link
Collaborator

Builds ready [4ec500a]
Page Load Metrics (610 ± 26 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint458658105
domContentLoaded4227366095426
load4237376105426
domInteractive4217366085426

@metamaskbot
Copy link
Collaborator

Builds ready [db224e6]
Page Load Metrics (638 ± 18 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint44715884
domContentLoaded5707166363818
load5757176383818
domInteractive5707156363818

@brad-decker brad-decker force-pushed the approve-token-custom-nonce branch from 2e4a5b7 to c6527f0 Compare March 29, 2021 16:10
@metamaskbot
Copy link
Collaborator

Builds ready [c6527f0]
Page Load Metrics (664 ± 25 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint49866194
domContentLoaded5947976635225
load5957996645225
domInteractive5947976635225

@metamaskbot
Copy link
Collaborator

Builds ready [20da7f8]
Page Load Metrics (1032 ± 72 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaintNaNNaNNaNNaNNaN
domContentLoaded6731321102815072
load6741322103215072
domInteractive6731321102815072

@metamaskbot
Copy link
Collaborator

Builds ready [b68233d]
Page Load Metrics (612 ± 33 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint438256126
domContentLoaded4417776107033
load4427786126933
domInteractive4417776107033

Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

Getting close :D. My goal with this review was to help reduce overhead of maintaining this feature in the future. This really focused on:

  1. Eliminating as much custom css as possible to achieve the effect.
  2. Looking at CSS patterns to make sure that known maintenance issues like using absolute positioning are not used.
  3. Semantic HTML

Let me know if I can help in anyway!

@metamaskbot
Copy link
Collaborator

Builds ready [6d5d9ee]
Page Load Metrics (578 ± 31 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint44715684
domContentLoaded3676495756330
load3696695786531
domInteractive3676485756330

@NiranjanaBinoy NiranjanaBinoy force-pushed the approve-token-custom-nonce branch from 6d5d9ee to 4734776 Compare April 16, 2021 20:58
@metamaskbot
Copy link
Collaborator

Builds ready [4734776]
Page Load Metrics (647 ± 39 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint468461115
domContentLoaded4098646468239
load4108656478239
domInteractive4098636468239

Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

c'est magnifique!

@NiranjanaBinoy NiranjanaBinoy merged commit 18aa540 into develop Apr 16, 2021
@NiranjanaBinoy NiranjanaBinoy deleted the approve-token-custom-nonce branch April 16, 2021 22:00
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Nonce setting not passed to ConfirmTransactionBase from ConfirmApprove component (approve spend limit dialog)

6 participants