From 55040995934053aea1d7cd7c675358b4fd2ab80f Mon Sep 17 00:00:00 2001 From: Alistair Singh Date: Wed, 8 Nov 2023 23:02:19 +0200 Subject: [PATCH] move to treasury to snowbridge sovereign --- .../runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 4 ++-- .../bridge-hubs/bridge-hub-rococo/src/xcm_config.rs | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index cdab65a326004..5b27fb4fd06ba 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -86,7 +86,7 @@ use pallet_xcm::EnsureXcm; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use xcm::VersionedMultiLocation; -use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{SnowbridgeTreasuryAccount, XcmConfig, XcmOriginToTransactDispatchOrigin}; use bp_runtime::HeaderId; @@ -622,7 +622,7 @@ impl snowbridge_control::Config for Runtime { type MessageHasher = BlakeTwo256; type SiblingOrigin = EnsureXcm; type AgentIdOf = xcm_config::AgentIdOf; - type TreasuryAccount = TreasuryAccount; + type TreasuryAccount = SnowbridgeTreasuryAccount; type Token = Balances; type WeightInfo = weights::snowbridge_control::WeightInfo; #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index a56f69bfb7ed5..a5790335dd53a 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -50,7 +50,10 @@ use parachains_common::{ use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::xcm_sender::ExponentialPrice; use rococo_runtime_constants::system_parachain::SystemParachains; -use snowbridge_router_primitives::outbound::EthereumBlobExporter; +use snowbridge_router_primitives::{ + inbound::GlobalConsensusEthereumConvertsFor, + outbound::EthereumBlobExporter, +}; use sp_core::{Get, H256}; use sp_runtime::traits::AccountIdConversion; use sp_std::marker::PhantomData; @@ -82,7 +85,9 @@ parameter_types! { pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(rococo_runtime_constants::TREASURY_PALLET_ID)).into(); // Network and location for the local Ethereum testnet. - pub const EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 15 }; + pub const EthereumChainId: u64 = 15; + pub const EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: EthereumChainId::get() }; + pub SnowbridgeTreasuryAccount: AccountId = GlobalConsensusEthereumConvertsFor::::from_chain_id(&EthereumChainId::get()).into(); } /// Adapter for resolving `NetworkId` based on `pub storage Flavor: RuntimeFlavor`. @@ -318,7 +323,7 @@ impl xcm_executor::Config for XcmConfig { >, XcmExportFeeToSnowbridge< EthereumNetwork, - TreasuryAccount, + SnowbridgeTreasuryAccount, Self::AssetTransactor, >, XcmFeeToAccount,