diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs index e62504aee8..c1fca39d40 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs @@ -273,27 +273,28 @@ where { use pallet_xcm_bridge_hub::{Bridge, BridgeId, BridgeState}; use sp_runtime::traits::Zero; - use sp_std::boxed::Box; use xcm::VersionedInteriorLocation; // insert bridge metadata let lane_id = with; let sibling_parachain = Location::new(1, [Parachain(sibling_para_id)]); - let universal_source = [GlobalConsensus(Westend), Parachain(sibling_para_id)].into(); - let universal_destination = [GlobalConsensus(Rococo), Parachain(2075)].into(); + let universal_source = [GlobalConsensus(Kusama), Parachain(sibling_para_id)].into(); + let universal_destination = [GlobalConsensus(Polkadot), Parachain(2075)].into(); let bridge_id = BridgeId::new(&universal_source, &universal_destination); // insert only bridge metadata, because the benchmarks create lanes pallet_xcm_bridge_hub::Bridges::::insert( bridge_id, Bridge { - bridge_origin_relative_location: Box::new(sibling_parachain.clone().into()), - bridge_origin_universal_location: Box::new(VersionedInteriorLocation::from( - universal_source.clone(), - )), - bridge_destination_universal_location: Box::new(VersionedInteriorLocation::from( - universal_destination, - )), + bridge_origin_relative_location: sp_std::boxed::Box::new( + sibling_parachain.clone().into(), + ), + bridge_origin_universal_location: sp_std::boxed::Box::new( + VersionedInteriorLocation::from(universal_source.clone()), + ), + bridge_destination_universal_location: sp_std::boxed::Box::new( + VersionedInteriorLocation::from(universal_destination), + ), state: BridgeState::Opened, bridge_owner_account: C::convert_location(&sibling_parachain).expect("valid AccountId"), deposit: Zero::zero(), diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 8eb7050b1f..1d7d3389e8 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -1250,7 +1250,8 @@ impl_runtime_apis! { impl BridgeMessagesConfig for Runtime { fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool { let bench_lane_id = >::bench_lane_id(); - let bridged_chain_id = bridge_to_polkadot_config::BridgeHubPolkadotChainId::get(); + use bp_runtime::Chain; + let bridged_chain_id =>::BridgedChain::ID; pallet_bridge_relayers::Pallet::::relayer_reward( relayer, bp_relayers::RewardsAccountParams::new( @@ -1267,11 +1268,16 @@ impl_runtime_apis! { use cumulus_primitives_core::XcmpMessageSource; assert!(XcmpQueue::take_outbound_messages(usize::MAX).is_empty()); ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(42.into()); + let universal_source = bridge_to_polkadot_config::open_bridge_for_benchmarks::< + Runtime, + bridge_to_polkadot_config::XcmOverBridgeHubPolkadotInstance, + xcm_config::LocationToAccountId, + >(params.lane, 42); prepare_message_proof_from_parachain::< Runtime, bridge_to_polkadot_config::BridgeGrandpaPolkadotInstance, bridge_to_polkadot_config::WithBridgeHubPolkadotMessagesInstance, - >(params, generate_xcm_builder_bridge_message_sample([GlobalConsensus(Kusama), Parachain(42)].into())) + >(params, generate_xcm_builder_bridge_message_sample(universal_source)) } fn prepare_message_delivery_proof( diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs index 07692e2cb1..7d21d4acfe 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs @@ -272,27 +272,28 @@ where { use pallet_xcm_bridge_hub::{Bridge, BridgeId, BridgeState}; use sp_runtime::traits::Zero; - use sp_std::boxed::Box; use xcm::VersionedInteriorLocation; // insert bridge metadata let lane_id = with; let sibling_parachain = Location::new(1, [Parachain(sibling_para_id)]); - let universal_source = [GlobalConsensus(Westend), Parachain(sibling_para_id)].into(); - let universal_destination = [GlobalConsensus(Rococo), Parachain(2075)].into(); + let universal_source = [GlobalConsensus(Polkadot), Parachain(sibling_para_id)].into(); + let universal_destination = [GlobalConsensus(Kusama), Parachain(2075)].into(); let bridge_id = BridgeId::new(&universal_source, &universal_destination); // insert only bridge metadata, because the benchmarks create lanes pallet_xcm_bridge_hub::Bridges::::insert( bridge_id, Bridge { - bridge_origin_relative_location: Box::new(sibling_parachain.clone().into()), - bridge_origin_universal_location: Box::new(VersionedInteriorLocation::from( - universal_source.clone(), - )), - bridge_destination_universal_location: Box::new(VersionedInteriorLocation::from( - universal_destination, - )), + bridge_origin_relative_location: sp_std::boxed::Box::new( + sibling_parachain.clone().into(), + ), + bridge_origin_universal_location: sp_std::boxed::Box::new( + VersionedInteriorLocation::from(universal_source.clone()), + ), + bridge_destination_universal_location: sp_std::boxed::Box::new( + VersionedInteriorLocation::from(universal_destination), + ), state: BridgeState::Opened, bridge_owner_account: C::convert_location(&sibling_parachain).expect("valid AccountId"), deposit: Zero::zero(), diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 7247ee9631..2aecae8639 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -1268,7 +1268,8 @@ impl_runtime_apis! { impl BridgeMessagesConfig for Runtime { fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool { let bench_lane_id = >::bench_lane_id(); - let bridged_chain_id = bridge_to_kusama_config::BridgeHubKusamaChainId::get(); + use bp_runtime::Chain; + let bridged_chain_id =>::BridgedChain::ID; pallet_bridge_relayers::Pallet::::relayer_reward( relayer, bp_relayers::RewardsAccountParams::new( @@ -1285,11 +1286,16 @@ impl_runtime_apis! { use cumulus_primitives_core::XcmpMessageSource; assert!(XcmpQueue::take_outbound_messages(usize::MAX).is_empty()); ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(42.into()); + let universal_source = bridge_to_kusama_config::open_bridge_for_benchmarks::< + Runtime, + bridge_to_kusama_config::XcmOverBridgeHubKusamaInstance, + xcm_config::LocationToAccountId, + >(params.lane, 42); prepare_message_proof_from_parachain::< Runtime, bridge_to_kusama_config::BridgeGrandpaKusamaInstance, bridge_to_kusama_config::WithBridgeHubKusamaMessagesInstance, - >(params, generate_xcm_builder_bridge_message_sample([GlobalConsensus(Polkadot), Parachain(42)].into())) + >(params, generate_xcm_builder_bridge_message_sample(universal_source)) } fn prepare_message_delivery_proof(