Remove bounds from PrevalidateAttests struct definition#2886
Merged
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
PrevalidateAttests Send + Sync and remove boundsPrevalidateAttests struct definition
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
georgepisaltu
approved these changes
Jan 9, 2024
bkchr
approved these changes
Jan 9, 2024
| pub struct PrevalidateAttests<T: Config + Send + Sync>(sp_std::marker::PhantomData<T>) | ||
| where | ||
| <T as frame_system::Config>::RuntimeCall: IsSubType<Call<T>>; | ||
| pub struct PrevalidateAttests<T>(core::marker::PhantomData<fn(T)>); |
Member
Author
There was a problem hiding this comment.
WDYM? The PhantomData<fn(T)>?
Member
Author
There was a problem hiding this comment.
But if i use PhantomData<T> then its not Send + Sync and if i remove the PD then it errors parameter T is never used.
Signed Extension does require it though.
Member
There was a problem hiding this comment.
Why does it needs to be Send and Sync?
Member
Author
bkchr
reviewed
Jan 9, 2024
| } | ||
|
|
||
| impl<T: Config + Send + Sync> SignedExtension for PrevalidateAttests<T> | ||
| impl<T: Config> SignedExtension for PrevalidateAttests<T> |
Member
There was a problem hiding this comment.
If you would just kept the bounds here, it would have been enough.
But we can go with the phantomdata trick.
bkchr
reviewed
Jan 9, 2024
Co-authored-by: Bastian Köcher <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing some bounds as it came up in #2726 while still keeping
Send + Synccapabilities.