mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 23:28:00 +00:00
Restructure frame_support macro related exports (#14745)
* make reexports private * make reexports private 2 * make reexports private for runtime-benchmarking * make reexports private for try-runtime * fix for try-runtime * make reexports private for tests * fmt * make reexports private for tests * make reexports private for experimental * fix beefy * fix ui test * fix ui test * fix benches * ".git/.scripts/commands/fmt/fmt.sh" * fix contracts use * wip * wip * do not reexport sp_api::metadata_ir * fix CI checks * fix support tests * ".git/.scripts/commands/fmt/fmt.sh" * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * import codec directly * fmt * fix node-cli tests --------- Co-authored-by: command-bot <> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -68,10 +68,10 @@ pub fn expand_outer_dispatch(
|
||||
|
||||
#[derive(
|
||||
Clone, PartialEq, Eq,
|
||||
#scrate::codec::Encode,
|
||||
#scrate::codec::Decode,
|
||||
#scrate::scale_info::TypeInfo,
|
||||
#scrate::RuntimeDebug,
|
||||
#scrate::__private::codec::Encode,
|
||||
#scrate::__private::codec::Decode,
|
||||
#scrate::__private::scale_info::TypeInfo,
|
||||
#scrate::__private::RuntimeDebug,
|
||||
)]
|
||||
pub enum RuntimeCall {
|
||||
#variant_defs
|
||||
@@ -166,7 +166,7 @@ pub fn expand_outer_dispatch(
|
||||
type PostInfo = #scrate::dispatch::PostDispatchInfo;
|
||||
fn dispatch(self, origin: RuntimeOrigin) -> #scrate::dispatch::DispatchResultWithPostInfo {
|
||||
if !<Self::RuntimeOrigin as #scrate::traits::OriginTrait>::filter_call(&origin, &self) {
|
||||
return #scrate::sp_std::result::Result::Err(
|
||||
return #scrate::__private::sp_std::result::Result::Err(
|
||||
#system_path::Error::<#runtime>::CallFiltered.into()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ pub fn expand_outer_config(
|
||||
|
||||
#types
|
||||
|
||||
use #scrate::serde as __genesis_config_serde_import__;
|
||||
#[derive(#scrate::serde::Serialize, #scrate::serde::Deserialize, Default)]
|
||||
use #scrate::__private::serde as __genesis_config_serde_import__;
|
||||
#[derive(#scrate::__private::serde::Serialize, #scrate::__private::serde::Deserialize, Default)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
#[serde(crate = "__genesis_config_serde_import__")]
|
||||
@@ -86,7 +86,7 @@ pub fn expand_outer_config(
|
||||
&self,
|
||||
storage: &mut #scrate::sp_runtime::Storage,
|
||||
) -> std::result::Result<(), String> {
|
||||
#scrate::BasicExternalities::execute_with_storage(storage, || {
|
||||
#scrate::__private::BasicExternalities::execute_with_storage(storage, || {
|
||||
<Self as #scrate::traits::BuildGenesisConfig>::build(&self);
|
||||
Ok(())
|
||||
})
|
||||
|
||||
@@ -38,9 +38,9 @@ pub fn expand_outer_freeze_reason(pallet_decls: &[Pallet], scrate: &TokenStream)
|
||||
/// A reason for placing a freeze on funds.
|
||||
#[derive(
|
||||
Copy, Clone, Eq, PartialEq, Ord, PartialOrd,
|
||||
#scrate::codec::Encode, #scrate::codec::Decode, #scrate::codec::MaxEncodedLen,
|
||||
#scrate::scale_info::TypeInfo,
|
||||
#scrate::RuntimeDebug,
|
||||
#scrate::__private::codec::Encode, #scrate::__private::codec::Decode, #scrate::__private::codec::MaxEncodedLen,
|
||||
#scrate::__private::scale_info::TypeInfo,
|
||||
#scrate::__private::RuntimeDebug,
|
||||
)]
|
||||
pub enum RuntimeFreezeReason {
|
||||
#( #freeze_reason_variants )*
|
||||
|
||||
@@ -38,9 +38,9 @@ pub fn expand_outer_hold_reason(pallet_decls: &[Pallet], scrate: &TokenStream) -
|
||||
/// A reason for placing a hold on funds.
|
||||
#[derive(
|
||||
Copy, Clone, Eq, PartialEq, Ord, PartialOrd,
|
||||
#scrate::codec::Encode, #scrate::codec::Decode, #scrate::codec::MaxEncodedLen,
|
||||
#scrate::scale_info::TypeInfo,
|
||||
#scrate::RuntimeDebug,
|
||||
#scrate::__private::codec::Encode, #scrate::__private::codec::Decode, #scrate::__private::codec::MaxEncodedLen,
|
||||
#scrate::__private::scale_info::TypeInfo,
|
||||
#scrate::__private::RuntimeDebug,
|
||||
)]
|
||||
pub enum RuntimeHoldReason {
|
||||
#( #hold_reason_variants )*
|
||||
|
||||
@@ -58,17 +58,17 @@ pub fn expand_outer_inherent(
|
||||
|
||||
trait InherentDataExt {
|
||||
fn create_extrinsics(&self) ->
|
||||
#scrate::sp_std::vec::Vec<<#block as #scrate::sp_runtime::traits::Block>::Extrinsic>;
|
||||
#scrate::__private::sp_std::vec::Vec<<#block as #scrate::sp_runtime::traits::Block>::Extrinsic>;
|
||||
fn check_extrinsics(&self, block: &#block) -> #scrate::inherent::CheckInherentsResult;
|
||||
}
|
||||
|
||||
impl InherentDataExt for #scrate::inherent::InherentData {
|
||||
fn create_extrinsics(&self) ->
|
||||
#scrate::sp_std::vec::Vec<<#block as #scrate::sp_runtime::traits::Block>::Extrinsic>
|
||||
#scrate::__private::sp_std::vec::Vec<<#block as #scrate::sp_runtime::traits::Block>::Extrinsic>
|
||||
{
|
||||
use #scrate::inherent::ProvideInherent;
|
||||
|
||||
let mut inherents = #scrate::sp_std::vec::Vec::new();
|
||||
let mut inherents = #scrate::__private::sp_std::vec::Vec::new();
|
||||
|
||||
#(
|
||||
#pallet_attrs
|
||||
@@ -91,7 +91,7 @@ pub fn expand_outer_inherent(
|
||||
use #scrate::traits::{IsSubType, ExtrinsicCall};
|
||||
use #scrate::sp_runtime::traits::Block as _;
|
||||
use #scrate::_private::sp_inherents::Error;
|
||||
use #scrate::log;
|
||||
use #scrate::__private::log;
|
||||
|
||||
let mut result = #scrate::inherent::CheckInherentsResult::new();
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ pub fn expand_outer_lock_id(pallet_decls: &[Pallet], scrate: &TokenStream) -> To
|
||||
/// An identifier for each lock placed on funds.
|
||||
#[derive(
|
||||
Copy, Clone, Eq, PartialEq, Ord, PartialOrd,
|
||||
#scrate::codec::Encode, #scrate::codec::Decode, #scrate::codec::MaxEncodedLen,
|
||||
#scrate::scale_info::TypeInfo,
|
||||
#scrate::RuntimeDebug,
|
||||
#scrate::__private::codec::Encode, #scrate::__private::codec::Decode, #scrate::__private::codec::MaxEncodedLen,
|
||||
#scrate::__private::scale_info::TypeInfo,
|
||||
#scrate::__private::RuntimeDebug,
|
||||
)]
|
||||
pub enum RuntimeLockId {
|
||||
#( #lock_id_variants )*
|
||||
|
||||
@@ -61,7 +61,7 @@ pub fn expand_runtime_metadata(
|
||||
|
||||
quote! {
|
||||
#attr
|
||||
#scrate::metadata_ir::PalletMetadataIR {
|
||||
#scrate::__private::metadata_ir::PalletMetadataIR {
|
||||
name: stringify!(#name),
|
||||
index: #index,
|
||||
storage: #storage,
|
||||
@@ -77,7 +77,7 @@ pub fn expand_runtime_metadata(
|
||||
|
||||
quote! {
|
||||
impl #runtime {
|
||||
fn metadata_ir() -> #scrate::metadata_ir::MetadataIR {
|
||||
fn metadata_ir() -> #scrate::__private::metadata_ir::MetadataIR {
|
||||
// Each runtime must expose the `runtime_metadata()` to fetch the runtime API metadata.
|
||||
// The function is implemented by calling `impl_runtime_apis!`.
|
||||
//
|
||||
@@ -96,23 +96,23 @@ pub fn expand_runtime_metadata(
|
||||
// `Deref` needs a reference for resolving the function call.
|
||||
let rt = #runtime;
|
||||
|
||||
let ty = #scrate::scale_info::meta_type::<#extrinsic>();
|
||||
let address_ty = #scrate::scale_info::meta_type::<
|
||||
let ty = #scrate::__private::scale_info::meta_type::<#extrinsic>();
|
||||
let address_ty = #scrate::__private::scale_info::meta_type::<
|
||||
<<#extrinsic as #scrate::sp_runtime::traits::Extrinsic>::SignaturePayload as #scrate::sp_runtime::traits::SignaturePayload>::SignatureAddress
|
||||
>();
|
||||
let call_ty = #scrate::scale_info::meta_type::<
|
||||
let call_ty = #scrate::__private::scale_info::meta_type::<
|
||||
<#extrinsic as #scrate::sp_runtime::traits::Extrinsic>::Call
|
||||
>();
|
||||
let signature_ty = #scrate::scale_info::meta_type::<
|
||||
let signature_ty = #scrate::__private::scale_info::meta_type::<
|
||||
<<#extrinsic as #scrate::sp_runtime::traits::Extrinsic>::SignaturePayload as #scrate::sp_runtime::traits::SignaturePayload>::Signature
|
||||
>();
|
||||
let extra_ty = #scrate::scale_info::meta_type::<
|
||||
let extra_ty = #scrate::__private::scale_info::meta_type::<
|
||||
<<#extrinsic as #scrate::sp_runtime::traits::Extrinsic>::SignaturePayload as #scrate::sp_runtime::traits::SignaturePayload>::SignatureExtra
|
||||
>();
|
||||
|
||||
#scrate::metadata_ir::MetadataIR {
|
||||
pallets: #scrate::sp_std::vec![ #(#pallets),* ],
|
||||
extrinsic: #scrate::metadata_ir::ExtrinsicMetadataIR {
|
||||
#scrate::__private::metadata_ir::MetadataIR {
|
||||
pallets: #scrate::__private::sp_std::vec![ #(#pallets),* ],
|
||||
extrinsic: #scrate::__private::metadata_ir::ExtrinsicMetadataIR {
|
||||
ty,
|
||||
version: <#extrinsic as #scrate::sp_runtime::traits::ExtrinsicMetadata>::VERSION,
|
||||
address_ty,
|
||||
@@ -125,39 +125,39 @@ pub fn expand_runtime_metadata(
|
||||
>::SignedExtensions as #scrate::sp_runtime::traits::SignedExtension
|
||||
>::metadata()
|
||||
.into_iter()
|
||||
.map(|meta| #scrate::metadata_ir::SignedExtensionMetadataIR {
|
||||
.map(|meta| #scrate::__private::metadata_ir::SignedExtensionMetadataIR {
|
||||
identifier: meta.identifier,
|
||||
ty: meta.ty,
|
||||
additional_signed: meta.additional_signed,
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
ty: #scrate::scale_info::meta_type::<#runtime>(),
|
||||
ty: #scrate::__private::scale_info::meta_type::<#runtime>(),
|
||||
apis: (&rt).runtime_metadata(),
|
||||
outer_enums: #scrate::metadata_ir::OuterEnumsIR {
|
||||
call_enum_ty: #scrate::scale_info::meta_type::<
|
||||
outer_enums: #scrate::__private::metadata_ir::OuterEnumsIR {
|
||||
call_enum_ty: #scrate::__private::scale_info::meta_type::<
|
||||
<#runtime as #system_path::Config>::RuntimeCall
|
||||
>(),
|
||||
event_enum_ty: #scrate::scale_info::meta_type::<RuntimeEvent>(),
|
||||
error_enum_ty: #scrate::scale_info::meta_type::<RuntimeError>(),
|
||||
event_enum_ty: #scrate::__private::scale_info::meta_type::<RuntimeEvent>(),
|
||||
error_enum_ty: #scrate::__private::scale_info::meta_type::<RuntimeError>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn metadata() -> #scrate::metadata::RuntimeMetadataPrefixed {
|
||||
pub fn metadata() -> #scrate::__private::metadata::RuntimeMetadataPrefixed {
|
||||
// Note: this always returns the V14 version. The runtime API function
|
||||
// must be deprecated.
|
||||
#scrate::metadata_ir::into_v14(#runtime::metadata_ir())
|
||||
#scrate::__private::metadata_ir::into_v14(#runtime::metadata_ir())
|
||||
}
|
||||
|
||||
pub fn metadata_at_version(version: u32) -> Option<#scrate::OpaqueMetadata> {
|
||||
#scrate::metadata_ir::into_version(#runtime::metadata_ir(), version).map(|prefixed| {
|
||||
#scrate::OpaqueMetadata::new(prefixed.into())
|
||||
pub fn metadata_at_version(version: u32) -> Option<#scrate::__private::OpaqueMetadata> {
|
||||
#scrate::__private::metadata_ir::into_version(#runtime::metadata_ir(), version).map(|prefixed| {
|
||||
#scrate::__private::OpaqueMetadata::new(prefixed.into())
|
||||
})
|
||||
}
|
||||
|
||||
pub fn metadata_versions() -> #scrate::sp_std::vec::Vec<u32> {
|
||||
#scrate::metadata_ir::supported_versions()
|
||||
pub fn metadata_versions() -> #scrate::__private::sp_std::vec::Vec<u32> {
|
||||
#scrate::__private::metadata_ir::supported_versions()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,8 +220,8 @@ fn expand_pallet_metadata_events(
|
||||
|
||||
quote! {
|
||||
Some(
|
||||
#scrate::metadata_ir::PalletEventMetadataIR {
|
||||
ty: #scrate::scale_info::meta_type::<#pallet_event>()
|
||||
#scrate::__private::metadata_ir::PalletEventMetadataIR {
|
||||
ty: #scrate::__private::scale_info::meta_type::<#pallet_event>()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -105,25 +105,25 @@ pub fn expand_outer_origin(
|
||||
#[derive(Clone)]
|
||||
pub struct RuntimeOrigin {
|
||||
caller: OriginCaller,
|
||||
filter: #scrate::sp_std::rc::Rc<Box<dyn Fn(&<#runtime as #system_path::Config>::RuntimeCall) -> bool>>,
|
||||
filter: #scrate::__private::sp_std::rc::Rc<Box<dyn Fn(&<#runtime as #system_path::Config>::RuntimeCall) -> bool>>,
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
impl #scrate::sp_std::fmt::Debug for RuntimeOrigin {
|
||||
impl #scrate::__private::sp_std::fmt::Debug for RuntimeOrigin {
|
||||
fn fmt(
|
||||
&self,
|
||||
fmt: &mut #scrate::sp_std::fmt::Formatter,
|
||||
) -> #scrate::sp_std::result::Result<(), #scrate::sp_std::fmt::Error> {
|
||||
fmt: &mut #scrate::__private::sp_std::fmt::Formatter,
|
||||
) -> #scrate::__private::sp_std::result::Result<(), #scrate::__private::sp_std::fmt::Error> {
|
||||
fmt.write_str("<wasm:stripped>")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl #scrate::sp_std::fmt::Debug for RuntimeOrigin {
|
||||
impl #scrate::__private::sp_std::fmt::Debug for RuntimeOrigin {
|
||||
fn fmt(
|
||||
&self,
|
||||
fmt: &mut #scrate::sp_std::fmt::Formatter,
|
||||
) -> #scrate::sp_std::result::Result<(), #scrate::sp_std::fmt::Error> {
|
||||
fmt: &mut #scrate::__private::sp_std::fmt::Formatter,
|
||||
) -> #scrate::__private::sp_std::result::Result<(), #scrate::__private::sp_std::fmt::Error> {
|
||||
fmt.debug_struct("Origin")
|
||||
.field("caller", &self.caller)
|
||||
.field("filter", &"[function ptr]")
|
||||
@@ -139,7 +139,7 @@ pub fn expand_outer_origin(
|
||||
fn add_filter(&mut self, filter: impl Fn(&Self::Call) -> bool + 'static) {
|
||||
let f = self.filter.clone();
|
||||
|
||||
self.filter = #scrate::sp_std::rc::Rc::new(Box::new(move |call| {
|
||||
self.filter = #scrate::__private::sp_std::rc::Rc::new(Box::new(move |call| {
|
||||
f(call) && filter(call)
|
||||
}));
|
||||
}
|
||||
@@ -150,7 +150,7 @@ pub fn expand_outer_origin(
|
||||
as #scrate::traits::Contains<<#runtime as #system_path::Config>::RuntimeCall>
|
||||
>::contains;
|
||||
|
||||
self.filter = #scrate::sp_std::rc::Rc::new(Box::new(filter));
|
||||
self.filter = #scrate::__private::sp_std::rc::Rc::new(Box::new(filter));
|
||||
}
|
||||
|
||||
fn set_caller_from(&mut self, other: impl Into<Self>) {
|
||||
@@ -197,8 +197,8 @@ pub fn expand_outer_origin(
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Clone, PartialEq, Eq, #scrate::RuntimeDebug, #scrate::codec::Encode,
|
||||
#scrate::codec::Decode, #scrate::scale_info::TypeInfo, #scrate::codec::MaxEncodedLen,
|
||||
Clone, PartialEq, Eq, #scrate::__private::RuntimeDebug, #scrate::__private::codec::Encode,
|
||||
#scrate::__private::codec::Decode, #scrate::__private::scale_info::TypeInfo, #scrate::__private::codec::MaxEncodedLen,
|
||||
)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum OriginCaller {
|
||||
@@ -206,7 +206,7 @@ pub fn expand_outer_origin(
|
||||
system(#system_path::Origin<#runtime>),
|
||||
#caller_variants
|
||||
#[allow(dead_code)]
|
||||
Void(#scrate::Void)
|
||||
Void(#scrate::__private::Void)
|
||||
}
|
||||
|
||||
// For backwards compatibility and ease of accessing these functions.
|
||||
@@ -252,7 +252,7 @@ pub fn expand_outer_origin(
|
||||
impl TryFrom<OriginCaller> for #system_path::Origin<#runtime> {
|
||||
type Error = OriginCaller;
|
||||
fn try_from(x: OriginCaller)
|
||||
-> #scrate::sp_std::result::Result<#system_path::Origin<#runtime>, OriginCaller>
|
||||
-> #scrate::__private::sp_std::result::Result<#system_path::Origin<#runtime>, OriginCaller>
|
||||
{
|
||||
if let OriginCaller::system(l) = x {
|
||||
Ok(l)
|
||||
@@ -275,7 +275,7 @@ pub fn expand_outer_origin(
|
||||
fn from(x: OriginCaller) -> Self {
|
||||
let mut o = RuntimeOrigin {
|
||||
caller: x,
|
||||
filter: #scrate::sp_std::rc::Rc::new(Box::new(|_| true)),
|
||||
filter: #scrate::__private::sp_std::rc::Rc::new(Box::new(|_| true)),
|
||||
};
|
||||
|
||||
#scrate::traits::OriginTrait::reset_filter(&mut o);
|
||||
@@ -284,7 +284,7 @@ pub fn expand_outer_origin(
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RuntimeOrigin> for #scrate::sp_std::result::Result<#system_path::Origin<#runtime>, RuntimeOrigin> {
|
||||
impl From<RuntimeOrigin> for #scrate::__private::sp_std::result::Result<#system_path::Origin<#runtime>, RuntimeOrigin> {
|
||||
/// NOTE: converting to pallet origin loses the origin filter information.
|
||||
fn from(val: RuntimeOrigin) -> Self {
|
||||
if let OriginCaller::system(l) = val.caller {
|
||||
@@ -394,7 +394,7 @@ fn expand_origin_pallet_conversions(
|
||||
}
|
||||
|
||||
#attr
|
||||
impl From<RuntimeOrigin> for #scrate::sp_std::result::Result<#pallet_origin, RuntimeOrigin> {
|
||||
impl From<RuntimeOrigin> for #scrate::__private::sp_std::result::Result<#pallet_origin, RuntimeOrigin> {
|
||||
/// NOTE: converting to pallet origin loses the origin filter information.
|
||||
fn from(val: RuntimeOrigin) -> Self {
|
||||
if let OriginCaller::#variant_name(l) = val.caller {
|
||||
@@ -410,7 +410,7 @@ fn expand_origin_pallet_conversions(
|
||||
type Error = OriginCaller;
|
||||
fn try_from(
|
||||
x: OriginCaller,
|
||||
) -> #scrate::sp_std::result::Result<#pallet_origin, OriginCaller> {
|
||||
) -> #scrate::__private::sp_std::result::Result<#pallet_origin, OriginCaller> {
|
||||
if let OriginCaller::#variant_name(l) = x {
|
||||
Ok(l)
|
||||
} else {
|
||||
@@ -424,7 +424,7 @@ fn expand_origin_pallet_conversions(
|
||||
type Error = ();
|
||||
fn try_from(
|
||||
x: &'a OriginCaller,
|
||||
) -> #scrate::sp_std::result::Result<&'a #pallet_origin, ()> {
|
||||
) -> #scrate::__private::sp_std::result::Result<&'a #pallet_origin, ()> {
|
||||
if let OriginCaller::#variant_name(l) = x {
|
||||
Ok(&l)
|
||||
} else {
|
||||
@@ -438,7 +438,7 @@ fn expand_origin_pallet_conversions(
|
||||
type Error = ();
|
||||
fn try_from(
|
||||
x: &'a RuntimeOrigin,
|
||||
) -> #scrate::sp_std::result::Result<&'a #pallet_origin, ()> {
|
||||
) -> #scrate::__private::sp_std::result::Result<&'a #pallet_origin, ()> {
|
||||
if let OriginCaller::#variant_name(l) = &x.caller {
|
||||
Ok(&l)
|
||||
} else {
|
||||
|
||||
@@ -159,10 +159,10 @@ pub fn expand_outer_enum(
|
||||
|
||||
#[derive(
|
||||
#event_custom_derives
|
||||
#scrate::codec::Encode,
|
||||
#scrate::codec::Decode,
|
||||
#scrate::scale_info::TypeInfo,
|
||||
#scrate::RuntimeDebug,
|
||||
#scrate::__private::codec::Encode,
|
||||
#scrate::__private::codec::Decode,
|
||||
#scrate::__private::scale_info::TypeInfo,
|
||||
#scrate::__private::RuntimeDebug,
|
||||
)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum #enum_name_ident {
|
||||
@@ -247,7 +247,7 @@ fn expand_enum_conversion(
|
||||
impl TryInto<#pallet_enum> for #enum_name_ident {
|
||||
type Error = ();
|
||||
|
||||
fn try_into(self) -> #scrate::sp_std::result::Result<#pallet_enum, Self::Error> {
|
||||
fn try_into(self) -> #scrate::__private::sp_std::result::Result<#pallet_enum, Self::Error> {
|
||||
match self {
|
||||
Self::#variant_name(evt) => Ok(evt),
|
||||
_ => Err(()),
|
||||
@@ -273,8 +273,8 @@ fn generate_error_impl(scrate: &TokenStream, enum_ty: OuterEnumType) -> TokenStr
|
||||
pub fn from_dispatch_error(err: #scrate::sp_runtime::DispatchError) -> Option<Self> {
|
||||
let #scrate::sp_runtime::DispatchError::Module(module_error) = err else { return None };
|
||||
|
||||
let bytes = #scrate::codec::Encode::encode(&module_error);
|
||||
#scrate::codec::Decode::decode(&mut &bytes[..]).ok()
|
||||
let bytes = #scrate::__private::codec::Encode::encode(&module_error);
|
||||
#scrate::__private::codec::Decode::decode(&mut &bytes[..]).ok()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ pub fn expand_outer_slash_reason(pallet_decls: &[Pallet], scrate: &TokenStream)
|
||||
/// A reason for slashing funds.
|
||||
#[derive(
|
||||
Copy, Clone, Eq, PartialEq, Ord, PartialOrd,
|
||||
#scrate::codec::Encode, #scrate::codec::Decode, #scrate::codec::MaxEncodedLen,
|
||||
#scrate::scale_info::TypeInfo,
|
||||
#scrate::RuntimeDebug,
|
||||
#scrate::__private::codec::Encode, #scrate::__private::codec::Decode, #scrate::__private::codec::MaxEncodedLen,
|
||||
#scrate::__private::scale_info::TypeInfo,
|
||||
#scrate::__private::RuntimeDebug,
|
||||
)]
|
||||
pub enum RuntimeSlashReason {
|
||||
#( #slash_reason_variants )*
|
||||
|
||||
@@ -94,11 +94,11 @@
|
||||
//! ```
|
||||
//! This call has some implicit pallet parts, thus it will expand to:
|
||||
//! ```ignore
|
||||
//! frame_support::tt_call! {
|
||||
//! frame_support::__private::tt_call! {
|
||||
//! macro = [{ pallet_balances::tt_default_parts }]
|
||||
//! ~~> frame_support::match_and_insert! {
|
||||
//! target = [{
|
||||
//! frame_support::tt_call! {
|
||||
//! frame_support::__private::tt_call! {
|
||||
//! macro = [{ frame_system::tt_default_parts }]
|
||||
//! ~~> frame_support::match_and_insert! {
|
||||
//! target = [{
|
||||
@@ -280,7 +280,7 @@ fn construct_runtime_implicit_to_explicit(
|
||||
let pallet_name = &pallet.name;
|
||||
let pallet_instance = pallet.instance.as_ref().map(|instance| quote::quote!(::<#instance>));
|
||||
expansion = quote::quote!(
|
||||
#frame_support::tt_call! {
|
||||
#frame_support::__private::tt_call! {
|
||||
macro = [{ #pallet_path::tt_default_parts }]
|
||||
frame_support = [{ #frame_support }]
|
||||
~~> #frame_support::match_and_insert! {
|
||||
@@ -316,7 +316,7 @@ fn construct_runtime_explicit_to_explicit_expanded(
|
||||
let pallet_name = &pallet.name;
|
||||
let pallet_instance = pallet.instance.as_ref().map(|instance| quote::quote!(::<#instance>));
|
||||
expansion = quote::quote!(
|
||||
#frame_support::tt_call! {
|
||||
#frame_support::__private::tt_call! {
|
||||
macro = [{ #pallet_path::tt_extra_parts }]
|
||||
frame_support = [{ #frame_support }]
|
||||
~~> #frame_support::match_and_insert! {
|
||||
@@ -428,7 +428,7 @@ fn construct_runtime_final_expansion(
|
||||
|
||||
#[derive(
|
||||
Clone, Copy, PartialEq, Eq, #scrate::sp_runtime::RuntimeDebug,
|
||||
#scrate::scale_info::TypeInfo
|
||||
#scrate::__private::scale_info::TypeInfo
|
||||
)]
|
||||
pub struct #name;
|
||||
impl #scrate::sp_runtime::traits::GetRuntimeBlockType for #name {
|
||||
@@ -453,7 +453,7 @@ fn construct_runtime_final_expansion(
|
||||
#[doc(hidden)]
|
||||
trait InternalConstructRuntime {
|
||||
#[inline(always)]
|
||||
fn runtime_metadata(&self) -> #scrate::sp_std::vec::Vec<#scrate::metadata_ir::RuntimeApiMetadataIR> {
|
||||
fn runtime_metadata(&self) -> #scrate::__private::sp_std::vec::Vec<#scrate::__private::metadata_ir::RuntimeApiMetadataIR> {
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
@@ -700,10 +700,10 @@ fn decl_pallet_runtime_setup(
|
||||
|
||||
impl #scrate::traits::PalletInfo for PalletInfo {
|
||||
fn index<P: 'static>() -> Option<usize> {
|
||||
let type_id = #scrate::sp_std::any::TypeId::of::<P>();
|
||||
let type_id = #scrate::__private::sp_std::any::TypeId::of::<P>();
|
||||
#(
|
||||
#pallet_attrs
|
||||
if type_id == #scrate::sp_std::any::TypeId::of::<#names>() {
|
||||
if type_id == #scrate::__private::sp_std::any::TypeId::of::<#names>() {
|
||||
return Some(#indices)
|
||||
}
|
||||
)*
|
||||
@@ -712,10 +712,10 @@ fn decl_pallet_runtime_setup(
|
||||
}
|
||||
|
||||
fn name<P: 'static>() -> Option<&'static str> {
|
||||
let type_id = #scrate::sp_std::any::TypeId::of::<P>();
|
||||
let type_id = #scrate::__private::sp_std::any::TypeId::of::<P>();
|
||||
#(
|
||||
#pallet_attrs
|
||||
if type_id == #scrate::sp_std::any::TypeId::of::<#names>() {
|
||||
if type_id == #scrate::__private::sp_std::any::TypeId::of::<#names>() {
|
||||
return Some(#name_strings)
|
||||
}
|
||||
)*
|
||||
@@ -724,10 +724,10 @@ fn decl_pallet_runtime_setup(
|
||||
}
|
||||
|
||||
fn module_name<P: 'static>() -> Option<&'static str> {
|
||||
let type_id = #scrate::sp_std::any::TypeId::of::<P>();
|
||||
let type_id = #scrate::__private::sp_std::any::TypeId::of::<P>();
|
||||
#(
|
||||
#pallet_attrs
|
||||
if type_id == #scrate::sp_std::any::TypeId::of::<#names>() {
|
||||
if type_id == #scrate::__private::sp_std::any::TypeId::of::<#names>() {
|
||||
return Some(#module_names)
|
||||
}
|
||||
)*
|
||||
@@ -736,10 +736,10 @@ fn decl_pallet_runtime_setup(
|
||||
}
|
||||
|
||||
fn crate_version<P: 'static>() -> Option<#scrate::traits::CrateVersion> {
|
||||
let type_id = #scrate::sp_std::any::TypeId::of::<P>();
|
||||
let type_id = #scrate::__private::sp_std::any::TypeId::of::<P>();
|
||||
#(
|
||||
#pallet_attrs
|
||||
if type_id == #scrate::sp_std::any::TypeId::of::<#names>() {
|
||||
if type_id == #scrate::__private::sp_std::any::TypeId::of::<#names>() {
|
||||
return Some(
|
||||
<#pallet_structs as #scrate::traits::PalletInfoAccess>::crate_version()
|
||||
)
|
||||
@@ -760,7 +760,7 @@ fn decl_integrity_test(scrate: &TokenStream2) -> TokenStream2 {
|
||||
|
||||
#[test]
|
||||
pub fn runtime_integrity_tests() {
|
||||
#scrate::sp_tracing::try_init_simple();
|
||||
#scrate::__private::sp_tracing::try_init_simple();
|
||||
<AllPalletsWithSystem as #scrate::traits::IntegrityTest>::integrity_test();
|
||||
}
|
||||
}
|
||||
@@ -781,7 +781,7 @@ fn decl_static_assertions(
|
||||
);
|
||||
|
||||
quote! {
|
||||
#scrate::tt_call! {
|
||||
#scrate::__private::tt_call! {
|
||||
macro = [{ #path::tt_error_token }]
|
||||
frame_support = [{ #scrate }]
|
||||
~~> #scrate::assert_error_encoded_size! {
|
||||
|
||||
Reference in New Issue
Block a user