-
Notifications
You must be signed in to change notification settings - Fork 6
Validate unsigned -> pallet::authorize #194
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
base: main
Are you sure you want to change the base?
Conversation
|
@antkve please rebase/merge with main |
c4a0588 to
e7af58e
Compare
e7af58e to
42a690a
Compare
Done. By the way I'm not sure if we want to keep backwards compatibility like in the frame system upgrade? Can add that back in. |
| pub fn store(_origin: OriginFor<T>, data: Vec<u8>) -> DispatchResult { | ||
| #[pallet::authorize(|_source, data| { | ||
| Pallet::<T>::to_validity_with_refund( | ||
| Pallet::<T>::check_unsigned_store(data.as_slice(), CheckContext::Validate), |
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.
@antkve Could we just use here PreDispatch flow, which modifies authorizations and remove all the is_authorized handling from the call?
| Pallet::<T>::check_unsigned_store(data.as_slice(), CheckContext::Validate), | |
| Pallet::<T>::check_unsigned_store(data.as_slice(), CheckContext::PreDispatch), |
|
@antkve please, check this fmt and fix compilation |
TODO
authorize_preimageand ProvideCidCodec andsp_io::hashing::blake2_256(data)incheck_unsigned