-
Notifications
You must be signed in to change notification settings - Fork 688
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
NoOp Impl Polling Trait #5311
base: master
Are you sure you want to change the base?
NoOp Impl Polling Trait #5311
Conversation
@Doordashcon do you have any reasoning for this? |
@bkchr just a follow up on this? |
The comment is saying that this no-op should be implemented on |
Implemented |
@Doordashcon can you please fix it as done in this pr #3049? |
Pallet: "pallet_ranked_collective", Extrinsic: "vote", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: `SecretaryCollective::Members` (r:1 w:0)
Proof: `SecretaryCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
....
Pallet: "pallet_ranked_collective", Extrinsic: "cleanup_poll", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: `SecretaryCollective::VotingCleanup` (r:1 w:0)
Proof: `SecretaryCollective::VotingCleanup` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) |
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.
Generally looking good, just some nitpicks
It is known that both extrinsics each involve a single read operation. This can be manually accounted for, rather than relying on the default value for a non existent class. Would you agree with this approach @bkchr? let class_exists = T::Polls::classes().into_iter().next().is_some();
let class = if class_exists {
T::Polls::classes().into_iter().next().unwrap() // Assuming there's at least one class here
} else {
return Err(BenchmarkError::Override(BenchmarkResult::from_weight(
T::DbWeight::get().reads(1),
)));
}; |
See this. |
please review @bkchr I saw no other way to create an invalid poll for a NoOp Poll than adding |
Adds NoOp implementation for the
Polling
trait and updates benchmarks inpallet-ranked-collective
.