Skip to content

Conversation

@r-czajkowski
Copy link
Contributor

Closes: #103
Depends on: #117

This PR adds validation to the staking form. To stake in T network the minimum stake amount is required. Currently it is 40,000 T.

Main changes:

  • set the placeholder for input in staking form- Minimum stake <amount> T,
  • create a hook that returns the min stake amount- it fetches the min stake amount if needed and saves in a redux store. If a value already exists in redux store a hook will return a value from redux store, otherwise fetches the value from chain,
  • update the TokenAmountForm - allow to set the placeholder for an input and set the required minimum amount to submit a form.

Create a hook that fetches the min stake amount if needed and saves in a
redux store. If a value already exists in redux store a hook will return
a value from redux store, otherwise fetches the value from chain.
Allow to set the placeholder for input and the required minimum amout to
submit a form.
Set the placeholder with format `Minimum stake <amount> T`. Add
validation for minimum amount- the minimum stake amount is required to
stake in T network. Currently it is `40,000 T`.
@github-actions
Copy link

Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

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

Looking good! Left some small comments (one non-blocking)

Fetch minimum stake from chain  only if the t staking contract is not
null.
@github-actions
Copy link

Base automatically changed from how-it-works-page to main June 1, 2022 09:35
Copy link
Contributor

@michalsmiarowski michalsmiarowski left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@michalsmiarowski michalsmiarowski merged commit 16a4dbb into main Jun 1, 2022
@michalsmiarowski michalsmiarowski deleted the min-stake-validation branch June 1, 2022 09:42
georgeweiler pushed a commit that referenced this pull request Sep 8, 2022
Minimum Stake validation

This PR adds validation to the staking form. To stake in T network the minimum 
stake amount is required. Currently it is 40,000 T.

Main changes:

- set the placeholder for input in staking form- Minimum stake <amount> T,
- create a hook that returns the min stake amount- it fetches the min stake 
amount if needed and saves in a redux store. If a value already exists in redux 
store a hook will return a value from redux store, otherwise fetches the value 
from chain,
- update the TokenAmountForm - allow to set the placeholder for an input and set
the required minimum amount to submit a form.
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.

Don't allow to stake amounts below the min stake

3 participants