Co #10719: Use into_account_truncating (#4947)

* Use into_account_truncating

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* more truncating

* more truncating

* more

* clean up parachain primitives

* more truncating

* update lockfile for {"substrate"}

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Oliver Tale-Yazdi
2022-05-17 23:53:14 +02:00
committed by GitHub
parent 2907a7aeae
commit 157b5186ba
15 changed files with 279 additions and 236 deletions
@@ -70,7 +70,7 @@ impl<ParaId: From<u32> + Into<u32> + AccountIdConversion<AccountId>, AccountId:
fn convert_ref(location: impl Borrow<MultiLocation>) -> Result<AccountId, ()> {
match location.borrow() {
MultiLocation { parents: 0, interior: X1(Parachain(id)) } =>
Ok(ParaId::from(*id).into_account()),
Ok(ParaId::from(*id).into_account_truncating()),
_ => Err(()),
}
}
@@ -91,7 +91,7 @@ impl<ParaId: From<u32> + Into<u32> + AccountIdConversion<AccountId>, AccountId:
fn convert_ref(location: impl Borrow<MultiLocation>) -> Result<AccountId, ()> {
match location.borrow() {
MultiLocation { parents: 1, interior: X1(Parachain(id)) } =>
Ok(ParaId::from(*id).into_account()),
Ok(ParaId::from(*id).into_account_truncating()),
_ => Err(()),
}
}