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

Sort validators by validator status property #757

Merged
merged 1 commit into from
Mar 18, 2022

Conversation

buberdds
Copy link
Contributor

@buberdds buberdds commented Mar 15, 2022

Closes #750

my preference here is to go with memoized selector, another option would be to use DataTable sortFunction prop. UX would be the same.

Screenshot 2022-03-15 at 17 07 05
0

@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #757 (37ea17c) into develop (b6458b6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop     #757   +/-   ##
========================================
  Coverage    88.02%   88.02%           
========================================
  Files           99       99           
  Lines         1628     1628           
  Branches       312      312           
========================================
  Hits          1433     1433           
  Misses         195      195           
Flag Coverage Δ
cypress 59.70% <ø> (ø)
jest 73.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6458b6...37ea17c. Read the comment docs.

@buberdds buberdds requested review from pro-wh and lukaw3d March 16, 2022 12:50
src/vendors/oasisscan.ts Outdated Show resolved Hide resolved
inactive: 2,
}

export const sortByStatus = (a, b) => ValidatorStatusPriority[a.status] - ValidatorStatusPriority[b.status]
Copy link
Member

Choose a reason for hiding this comment

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

Hm, our typescript allows parameters to not be typed? Will need to reconfigure that

@buberdds buberdds merged commit 9259c68 into oasisprotocol:develop Mar 18, 2022
@buberdds buberdds deleted the 750-sort-validators branch March 31, 2022 14:29
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.

Sort validators by their active/inactive status first, then by stake
2 participants