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

Commit

Permalink
Rename control to system
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong authored and claravanstaden committed Dec 4, 2023
1 parent 9b49b41 commit 468a2a1
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 86 deletions.
88 changes: 43 additions & 45 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bridge-hub-common = { path = "../../../../../../runtimes/bridge-hubs/common", de
# Snowbridge
snowbridge-core = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-router-primitives = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-control = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-system = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-inbound-queue = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-outbound-queue = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ decl_test_parachains! {
pallets = {
PolkadotXcm: bridge_hub_rococo_runtime::PolkadotXcm,
Balances: bridge_hub_rococo_runtime::Balances,
EthereumControl: bridge_hub_rococo_runtime::EthereumControl,
EthereumSystem: bridge_hub_rococo_runtime::EthereumSystem,
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 @@ -46,6 +46,6 @@ rococo-system-emulated-network ={ path = "../../../networks/rococo-system" }
# Snowbridge
snowbridge-core = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-router-primitives = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-control = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-system = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-inbound-queue = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-outbound-queue = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use bridge_hub_rococo_emulated_chain::BridgeHubRococoParaPallet as BridgeHubRoco
use codec::{Decode, Encode};
use frame_support::pallet_prelude::TypeInfo;
use hex_literal::hex;
use snowbridge_control;
use snowbridge_core::outbound::OperatingMode;
use snowbridge_router_primitives::inbound::{Command, Destination, MessageV1, VersionedMessage};
use snowbridge_system;
use sp_core::H256;

const INITIAL_FUND: u128 = 5_000_000_000 * ROCOCO_ED;
Expand Down Expand Up @@ -98,7 +98,7 @@ fn create_agent() {
assert_expected_events!(
BridgeHubRococo,
vec![
RuntimeEvent::EthereumControl(snowbridge_control::Event::CreateAgent {
RuntimeEvent::EthereumSystem(snowbridge_system::Event::CreateAgent {
..
}) => {},
]
Expand Down Expand Up @@ -179,7 +179,7 @@ fn create_channel() {
assert_expected_events!(
BridgeHubRococo,
vec![
RuntimeEvent::EthereumControl(snowbridge_control::Event::CreateChannel {
RuntimeEvent::EthereumSystem(snowbridge_system::Event::CreateChannel {
..
}) => {},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", de

# Ethereum Bridge (Snowbridge)
snowbridge-beacon-primitives = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-control = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-control-runtime-api = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-system = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-system-runtime-api = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-core = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-ethereum-beacon-client = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
snowbridge-inbound-queue = { git = "https://github.com/Snowfork/snowbridge.git", tag = "v0.9.0", default-features = false }
Expand Down Expand Up @@ -191,8 +191,8 @@ std = [
"xcm-executor/std",
"xcm/std",
"snowbridge-beacon-primitives/std",
"snowbridge-control-runtime-api/std",
"snowbridge-control/std",
"snowbridge-system-runtime-api/std",
"snowbridge-system/std",
"snowbridge-core/std",
"snowbridge-ethereum-beacon-client/std",
"snowbridge-inbound-queue/std",
Expand Down Expand Up @@ -233,7 +233,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"snowbridge-control/runtime-benchmarks",
"snowbridge-system/runtime-benchmarks",
"snowbridge-core/runtime-benchmarks",
"snowbridge-ethereum-beacon-client/runtime-benchmarks",
"snowbridge-inbound-queue/runtime-benchmarks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl snowbridge_inbound_queue::Config for Runtime {
type XcmSender = XcmRouter;
#[cfg(feature = "runtime-benchmarks")]
type XcmSender = DoNothingRouter;
type ChannelLookup = EthereumControl;
type ChannelLookup = EthereumSystem;
type GatewayAddress = GatewayAddress;
#[cfg(feature = "runtime-benchmarks")]
type Helper = Runtime;
Expand Down Expand Up @@ -609,20 +609,20 @@ impl snowbridge_ethereum_beacon_client::Config for Runtime {
}

#[cfg(feature = "runtime-benchmarks")]
impl snowbridge_control::BenchmarkHelper<RuntimeOrigin> for () {
impl snowbridge_system::BenchmarkHelper<RuntimeOrigin> for () {
fn make_xcm_origin(location: xcm::latest::MultiLocation) -> RuntimeOrigin {
RuntimeOrigin::from(pallet_xcm::Origin::Xcm(location))
}
}

impl snowbridge_control::Config for Runtime {
impl snowbridge_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OutboundQueue = EthereumOutboundQueue;
type SiblingOrigin = EnsureXcm<AllowSiblingsOnly>;
type AgentIdOf = xcm_config::AgentIdOf;
type TreasuryAccount = TreasuryAccount;
type Token = Balances;
type WeightInfo = weights::snowbridge_control::WeightInfo<Runtime>;
type WeightInfo = weights::snowbridge_system::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
type Helper = ();
}
Expand Down Expand Up @@ -680,7 +680,7 @@ construct_runtime!(
EthereumInboundQueue: snowbridge_inbound_queue::{Pallet, Call, Storage, Event<T>} = 80,
EthereumOutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event<T>} = 81,
EthereumBeaconClient: snowbridge_ethereum_beacon_client::{Pallet, Call, Storage, Event<T>} = 82,
EthereumControl: snowbridge_control::{Pallet, Call, Storage, Config<T>, Event<T>} = 83,
EthereumSystem: snowbridge_system::{Pallet, Call, Storage, Config<T>, Event<T>} = 83,

// Message Queue. Importantly, is registered last so that messages are processed after
// the `on_initialize` hooks of bridging pallets.
Expand Down Expand Up @@ -725,7 +725,7 @@ mod benches {
// Ethereum Bridge
[snowbridge_inbound_queue, EthereumInboundQueue]
[snowbridge_outbound_queue, EthereumOutboundQueue]
[snowbridge_control, EthereumControl]
[snowbridge_system, EthereumSystem]
[snowbridge_ethereum_beacon_client, EthereumBeaconClient]
);
}
Expand Down Expand Up @@ -929,9 +929,9 @@ impl_runtime_apis! {
}
}

impl snowbridge_control_runtime_api::ControlApi<Block> for Runtime {
impl snowbridge_system_runtime_api::ControlApi<Block> for Runtime {
fn agent_id(location: VersionedMultiLocation) -> Option<AgentId> {
snowbridge_control::api::agent_id::<Runtime>(location)
snowbridge_system::api::agent_id::<Runtime>(location)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ pub mod pallet_utility;
pub mod pallet_xcm;
pub mod paritydb_weights;
pub mod rocksdb_weights;
pub mod snowbridge_control;
pub mod snowbridge_ethereum_beacon_client;
pub mod snowbridge_inbound_queue;
pub mod snowbridge_outbound_queue;
pub mod snowbridge_system;
pub mod xcm;

pub use block_weights::constants::BlockExecutionWeight;
Expand Down
Loading

0 comments on commit 468a2a1

Please sign in to comment.