diff --git a/Cargo.lock b/Cargo.lock index f7fa7ae93e33..021eb8fe2dba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10899,15 +10899,12 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "pallet-xcm", "parity-scale-codec", "scale-info", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std 8.0.0", - "staging-xcm", ] [[package]] diff --git a/cumulus/parachain-template/node/src/chain_spec.rs b/cumulus/parachain-template/node/src/chain_spec.rs index da0660506850..a79c78699c07 100644 --- a/cumulus/parachain-template/node/src/chain_spec.rs +++ b/cumulus/parachain-template/node/src/chain_spec.rs @@ -73,7 +73,7 @@ pub fn development_config() -> ChainSpec { Extensions { relay_chain: "rococo-local".into(), // You MUST set this to the correct network! - para_id: 1001, + para_id: 1000, }, ) .with_name("Development") @@ -106,7 +106,7 @@ pub fn development_config() -> ChainSpec { get_account_id_from_seed::("Ferdie//stash"), ], get_account_id_from_seed::("Alice"), - 1001.into(), + 1000.into(), )) .build() } @@ -125,7 +125,7 @@ pub fn local_testnet_config() -> ChainSpec { Extensions { relay_chain: "rococo-local".into(), // You MUST set this to the correct network! - para_id: 1001, + para_id: 1000, }, ) .with_name("Local Testnet") @@ -158,7 +158,7 @@ pub fn local_testnet_config() -> ChainSpec { get_account_id_from_seed::("Ferdie//stash"), ], get_account_id_from_seed::("Alice"), - 1001.into(), + 1000.into(), )) .with_protocol_id("template-local") .with_properties(properties) diff --git a/cumulus/parachain-template/pallets/template/Cargo.toml b/cumulus/parachain-template/pallets/template/Cargo.toml index 1f53ff50e81a..925457839348 100644 --- a/cumulus/parachain-template/pallets/template/Cargo.toml +++ b/cumulus/parachain-template/pallets/template/Cargo.toml @@ -19,10 +19,6 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive frame-benchmarking = { path = "../../../../substrate/frame/benchmarking", default-features = false, optional = true} frame-support = { path = "../../../../substrate/frame/support", default-features = false} frame-system = { path = "../../../../substrate/frame/system", default-features = false} -sp-std = { path = "../../../../substrate/primitives/std", default-features = false} - -pallet-xcm = { path = "../../../../polkadot/xcm/pallet-xcm", default-features = false} -xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false} [dev-dependencies] serde = { version = "1.0.188" } @@ -49,9 +45,6 @@ std = [ "sp-core/std", "sp-io/std", "sp-runtime/std", - "sp-std/std", - "pallet-xcm/std", - "xcm/std", ] try-runtime = [ "frame-support/try-runtime", diff --git a/cumulus/parachain-template/pallets/template/src/lib.rs b/cumulus/parachain-template/pallets/template/src/lib.rs index 911896d15d40..5f3252bfc3a7 100644 --- a/cumulus/parachain-template/pallets/template/src/lib.rs +++ b/cumulus/parachain-template/pallets/template/src/lib.rs @@ -18,12 +18,10 @@ mod benchmarking; pub mod pallet { use frame_support::{dispatch::DispatchResultWithPostInfo, pallet_prelude::*}; use frame_system::pallet_prelude::*; - use sp_std::boxed::Box; - use xcm::{v3::prelude::*, VersionedMultiLocation, VersionedXcm}; /// Configure the pallet by specifying the parameters and types on which it depends. #[pallet::config] - pub trait Config: frame_system::Config + pallet_xcm::Config { + pub trait Config: frame_system::Config { /// Because this pallet emits events, it depends on the runtime's definition of an event. type RuntimeEvent: From> + IsType<::RuntimeEvent>; } @@ -47,8 +45,6 @@ pub mod pallet { /// Event documentation should end with an array that provides descriptive names for event /// parameters. [something, who] SomethingStored(u32, T::AccountId), - /// XCM message sent. \[to, message\] - Sent { from: T::AccountId, to: MultiLocation, message: Xcm<()> }, } // Errors inform users that something went wrong. @@ -58,15 +54,6 @@ pub mod pallet { NoneValue, /// Errors should have helpful documentation associated with them. StorageOverflow, - /// The message and destination combination was not recognized as being - /// reachable. - Unreachable, - /// The message and destination was recognized as being reachable but - /// the operation could not be completed. - SendFailure, - /// The version of the `Versioned` value used is not able to be - /// interpreted. - BadVersion, } #[pallet::hooks] @@ -115,27 +102,5 @@ pub mod pallet { }, } } - - /// Send an XCM message as parachain sovereign. - #[pallet::call_index(2)] - #[pallet::weight(Weight::from_parts(100_000_000, 0))] - pub fn send_xcm( - origin: OriginFor, - dest: Box, - message: Box>, - ) -> DispatchResult { - let who = ensure_signed(origin)?; - let dest = MultiLocation::try_from(*dest).map_err(|()| Error::::BadVersion)?; - let message: Xcm<()> = (*message).try_into().map_err(|()| Error::::BadVersion)?; - - pallet_xcm::Pallet::::send_xcm(Here, dest, message.clone()).map_err( - |e| match e { - SendError::Unroutable => Error::::Unreachable, - _ => Error::::SendFailure, - }, - )?; - Self::deposit_event(Event::Sent { from: who, to: dest, message }); - Ok(()) - } } }