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:
Juan
2023-08-23 14:30:12 +02:00
committed by GitHub
parent 574592d1cf
commit 878c562cd4
125 changed files with 449 additions and 398 deletions
@@ -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! {