Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various nits and alignments for SP testnets found during bumping polkadot-fellows repo #3359

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading