-
Notifications
You must be signed in to change notification settings - Fork 645
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 |
@@ -126,7 +126,7 @@ benchmarks_instance_pallet! { | |||
} | |||
|
|||
vote { | |||
let class = T::Polls::classes().into_iter().next().unwrap(); | |||
let class = T::Polls::classes().into_iter().next().ok_or(BenchmarkError::Skip)?; |
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.
what weight Skip
will result?
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.
The Secretary Collective requires skipping these extrinsics to generate weights for the ranked_collective pallet instance which uses this NoOp implementation.
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.
Yeah I have not checked the actual code, what we need to do here if classes()
returns nothing, we need to pass some invalid poll index. The function is still trying to access the storage etc.
@@ -126,7 +126,7 @@ benchmarks_instance_pallet! { | |||
} | |||
|
|||
vote { | |||
let class = T::Polls::classes().into_iter().next().unwrap(); | |||
let class = T::Polls::classes().into_iter().next().ok_or(BenchmarkError::Skip)?; |
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.
Yeah I have not checked the actual code, what we need to do here if classes()
returns nothing, we need to pass some invalid poll index. The function is still trying to access the storage etc.
@Doordashcon can you please fix it as done in this pr #3049? |
updated other benchmarks as well, hopefully ready for review @muharem @bkchr 🙏 |
updates the
Polling
trait implementation in tests.