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

chore: commit checks staker's stake #195

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

gluax
Copy link
Collaborator

@gluax gluax commented Jul 22, 2024

Motivation

To ensure committers are eligible to commit.

Explanation of Changes

Add the check to get the staker.
Add the check to see if they have the minimum.

Testing

Updated tests so executors stake before committing.
Added two tests:

  • Check if the staker exists.
  • Check if the staker has enough staked.

All tests pass.

Related PRs and Issues

Closes #190.

@gluax gluax self-assigned this Jul 22, 2024

// Check if the staker has enough funds staked to commit
let staked = STAKERS.load(deps.storage, &public_key)?;
let minimum_stake = CONFIG.load(deps.storage)?.minimum_stake_to_register;
Copy link
Member

Choose a reason for hiding this comment

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

Should be minimum_stake_for_committee_eligibility

Copy link
Member

@mariocao mariocao left a comment

Choose a reason for hiding this comment

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

Apart from Franklin's comment, looks good to me! 👍

@gluax gluax force-pushed the chore/check-if-exec-is-staked-at-commit branch from b9d2630 to d01cebc Compare July 24, 2024 14:25
@gluax gluax merged commit d01cebc into main Jul 24, 2024
2 checks passed
@gluax gluax deleted the chore/check-if-exec-is-staked-at-commit branch July 24, 2024 14:27
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.

🔧 Check if the node has staked or not at commit
3 participants