mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Kusama origins as xcm multi_location (#6273)
* Kusamsa origins as xcm multilocation * Fellows origin index * origins to xcm plurality body * cleanup * fix cargo spellcheck * Apply suggestions from code review Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * include Fellows into scope * include Fellows into scope Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
@@ -321,3 +321,20 @@ where
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// `Convert` implementation to convert from an origin which passes the check of an `EnsureOrigin`
|
||||
/// into a voice of a given pluralistic `Body`.
|
||||
pub struct OriginToPluralityVoice<RuntimeOrigin, EnsureBodyOrigin, Body>(
|
||||
PhantomData<(RuntimeOrigin, EnsureBodyOrigin, Body)>,
|
||||
);
|
||||
impl<RuntimeOrigin: Clone, EnsureBodyOrigin: EnsureOrigin<RuntimeOrigin>, Body: Get<BodyId>>
|
||||
Convert<RuntimeOrigin, MultiLocation>
|
||||
for OriginToPluralityVoice<RuntimeOrigin, EnsureBodyOrigin, Body>
|
||||
{
|
||||
fn convert(o: RuntimeOrigin) -> Result<MultiLocation, RuntimeOrigin> {
|
||||
match EnsureBodyOrigin::try_origin(o) {
|
||||
Ok(_) => Ok(Junction::Plurality { id: Body::get(), part: BodyPart::Voice }.into()),
|
||||
Err(o) => Err(o),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user