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
@@ -23,7 +23,7 @@ pub mod crowdloan_index_migration {
// The old way we generated fund accounts.
fn old_fund_account_id<T: Config>(index: ParaId) -> T::AccountId {
T::PalletId::get().into_sub_account(index)
T::PalletId::get().into_sub_account_truncating(index)
}
pub fn pre_migrate<T: Config>() -> Result<(), &'static str> {
+1 -1
View File
@@ -661,7 +661,7 @@ impl<T: Config> Pallet<T> {
/// This actually does computation. If you need to keep using it, then make sure you cache the
/// value and only call this once.
pub fn fund_account_id(index: FundIndex) -> T::AccountId {
T::PalletId::get().into_sub_account(index)
T::PalletId::get().into_sub_account_truncating(index)
}
pub fn id_from_index(index: FundIndex) -> child::ChildInfo {
@@ -24,7 +24,7 @@ pub mod slots_crowdloan_index_migration {
// The old way we generated fund accounts.
fn old_fund_account_id<T: Config + crowdloan::Config>(index: ParaId) -> T::AccountId {
<T as crowdloan::Config>::PalletId::get().into_sub_account(index)
<T as crowdloan::Config>::PalletId::get().into_sub_account_truncating(index)
}
pub fn pre_migrate<T: Config + crowdloan::Config>() -> Result<(), &'static str> {