mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
Fix ParentOrSiblings (#2428)
We were not filtering for sibling parachains, but for sibling anything --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: command-bot <>
This commit is contained in:
committed by
GitHub
parent
575b8f8d15
commit
313b2c4b6e
@@ -139,6 +139,21 @@ impl<AssetLocation: Get<MultiLocation>> ContainsPair<MultiAsset, MultiLocation>
|
||||
}
|
||||
}
|
||||
|
||||
/// Filter to check if a given location is the parent Relay Chain or a sibling parachain.
|
||||
///
|
||||
/// This type should only be used within the context of a parachain, since it does not verify that
|
||||
/// the parent is indeed a Relay Chain.
|
||||
pub struct ParentRelayOrSiblingParachains;
|
||||
impl Contains<MultiLocation> for ParentRelayOrSiblingParachains {
|
||||
fn contains(location: &MultiLocation) -> bool {
|
||||
matches!(
|
||||
location,
|
||||
MultiLocation { parents: 1, interior: Here } |
|
||||
MultiLocation { parents: 1, interior: X1(Parachain(_)) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use frame_support::{parameter_types, traits::Contains};
|
||||
|
||||
Reference in New Issue
Block a user