Macros to use path instead of ident (#1474)

This commit is contained in:
Juan
2023-10-14 08:26:19 +02:00
committed by GitHub
parent 1f28cddd6f
commit 7c87d61f5a
26 changed files with 489 additions and 134 deletions
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
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"] }
renamed-frame-support = { package = "frame-support", path = "../..", default-features = false}
frame-system = { path = "../../../system", default-features = false}
renamed-frame-system = { package = "frame-system", path = "../../../system", default-features = false}
sp-core = { path = "../../../../primitives/core", default-features = false}
sp-runtime = { path = "../../../../primitives/runtime", default-features = false}
sp-version = { path = "../../../../primitives/version", default-features = false}
@@ -24,8 +24,8 @@ sp-version = { path = "../../../../primitives/version", default-features = false
default = [ "std" ]
std = [
"codec/std",
"frame-system/std",
"renamed-frame-support/std",
"renamed-frame-system/std",
"scale-info/std",
"sp-core/std",
"sp-runtime/std",
@@ -16,7 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Test that `construct_runtime!` also works when `frame-support` is renamed in the `Cargo.toml`.
//! Test that `construct_runtime!` also works when `frame-support` or `frame-system` are renamed in
//! the `Cargo.toml`.
#![cfg_attr(not(feature = "std"), no_std)]
@@ -50,7 +51,7 @@ parameter_types! {
pub const Version: RuntimeVersion = VERSION;
}
impl frame_system::Config for Runtime {
impl renamed_frame_system::Config for Runtime {
type BaseCallFilter = Everything;
type BlockWeights = ();
type BlockLength = ();
@@ -82,6 +83,6 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
construct_runtime!(
pub struct Runtime {
System: frame_system,
System: renamed_frame_system,
}
);