Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Cargo cleanup and renames #94

Merged
merged 10 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 51 additions & 64 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions cumulus/parachains/common/src/rococo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,16 @@ pub mod consensus {
/// Relay chain slot duration, in milliseconds.
pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
}

pub mod snowbridge {
use frame_support::parameter_types;
use xcm::opaque::lts::NetworkId;

/// The pallet index of the Ethereum inbound queue pallet in the bridge hub runtime.
pub const INBOUND_QUEUE_PALLET_INDEX: u8 = 80;

parameter_types! {
/// Network and location for the Ethereum chain.
pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 11155111 };
}
}
Comment on lines +121 to +132
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the common config here since AH and BH should be able to access it.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ bridge-hub-common = { path = "../../../../../../runtimes/bridge-hubs/common", de
# Snowbridge
snowbridge-core = { path = "../../../../../../../../../parachain/primitives/core", default-features = false }
snowbridge-router-primitives = { path = "../../../../../../../../../parachain/primitives/router", default-features = false }
snowbridge-system = { path = "../../../../../../../../../parachain/pallets/system", 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 }
snowbridge-pallet-system = { path = "../../../../../../../../../parachain/pallets/system", default-features = false }
snowbridge-pallet-inbound-queue = { path = "../../../../../../../../../parachain/pallets/inbound-queue", default-features = false }
snowbridge-pallet-outbound-queue = { path = "../../../../../../../../../parachain/pallets/outbound-queue", default-features = false }
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ asset-hub-rococo-runtime = { path = "../../../../../runtimes/assets/asset-hub-ro
# Snowbridge
snowbridge-core = { path = "../../../../../../../../parachain/primitives/core", default-features = false }
snowbridge-router-primitives = { path = "../../../../../../../../parachain/primitives/router", default-features = false }
snowbridge-system = { path = "../../../../../../../../parachain/pallets/system", 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 }
snowbridge-rococo-common = { path = "../../../../../../../../parachain/runtime/rococo-common", default-features = false }
snowbridge-pallet-system = { path = "../../../../../../../../parachain/pallets/system", default-features = false }
snowbridge-pallet-inbound-queue = { path = "../../../../../../../../parachain/pallets/inbound-queue", default-features = false }
snowbridge-pallet-outbound-queue = { path = "../../../../../../../../parachain/pallets/outbound-queue", default-features = false }
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ use emulated_integration_tests_common::xcm_emulator::ConvertLocation;
use frame_support::pallet_prelude::TypeInfo;
use hex_literal::hex;
use snowbridge_core::outbound::OperatingMode;
use snowbridge_rococo_common::EthereumNetwork;
use parachains_common::rococo::snowbridge::EthereumNetwork;
use snowbridge_router_primitives::inbound::{
Command, Destination, GlobalConsensusEthereumConvertsFor, MessageV1, VersionedMessage,
};
use snowbridge_system;
use snowbridge_pallet_system;
use sp_core::H256;

const INITIAL_FUND: u128 = 5_000_000_000 * ROCOCO_ED;
Expand Down Expand Up @@ -94,7 +94,7 @@ fn create_agent() {
assert_expected_events!(
BridgeHubRococo,
vec![
RuntimeEvent::EthereumSystem(snowbridge_system::Event::CreateAgent {
RuntimeEvent::EthereumSystem(snowbridge_pallet_system::Event::CreateAgent {
..
}) => {},
]
Expand Down Expand Up @@ -168,7 +168,7 @@ fn create_channel() {
assert_expected_events!(
BridgeHubRococo,
vec![
RuntimeEvent::EthereumSystem(snowbridge_system::Event::CreateChannel {
RuntimeEvent::EthereumSystem(snowbridge_pallet_system::Event::CreateChannel {
..
}) => {},
]
Expand Down Expand Up @@ -484,7 +484,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() {
assert_expected_events!(
BridgeHubRococo,
vec![
RuntimeEvent::EthereumOutboundQueue(snowbridge_outbound_queue::Event::MessageQueued {..}) => {},
RuntimeEvent::EthereumOutboundQueue(snowbridge_pallet_outbound_queue::Event::MessageQueued {..}) => {},
]
);
let events = BridgeHubRococo::events();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ bp-asset-hub-westend = { path = "../../../../../bridges/primitives/chain-asset-h
bp-bridge-hub-rococo = { path = "../../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false }
bp-bridge-hub-westend = { path = "../../../../../bridges/primitives/chain-bridge-hub-westend", default-features = false }
snowbridge-router-primitives = { path = "../../../../../../parachain/primitives/router", default-features = false }
snowbridge-rococo-common = { path = "../../../../../../parachain/runtime/rococo-common", default-features = false }

[dev-dependencies]
asset-test-utils = { path = "../test-utils" }
Expand Down Expand Up @@ -139,7 +138,6 @@ runtime-benchmarks = [
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"snowbridge-rococo-common/runtime-benchmarks",
"snowbridge-router-primitives/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
Expand Down Expand Up @@ -231,7 +229,6 @@ std = [
"primitive-types/std",
"rococo-runtime-constants/std",
"scale-info/std",
"snowbridge-rococo-common/std",
"snowbridge-router-primitives/std",
"sp-api/std",
"sp-block-builder/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use assets_common::{
};
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use cumulus_primitives_core::AggregateMessageOrigin;
use snowbridge_rococo_common::EthereumNetwork;
use parachains_common::rococo::snowbridge::EthereumNetwork;
use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_runtime::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use parachains_common::{
};
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use snowbridge_rococo_common::EthereumNetwork;
use parachains_common::rococo::snowbridge::EthereumNetwork;
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumConvertsFor;
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
use xcm::latest::prelude::*;
Expand Down Expand Up @@ -822,7 +822,7 @@ pub mod bridging {
1,
X2(
Parachain(SiblingBridgeHubParaId::get()),
PalletInstance(snowbridge_rococo_common::INBOUND_QUEUE_MESSAGES_PALLET_INDEX)
PalletInstance(parachains_common::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX)
)
);

Expand Down
Loading
Loading