mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Asset Conversion: Pool Account ID derivation with additional Pallet ID seed (#3250)
Introduce `PalletId` as an additional seed parameter for pool's account id derivation. The PR also introduces the `pallet_asset_conversion_ops` pallet with a call to migrate a given pool to thew new account. Additionally `fungibles::lifetime::ResetTeam` and `fungible::lifetime::Refund` traits, to facilitate the migration of pools. --------- Co-authored-by: command-bot <>
This commit is contained in:
@@ -244,6 +244,11 @@ ord_parameter_types! {
|
||||
pub const AssetConversionOrigin: u64 = AccountIdConversion::<u64>::into_account_truncating(&AssetConversionPalletId::get());
|
||||
}
|
||||
|
||||
pub type PoolIdToAccountId = pallet_asset_conversion::AccountIdConverter<
|
||||
AssetConversionPalletId,
|
||||
(NativeOrWithId<u32>, NativeOrWithId<u32>),
|
||||
>;
|
||||
|
||||
impl pallet_asset_conversion::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = Balance;
|
||||
@@ -252,8 +257,8 @@ impl pallet_asset_conversion::Config for Runtime {
|
||||
type Assets = UnionOf<Balances, Assets, NativeFromLeft, NativeOrWithId<u32>, AccountId>;
|
||||
type PoolId = (Self::AssetKind, Self::AssetKind);
|
||||
type PoolLocator = Chain<
|
||||
WithFirstAsset<Native, AccountId, NativeOrWithId<u32>>,
|
||||
Ascending<AccountId, NativeOrWithId<u32>>,
|
||||
WithFirstAsset<Native, AccountId, NativeOrWithId<u32>, PoolIdToAccountId>,
|
||||
Ascending<AccountId, NativeOrWithId<u32>, PoolIdToAccountId>,
|
||||
>;
|
||||
type PoolAssetId = u32;
|
||||
type PoolAssets = PoolAssets;
|
||||
|
||||
Reference in New Issue
Block a user