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

Not user-friendly message in staking form when user does not have any T #634

Closed
2 tasks done
michalsmiarowski opened this issue Oct 3, 2023 · 2 comments
Closed
2 tasks done
Assignees
Milestone

Comments

@michalsmiarowski
Copy link
Contributor

michalsmiarowski commented Oct 3, 2023

When user does not have any T in his wallet we still display him that the minimal amount to stake is 40K:

image

When we put the correct value there it shows that the value should be less than or equal to 0:

image

We should display a proper error when user does not have any T (for example "You don't have that many T tokens in your wallet." cc @sashatanase @SorinQ).

We should also check what happens when users have some T but not enough to do stake (> 0 and < 40,000 T).

Pull Requests

  1. kpyszkowski
  2. michalsmiarowski
@kpyszkowski
Copy link
Contributor

kpyszkowski commented Oct 4, 2023

@michalsmiarowski What is the minimum stake amount? Now it allows me to stake 0.0T. Is is desirable behavior? Please elaborate how it should work.

Screen.Recording.2023-10-04.at.13.45.21.mov

@michalsmiarowski
Copy link
Contributor Author

michalsmiarowski commented Oct 4, 2023

It looks like for Goerli the minimum value is 0. On Mainnet it's 40k T. From what I see we also have a 40k minimum amount set in goerli-dapp-development packages. You can install them locally by running:

yarn upgrade @keep-network/coverage-pools@goerli \
  @keep-network/ecdsa@dapp-development-goerli \
  @keep-network/keep-core@goerli \
  @keep-network/keep-ecdsa@goerli \
  @keep-network/random-beacon@dapp-development-goerli \
  @keep-network/tbtc@goerli \
  @keep-network/tbtc-v2@dapp-development-goerli \
  @keep-network/tbtc-v2.ts@goerli \
  @threshold-network/coverage-pools@npm:@keep-network/coverage-pools@goerli \
  @threshold-network/solidity-contracts@dapp-development-goerli

The error - "You don't have that many T tokens in your wallet" - should pop out if the value in the input exceeds tha value in the user's wallet. If this condition is met, then we should check if value in input is greater or equal to minimal value (which is 40k T). If not the we display the error that is implemented right now ("The value should be greater than or equal to <minimal_value>")

@michalsmiarowski michalsmiarowski added this to the v1.13.0 milestone Oct 31, 2023
michalsmiarowski added a commit that referenced this issue Nov 21, 2023
…x-improvements

Improve staking form user experience

Ref: #634

Added validation if user wallet is empty, simplified and made validation error
messages more descriptive, improved readability of validation function, disabled
form if wallet is not connected.

Some of the issues were also addressed in
#666, which was merged
into this PR.
@michalsmiarowski michalsmiarowski modified the milestone: v1.13.0 Nov 23, 2023
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

No branches or pull requests

3 participants