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

refactor: more accurate return type of get_candidate_to_xxx functions #140

Merged
merged 3 commits into from
Jan 30, 2023

Conversation

0xdefacto
Copy link
Contributor

@0xdefacto 0xdefacto commented Jan 29, 2023

For the return type of both get_candidate_to_unstake and get_candidate_to_stake function, amount is useless when candidate is None. So a more accurate type to define their return values is Option<(Validator, Balance)>, for which I have added a new struct CandidateValidator.

@linguists linguists changed the title refactor: a more accurate type return by get_candidate_xxs refactor: more accurate return type of get_candidate_to_xxx functions Jan 30, 2023
@linguists linguists merged commit 96cdc26 into main Jan 30, 2023
@linguists linguists deleted the refactor/stronger-type branch January 30, 2023 17:25
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.

3 participants