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
+5 -1
View File
@@ -16,6 +16,7 @@ static_assertions = "1.1.0"
serde = { version = "1.0.163", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
frame-metadata = { version = "16.0.0", default-features = false, features = ["current"] }
sp-api = { version = "4.0.0-dev", default-features = false, path = "../../../primitives/api" }
sp-arithmetic = { version = "16.0.0", default-features = false, path = "../../../primitives/arithmetic" }
sp-io = { version = "23.0.0", path = "../../../primitives/io", default-features = false }
@@ -26,6 +27,7 @@ sp-runtime = { version = "24.0.0", default-features = false, path = "../../../pr
sp-core = { version = "21.0.0", default-features = false, path = "../../../primitives/core" }
sp-std = { version = "8.0.0", default-features = false, path = "../../../primitives/std" }
sp-version = { version = "22.0.0", default-features = false, path = "../../../primitives/version" }
sp-metadata-ir = { version = "0.1.0", default-features = false, path = "../../../primitives/metadata-ir" }
trybuild = { version = "1.0.74", features = [ "diff" ] }
pretty_assertions = "1.3.0"
rustversion = "1.0.6"
@@ -46,13 +48,15 @@ std = [
"serde/std",
"sp-api/std",
"sp-arithmetic/std",
"frame-metadata/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"sp-version/std",
"test-pallet/std",
"sp-state-machine/std"
"sp-state-machine/std",
"sp-metadata-ir/std"
]
experimental = ["frame-support/experimental"]
try-runtime = [
@@ -636,7 +636,7 @@ fn call_subtype_conversion() {
#[test]
fn test_metadata() {
use frame_support::metadata::{v14::*, *};
use frame_metadata::{v14::*, *};
use scale_info::meta_type;
use sp_core::Encode;
@@ -374,7 +374,7 @@ note: required by a bound in `Result`
|
| pub enum Result<T, E> {
| ^ required by this bound in `Result`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Runtime: Config` is not satisfied in `RuntimeEvent`
--> tests/construct_runtime_ui/deprecated_where_block.rs:3:1
@@ -439,4 +439,4 @@ note: required by a bound in `Result`
|
| pub enum Result<T, E> {
| ^ required by this bound in `Result`
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `self::sp_api_hidden_includes_construct_runtime::hidden_include::__private::codec::Decode` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -20,14 +20,14 @@
use frame_support::{
derive_impl,
inherent::{InherentData, InherentIdentifier, MakeFatalError, ProvideInherent},
metadata_ir::{
PalletStorageMetadataIR, StorageEntryMetadataIR, StorageEntryModifierIR,
StorageEntryTypeIR, StorageHasherIR,
},
traits::ConstU32,
};
use frame_system::pallet_prelude::BlockNumberFor;
use sp_core::sr25519;
use sp_metadata_ir::{
PalletStorageMetadataIR, StorageEntryMetadataIR, StorageEntryModifierIR, StorageEntryTypeIR,
StorageHasherIR,
};
use sp_runtime::{
generic,
traits::{BlakeTwo256, Verify},
+2 -2
View File
@@ -1378,7 +1378,7 @@ fn migrate_from_pallet_version_to_storage_version() {
#[test]
fn metadata() {
use codec::Decode;
use frame_support::metadata::{v15::*, *};
use frame_metadata::{v15::*, *};
fn maybe_docs(doc: Vec<&'static str>) -> Vec<&'static str> {
if cfg!(feature = "no-metadata-docs") {
@@ -1860,7 +1860,7 @@ fn metadata() {
#[test]
fn metadata_at_version() {
use frame_support::metadata::*;
use frame_metadata::*;
use sp_core::Decode;
// Metadata always returns the V14.3
@@ -721,7 +721,7 @@ fn pallet_on_genesis() {
#[test]
fn metadata() {
use frame_support::metadata::{v14::*, *};
use frame_metadata::{v14::*, *};
let system_pallet_metadata = PalletMetadata {
index: 0,
@@ -15,13 +15,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::{
metadata_ir::{
RuntimeApiMetadataIR, RuntimeApiMethodMetadataIR, RuntimeApiMethodParamMetadataIR,
},
traits::ConstU32,
};
use frame_support::traits::ConstU32;
use scale_info::{form::MetaForm, meta_type};
use sp_metadata_ir::{
RuntimeApiMetadataIR, RuntimeApiMethodMetadataIR, RuntimeApiMethodParamMetadataIR,
};
use sp_runtime::traits::Block as BlockT;
pub type BlockNumber = u64;