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

St 809 do not allow user to enter amounts larger than the amount being held web extension #529

Conversation

mwmerz
Copy link
Contributor

@mwmerz mwmerz commented Sep 20, 2023

  • include tax in max calculation

@mwmerz mwmerz changed the base branch from main to is-sprint-27 September 20, 2023 21:42
@mwmerz
Copy link
Contributor Author

mwmerz commented Sep 20, 2023

  • With max sufficiently calculated, normal form validation will block submission of transactions out of range.

@mwmerz mwmerz requested a review from terran6 September 20, 2023 21:45
Copy link
Contributor

@terran6 terran6 left a comment

Choose a reason for hiding this comment

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

I think we should not allow the user to input any number larger than the maximum. I think the same should be done on extension.

disallow-values-larger-than-max.mov

@mwmerz
Copy link
Contributor Author

mwmerz commented Sep 21, 2023

The form validation will not allow it to submit. This has been the ux and convention since the beginning. I do not agree that this is something that requires change.

@mwmerz
Copy link
Contributor Author

mwmerz commented Sep 21, 2023

At best, we can restrict the rendering of the fee box. But I do not agree that this is a valuable use of our limited time. The goal here is to prevent loss of funds due to failed txs if the user clicks max.

@terran6
Copy link
Contributor

terran6 commented Sep 21, 2023

@mwmerz would we not at least want to disable the Send button until all requirements are met?

Also, it seems the fee is not being properly subtracted when attempting a SWTH transaction:

include-fee-in-tx-calc.mov

@mwmerz
Copy link
Contributor Author

mwmerz commented Sep 21, 2023

Disabling send was my gut reaction too. However, the form validation still prevents submission.

Regarding posting fees and taxes, yes, I agree that those should be listed, for both carbon and classic.

We can hack a way in for now. The right way to do this will be to add tax and fee strategies based on chain, which would require a refactor of that component.

Otherwise we're using a switch to manually solve for 2 edge cases and are not future-proofing the component against other exotic fee structures in the future.

Copy link
Contributor

@terran6 terran6 left a comment

Choose a reason for hiding this comment

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

Other than the above, looks good.

@mwmerz mwmerz merged commit b2184ce into is-sprint-27 Sep 21, 2023
@mwmerz mwmerz deleted the ST-809-Do-not-allow-user-to-enter-amounts-larger-than-the-amount-being-held-Web-Extension branch September 21, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants