Skip to content

Commit

Permalink
Various nits and alignments for SP testnets found during bumping `pol…
Browse files Browse the repository at this point in the history
…kadot-fellows` repo (#3359)
  • Loading branch information
bkontur authored Feb 16, 2024
1 parent 9923444 commit e84ec9f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ use testnet_parachains_constants::rococo::{
consensus::*, currency::*, fee::WeightToFee, snowbridge::INBOUND_QUEUE_PALLET_INDEX, time::*,
};

#[cfg(feature = "runtime-benchmarks")]
use bp_runtime::Chain;
use bp_runtime::HeaderId;
use bridge_hub_common::{
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
Expand Down Expand Up @@ -1298,7 +1296,7 @@ impl_runtime_apis! {
impl BridgeMessagesConfig<bridge_to_westend_config::WithBridgeHubWestendMessagesInstance> for Runtime {
fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool {
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_to_westend_config::WithBridgeHubWestendMessagesInstance>>::bench_lane_id();
let bridged_chain_id = bp_bridge_hub_westend::BridgeHubWestend::ID;
let bridged_chain_id = bridge_to_westend_config::BridgeHubWestendChainId::get();
pallet_bridge_relayers::Pallet::<Runtime>::relayer_reward(
relayer,
bp_relayers::RewardsAccountParams::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm_config::{XcmOriginToTransactDispatchOrigin, XcmRouter};

#[cfg(feature = "runtime-benchmarks")]
use bp_runtime::Chain;
use bp_runtime::HeaderId;

#[cfg(any(feature = "std", test))]
Expand Down Expand Up @@ -991,7 +989,7 @@ impl_runtime_apis! {
impl BridgeMessagesConfig<bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance> for Runtime {
fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool {
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance>>::bench_lane_id();
let bridged_chain_id = bp_bridge_hub_rococo::BridgeHubRococo::ID;
let bridged_chain_id = bridge_to_rococo_config::BridgeHubRococoChainId::get();
pallet_bridge_relayers::Pallet::<Runtime>::relayer_reward(
relayer,
bp_relayers::RewardsAccountParams::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ use pallet_xcm::XcmPassthrough;
use parachains_common::{
impls::ToStakingPot,
xcm_config::{
AllSiblingSystemParachains, ConcreteAssetFromSystem, RelayOrOtherSystemParachains,
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
RelayOrOtherSystemParachains,
},
TREASURY_PALLET_ID,
};
Expand Down Expand Up @@ -147,13 +148,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
}
}

pub struct ParentOrSiblings;
impl Contains<Location> for ParentOrSiblings {
fn contains(location: &Location) -> bool {
matches!(location.unpack(), (1, []) | (1, [Parachain(_)]))
}
}

/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
/// account for proof size weights.
///
Expand Down Expand Up @@ -219,7 +213,7 @@ pub type Barrier = TrailingSetTopicAsId<
// Parent and its pluralities (i.e. governance bodies) get free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsPlurality>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
),
UniversalLocation,
ConstU32<8>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ use pallet_xcm::XcmPassthrough;
use parachains_common::{
impls::ToStakingPot,
xcm_config::{
AllSiblingSystemParachains, ConcreteAssetFromSystem, RelayOrOtherSystemParachains,
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
RelayOrOtherSystemParachains,
},
TREASURY_PALLET_ID,
};
Expand Down Expand Up @@ -147,13 +148,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
}
}

pub struct ParentOrSiblings;
impl Contains<Location> for ParentOrSiblings {
fn contains(location: &Location) -> bool {
matches!(location.unpack(), (1, []) | (1, [Parachain(_)]))
}
}

pub struct FellowsPlurality;
impl Contains<Location> for FellowsPlurality {
fn contains(location: &Location) -> bool {
Expand Down Expand Up @@ -227,7 +221,7 @@ pub type Barrier = TrailingSetTopicAsId<
// get free execution.
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, FellowsPlurality)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
),
UniversalLocation,
ConstU32<8>,
Expand Down

0 comments on commit e84ec9f

Please sign in to comment.