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

Remove condition to disable transaction confirm button if user has no balance #7335

Merged
merged 22 commits into from
Oct 19, 2023

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Sep 26, 2023

Description

Currently we have these 2 conditions checked to disable submit button on confirmation pages:

  1. account balance is less that gas + transaction value or
  2. account balance is 0

The second condition disables a 0 value transaction on a gasless network - something we support in MetaMask extension.

The PR removes the second condition and the first one alone is sufficient.

Manual testing steps

  1. Follow the steps listed here https://consensys.net/docs/goquorum/en/latest/tutorials/quorum-dev-quickstart/ to run Quorum locally
  2. Run a DAPP locally and send transaction with value and gasPrice to 0
  3. Notice the "Submit" button is enabled

Related issues

_Fixes #6567

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@jpuri jpuri added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-confirmations-secure-ux DEPRECATED: please use "team-confirmations" label instead labels Sep 26, 2023
@jpuri jpuri requested a review from a team as a code owner September 26, 2023 10:06
@github-actions
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.

@jpuri jpuri changed the title Remove condition to not disable transaction confirm button if user has no balance Remove condition to disable transaction confirm button if user has no balance Sep 26, 2023
blackdevelopa
blackdevelopa previously approved these changes Sep 27, 2023
digiwand
digiwand previously approved these changes Sep 29, 2023
Copy link
Contributor

@digiwand digiwand left a comment

Choose a reason for hiding this comment

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

Lgtm! can merge after ci / scripts (audit:ci) test works again. more details can be found here

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (9a37d5a) 34.61% compared to head (a91cd4f) 34.61%.
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7335      +/-   ##
==========================================
- Coverage   34.61%   34.61%   -0.01%     
==========================================
  Files        1019     1019              
  Lines       27192    27191       -1     
  Branches     2217     2218       +1     
==========================================
- Hits         9412     9411       -1     
  Misses      17289    17289              
  Partials      491      491              
Files Coverage Δ
app/components/UI/TransactionReview/index.js 50.00% <ø> (-1.00%) ⬇️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from confirmation_error_fix to main October 17, 2023 10:03
@jpuri jpuri dismissed stale reviews from digiwand and blackdevelopa October 17, 2023 10:03

The base branch was changed.

@jpuri
Copy link
Contributor Author

jpuri commented Oct 17, 2023

blackdevelopa
blackdevelopa previously approved these changes Oct 18, 2023
Copy link
Contributor

@digiwand digiwand left a comment

Choose a reason for hiding this comment

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

just curious what was the thought around removing senderBalanceIsZero entirely? Should we preserve this for networks we know that use gas?

segun
segun previously approved these changes Oct 18, 2023
@jpuri jpuri dismissed stale reviews from segun and blackdevelopa via a91cd4f October 19, 2023 08:33
@sonarcloud
Copy link

sonarcloud bot commented Oct 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@jpuri jpuri merged commit ab43c88 into main Oct 19, 2023
25 checks passed
@jpuri jpuri deleted the trx_balance_err_fix branch October 19, 2023 08:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2023
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.10.0 team-confirmations-secure-ux DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants