Skip to content

Commit

Permalink
Revert "Update Polkadot SDK (#28)"
Browse files Browse the repository at this point in the history
This reverts commit 0362047.
  • Loading branch information
claravanstaden authored Nov 15, 2023
1 parent 0362047 commit 13b8863
Show file tree
Hide file tree
Showing 40 changed files with 146 additions and 2,425 deletions.
814 changes: 72 additions & 742 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ members = [
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot",
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo",
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend",
"cumulus/parachains/runtimes/bridge-hubs/common",
"cumulus/parachains/runtimes/bridge-hubs/test-utils",
"cumulus/parachains/runtimes/collectives/collectives-polkadot",
"cumulus/parachains/runtimes/contracts/contracts-rococo",
Expand Down
6 changes: 3 additions & 3 deletions cumulus/parachain-template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -106,7 +106,7 @@ pub fn development_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
get_account_id_from_seed::<sr25519::Public>("Alice"),
1001.into(),
1000.into(),
))
.build()
}
Expand All @@ -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")
Expand Down
7 changes: 0 additions & 7 deletions cumulus/parachain-template/pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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",
Expand Down
37 changes: 1 addition & 36 deletions cumulus/parachain-template/pallets/template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
}
Expand All @@ -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.
Expand All @@ -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]
Expand Down Expand Up @@ -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<T>,
dest: Box<VersionedMultiLocation>,
message: Box<VersionedXcm<()>>,
) -> DispatchResult {
let who = ensure_signed(origin)?;
let dest = MultiLocation::try_from(*dest).map_err(|()| Error::<T>::BadVersion)?;
let message: Xcm<()> = (*message).try_into().map_err(|()| Error::<T>::BadVersion)?;

pallet_xcm::Pallet::<T>::send_xcm(Here, dest, message.clone()).map_err(
|e| match e {
SendError::Unroutable => Error::<T>::Unreachable,
_ => Error::<T>::SendFailure,
},
)?;
Self::deposit_event(Event::Sent { from: who, to: dest, message });
Ok(())
}
}
}
1 change: 0 additions & 1 deletion cumulus/parachains/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub mod kusama;
pub mod message_queue;
pub mod polkadot;
pub mod rococo;
pub mod snowbridge_config;
pub mod westend;
pub mod wococo;
pub mod xcm_config;
Expand Down
9 changes: 0 additions & 9 deletions cumulus/parachains/common/src/snowbridge_config.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,3 @@ parachains-common = { path = "../../../../../../../parachains/common" }
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
bridge-hub-rococo-runtime = { path = "../../../../../../runtimes/bridge-hubs/bridge-hub-rococo" }

# Snowbridge
snowbridge-core = { path = "../../../../../../../../../parachain/primitives/core", default-features = false }
snowbridge-router-primitives = { path = "../../../../../../../../../parachain/primitives/router", default-features = false }
snowbridge-control = { path = "../../../../../../../../../parachain/pallets/control", default-features = false }
snowbridge-inbound-queue = { path = "../../../../../../../../../parachain/pallets/inbound-queue", default-features = false }
snowbridge-outbound-queue = { path = "../../../../../../../../../parachain/pallets/outbound-queue", default-features = false }

Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ decl_test_parachains! {
pallets = {
PolkadotXcm: bridge_hub_rococo_runtime::PolkadotXcm,
Balances: bridge_hub_rococo_runtime::Balances,
EthereumControl: bridge_hub_rococo_runtime::EthereumControl,
EthereumInboundQueue: bridge_hub_rococo_runtime::EthereumInboundQueue,
EthereumOutboundQueue: bridge_hub_rococo_runtime::EthereumOutboundQueue,
}
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ publish = false

[dependencies]
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
hex = "0.4.3"
hex-literal = "0.4.1"

# Substrate
sp-core = { path = "../../../../../../../substrate/primitives/core", default-features = false}
frame-support = { path = "../../../../../../../substrate/frame/support", default-features = false}
pallet-message-queue = { path = "../../../../../../../substrate/frame/message-queue" }
pallet-assets = { path = "../../../../../../../substrate/frame/assets", default-features = false }
pallet-balances = { path = "../../../../../../../substrate/frame/balances", default-features = false }

# Polkadot
xcm = { package = "staging-xcm", path = "../../../../../../../polkadot/xcm", default-features = false}
Expand All @@ -36,13 +30,4 @@ cumulus-pallet-xcmp-queue = { path = "../../../../../../pallets/xcmp-queue", def
cumulus-pallet-dmp-queue = { path = "../../../../../../pallets/dmp-queue", default-features = false}
bridge-hub-rococo-runtime = { path = "../../../../../../parachains/runtimes/bridge-hubs/bridge-hub-rococo", default-features = false }
emulated-integration-tests-common = { path = "../../../common", default-features = false}
rococo-wococo-system-emulated-network = { path = "../../../networks/rococo-wococo-system" }
bridge-hub-rococo-emulated-chain = { path = "../../../chains/parachains/bridges/bridge-hub-rococo"}
asset-hub-rococo-emulated-chain = { path = "../../../chains/parachains/assets/asset-hub-rococo"}

# Snowbridge
snowbridge-core = { path = "../../../../../../../../parachain/primitives/core", default-features = false }
snowbridge-router-primitives = { path = "../../../../../../../../parachain/primitives/router", default-features = false }
snowbridge-control = { path = "../../../../../../../../parachain/pallets/control", default-features = false }
snowbridge-inbound-queue = { path = "../../../../../../../../parachain/pallets/inbound-queue", default-features = false }
snowbridge-outbound-queue = { path = "../../../../../../../../parachain/pallets/outbound-queue", default-features = false }
rococo-wococo-system-emulated-network ={ path = "../../../networks/rococo-wococo-system" }
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
// limitations under the License.

mod example;
mod snowbridge;
mod teleport;
Loading

0 comments on commit 13b8863

Please sign in to comment.