-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: add feasibility_check
on mined solution
#483
Conversation
feasibility_check
on mined solutionfeasibility_check
on mined solution
pub fn mock_votes(voters: u32, desired_targets: u16) -> Vec<(u32, u16)> { | ||
assert!(voters >= desired_targets as u32); | ||
(0..voters).zip((0..desired_targets).cycle()).collect() | ||
pub fn mock_votes(voters: u32, desired_targets: u16) -> Option<Vec<(u32, u16)>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored to not panic with weird input here
active_voters, | ||
desired_targets.try_into().expect("Desired targets < u16::MAX"), | ||
) else { | ||
return Weight::MAX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored not to panic on weird input, Weight::MAX
was the best I could come with i.e, just throw away the result
Close #480 #498
You don't have to review the
staking-miner-playground
carefully it simply updates substrate to get the latest EPM changes in the metadata.