From a2a630fe7ac4bf9cd4cacb5293a4f94175407331 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 21 Sep 2022 17:29:36 +0200 Subject: [PATCH] [BridgeHub] pallet_transaction_payment + Event --- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 14 +++++------ .../bridge-hub-rococo/src/xcm_config.rs | 23 ++----------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 41b5079156..bb5b4f55ae 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -378,8 +378,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - // TODO: hacked - // type Event = Event; + type Event = Event; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; @@ -417,7 +416,6 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = (); - type PriceForSiblingDelivery = (); } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -526,6 +524,7 @@ pub type BridgeParachainWococoInstance = pallet_bridge_parachains::Instance1; impl pallet_bridge_parachains::Config for Runtime { // TODO:check-parameter type WeightInfo = (); + type Event = Event; type BridgesGrandpaPalletInstance = BridgeGrandpaWococoInstance; type ParasPalletName = WococoBridgeParachainPalletName; type TrackedParachains = Everything; @@ -535,6 +534,7 @@ impl pallet_bridge_parachains::Config for Runtime /// Add parachain bridge pallet to track Rococo bridge hub parachain pub type BridgeParachainRococoInstance = pallet_bridge_parachains::Instance2; impl pallet_bridge_parachains::Config for Runtime { + type Event = Event; // TODO:check-parameter type WeightInfo = (); type BridgesGrandpaPalletInstance = BridgeGrandpaRococoInstance; @@ -563,9 +563,7 @@ construct_runtime!( // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, - // TODO: hacked - // TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 11, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, // Collator support. The order of these 4 are important and shall not change. Authorship: pallet_authorship::{Pallet, Call, Storage} = 20, @@ -585,11 +583,11 @@ construct_runtime!( // Wococo bridge modules BridgeWococoGrandpa: pallet_bridge_grandpa::::{Pallet, Call, Storage, Config} = 41, - BridgeWococoParachain: pallet_bridge_parachains::::{Pallet, Call, Storage} = 42, + BridgeWococoParachain: pallet_bridge_parachains::::{Pallet, Call, Storage, Event} = 42, // Rococo bridge modules BridgeRococoGrandpa: pallet_bridge_grandpa::::{Pallet, Call, Storage, Config} = 43, - BridgeRococoParachain: pallet_bridge_parachains::::{Pallet, Call, Storage} = 44, + BridgeRococoParachain: pallet_bridge_parachains::::{Pallet, Call, Storage, Event} = 44, // Sudo Sudo: pallet_sudo::{Pallet, Call, Config, Event, Storage} = 100, diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 216997bdf2..543962807d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -182,26 +182,6 @@ pub type Barrier = ( /// XCM weigher type. pub type XcmWeigher = FixedWeightBounds; -// TODO: hacked -// pub struct XcmConfig; -// impl xcm_executor::Config for XcmConfig { -// type Call = Call; -// type XcmSender = XcmRouter; -// // How to withdraw and deposit an asset. -// type AssetTransactor = LocalAssetTransactor; -// type OriginConverter = XcmOriginToTransactDispatchOrigin; -// type IsReserve = NativeAsset; -// type IsTeleporter = (); // Teleporting is disabled. -// type LocationInverter = LocationInverter; -// type Barrier = Barrier; -// type Weigher = FixedWeightBounds; -// type Trader = -// UsingComponents>; -// type ResponseHandler = PolkadotXcm; -// type AssetTrap = PolkadotXcm; -// type AssetClaims = PolkadotXcm; -// type SubscriptionService = PolkadotXcm; -// } pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type Call = Call; @@ -225,6 +205,7 @@ impl xcm_executor::Config for XcmConfig { type FeeManager = (); type MessageExporter = (); type UniversalAliases = Nothing; + type CallDispatcher = Call; } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -234,7 +215,7 @@ pub type LocalOriginToLocation = SignedToAccountId32, + cumulus_primitives_utility::ParentAsUmp, // ..and XCMP to communicate with the sibling chains. XcmpQueue, );