mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
Create sp-weights crate to store weight primitives (#12219)
* Create sp-weights crate to store weight primitives * Fix templates * Fix templates * Fixes * Fixes * cargo fmt * Fixes * Fixes * Use deprecated type alias instead of deprecated unit types * Use deprecated subtraits instead of deprecated hollow new traits * Fixes * Allow deprecation in macro expansion * Add missing where clause during call macro expansion * cargo fmt * Fixes * cargo fmt * Fixes * Fixes * Fixes * Fixes * Move FRAME-specific weight files back to frame_support * Fixes * Update frame/support/src/dispatch.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/support/src/dispatch.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/support/src/dispatch.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Add missing header * Rewrite module docs * Fixes * Fixes * Fixes * Fixes * cargo fmt Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -123,6 +123,9 @@ pub fn expand_outer_dispatch(
|
||||
}
|
||||
}
|
||||
}
|
||||
// Deprecated, but will warn when used
|
||||
#[allow(deprecated)]
|
||||
impl #scrate::weights::GetDispatchInfo for RuntimeCall {}
|
||||
impl #scrate::dispatch::GetCallMetadata for RuntimeCall {
|
||||
fn get_call_metadata(&self) -> #scrate::dispatch::CallMetadata {
|
||||
use #scrate::dispatch::GetCallName;
|
||||
@@ -161,8 +164,8 @@ pub fn expand_outer_dispatch(
|
||||
impl #scrate::dispatch::Dispatchable for RuntimeCall {
|
||||
type Origin = Origin;
|
||||
type Config = RuntimeCall;
|
||||
type Info = #scrate::weights::DispatchInfo;
|
||||
type PostInfo = #scrate::weights::PostDispatchInfo;
|
||||
type Info = #scrate::dispatch::DispatchInfo;
|
||||
type PostInfo = #scrate::dispatch::PostDispatchInfo;
|
||||
fn dispatch(self, origin: Origin) -> #scrate::dispatch::DispatchResultWithPostInfo {
|
||||
if !<Self::Origin as #scrate::traits::OriginTrait>::filter_call(&origin, &self) {
|
||||
return #scrate::sp_std::result::Result::Err(
|
||||
|
||||
@@ -255,6 +255,10 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated, but will warn when used
|
||||
#[allow(deprecated)]
|
||||
impl<#type_impl_gen> #frame_support::weights::GetDispatchInfo for #call_ident<#type_use_gen> #where_clause {}
|
||||
|
||||
impl<#type_impl_gen> #frame_support::dispatch::GetCallName for #call_ident<#type_use_gen>
|
||||
#where_clause
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user