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 committed Nov 30, 2023
1 parent 42537e8 commit 01acc2a
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 78 deletions.
74 changes: 37 additions & 37 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 = { 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-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 }

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 = { 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-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 }
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 = { path = "../../../../../../parachain/primitives/beacon", default-features = false }
snowbridge-control = { path = "../../../../../../parachain/pallets/control", default-features = false }
snowbridge-control-runtime-api = { path = "../../../../../../parachain/pallets/control/runtime-api", default-features = false }
snowbridge-system = { path = "../../../../../../parachain/pallets/system", default-features = false }
snowbridge-system-runtime-api = { path = "../../../../../../parachain/pallets/system/runtime-api", default-features = false }
snowbridge-core = { path = "../../../../../../parachain/primitives/core", default-features = false }
snowbridge-ethereum-beacon-client = { path = "../../../../../../parachain/pallets/ethereum-beacon-client", default-features = false }
snowbridge-inbound-queue = { path = "../../../../../../parachain/pallets/inbound-queue", 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

//! Autogenerated weights for `snowbridge_control`
//! Autogenerated weights for `snowbridge_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-09, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
Expand All @@ -13,12 +13,12 @@
// pallet
// --chain
// bridge-hub-rococo-dev
// --pallet=snowbridge_control
// --pallet=snowbridge_system
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --output
// parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_control.rs
// parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -28,9 +28,9 @@
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `snowbridge_control`.
/// Weight functions for `snowbridge_system`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
impl<T: frame_system::Config> snowbridge_system::WeightInfo for WeightInfo<T> {
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
Expand All @@ -51,8 +51,8 @@ impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: EthereumControl Agents (r:1 w:1)
/// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumSystem Agents (r:1 w:1)
/// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: System Account (r:2 w:2)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
Expand All @@ -77,10 +77,10 @@ impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
}
/// Storage: System Account (r:2 w:2)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: EthereumControl Agents (r:1 w:0)
/// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumControl Channels (r:1 w:1)
/// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen)
/// Storage: EthereumSystem Agents (r:1 w:0)
/// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumSystem Channels (r:1 w:1)
/// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
Expand All @@ -99,8 +99,8 @@ impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: EthereumControl Channels (r:1 w:0)
/// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen)
/// Storage: EthereumSystem Channels (r:1 w:0)
/// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
/// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: MessageQueue BookStateFor (r:2 w:2)
Expand All @@ -119,8 +119,8 @@ impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: EthereumControl Channels (r:1 w:0)
/// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen)
/// Storage: EthereumSystem Channels (r:1 w:0)
/// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
/// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: MessageQueue BookStateFor (r:2 w:2)
Expand Down Expand Up @@ -159,8 +159,8 @@ impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: EthereumControl Agents (r:1 w:0)
/// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumSystem Agents (r:1 w:0)
/// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
/// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: MessageQueue BookStateFor (r:2 w:2)
Expand All @@ -179,8 +179,8 @@ impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: EthereumControl Agents (r:1 w:0)
/// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumSystem Agents (r:1 w:0)
/// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
/// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: MessageQueue BookStateFor (r:2 w:2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Contains<RuntimeCall> for SafeCallFilter {
snowbridge_inbound_queue::Call::set_operating_mode { .. },
) | RuntimeCall::EthereumOutboundQueue(
snowbridge_outbound_queue::Call::set_operating_mode { .. },
) | RuntimeCall::EthereumControl(..)
) | RuntimeCall::EthereumSystem(..)
)
}
}
Expand Down
Loading

0 comments on commit 01acc2a

Please sign in to comment.