mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +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:
@@ -66,6 +66,7 @@ frame-system-rpc-runtime-api = { path = "../../../frame/system/rpc/runtime-api",
|
||||
frame-try-runtime = { path = "../../../frame/try-runtime", default-features = false, optional = true }
|
||||
pallet-alliance = { path = "../../../frame/alliance", default-features = false }
|
||||
pallet-asset-conversion = { path = "../../../frame/asset-conversion", default-features = false }
|
||||
pallet-asset-conversion-ops = { path = "../../../frame/asset-conversion/ops", default-features = false }
|
||||
pallet-asset-rate = { path = "../../../frame/asset-rate", default-features = false }
|
||||
pallet-assets = { path = "../../../frame/assets", default-features = false }
|
||||
pallet-authority-discovery = { path = "../../../frame/authority-discovery", default-features = false }
|
||||
@@ -166,6 +167,7 @@ std = [
|
||||
"log/std",
|
||||
"node-primitives/std",
|
||||
"pallet-alliance/std",
|
||||
"pallet-asset-conversion-ops/std",
|
||||
"pallet-asset-conversion-tx-payment/std",
|
||||
"pallet-asset-conversion/std",
|
||||
"pallet-asset-rate/std",
|
||||
@@ -278,6 +280,7 @@ runtime-benchmarks = [
|
||||
"frame-system-benchmarking/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pallet-alliance/runtime-benchmarks",
|
||||
"pallet-asset-conversion-ops/runtime-benchmarks",
|
||||
"pallet-asset-conversion/runtime-benchmarks",
|
||||
"pallet-asset-rate/runtime-benchmarks",
|
||||
"pallet-asset-tx-payment/runtime-benchmarks",
|
||||
@@ -354,6 +357,7 @@ try-runtime = [
|
||||
"frame-system/try-runtime",
|
||||
"frame-try-runtime/try-runtime",
|
||||
"pallet-alliance/try-runtime",
|
||||
"pallet-asset-conversion-ops/try-runtime",
|
||||
"pallet-asset-conversion-tx-payment/try-runtime",
|
||||
"pallet-asset-conversion/try-runtime",
|
||||
"pallet-asset-rate/try-runtime",
|
||||
|
||||
@@ -63,7 +63,7 @@ use frame_system::{
|
||||
};
|
||||
pub use node_primitives::{AccountId, Signature};
|
||||
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
|
||||
use pallet_asset_conversion::{Ascending, Chain, WithFirstAsset};
|
||||
use pallet_asset_conversion::{AccountIdConverter, Ascending, Chain, WithFirstAsset};
|
||||
use pallet_broker::{CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600};
|
||||
use pallet_election_provider_multi_phase::{GeometricDepositBase, SolutionAccuracyOf};
|
||||
use pallet_identity::legacy::IdentityInfo;
|
||||
@@ -1710,8 +1710,17 @@ 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>,
|
||||
AccountIdConverter<AssetConversionPalletId, Self::PoolId>,
|
||||
>,
|
||||
Ascending<
|
||||
AccountId,
|
||||
NativeOrWithId<u32>,
|
||||
AccountIdConverter<AssetConversionPalletId, Self::PoolId>,
|
||||
>,
|
||||
>;
|
||||
type PoolAssetId = <Self as pallet_assets::Config<Instance2>>::AssetId;
|
||||
type PoolAssets = PoolAssets;
|
||||
@@ -1728,6 +1737,19 @@ impl pallet_asset_conversion::Config for Runtime {
|
||||
type BenchmarkHelper = ();
|
||||
}
|
||||
|
||||
impl pallet_asset_conversion_ops::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type PriorAccountIdConverter = pallet_asset_conversion::AccountIdConverterNoSeed<(
|
||||
NativeOrWithId<u32>,
|
||||
NativeOrWithId<u32>,
|
||||
)>;
|
||||
type AssetsRefund = <Runtime as pallet_asset_conversion::Config>::Assets;
|
||||
type PoolAssetsRefund = <Runtime as pallet_asset_conversion::Config>::PoolAssets;
|
||||
type PoolAssetsTeam = <Runtime as pallet_asset_conversion::Config>::PoolAssets;
|
||||
type DepositAsset = Balances;
|
||||
type WeightInfo = pallet_asset_conversion_ops::weights::SubstrateWeight<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const QueueCount: u32 = 300;
|
||||
pub const MaxQueueLen: u32 = 1000;
|
||||
@@ -2474,6 +2496,9 @@ mod runtime {
|
||||
|
||||
#[runtime::pallet_index(78)]
|
||||
pub type PalletExampleMbms = pallet_example_mbm;
|
||||
|
||||
#[runtime::pallet_index(79)]
|
||||
pub type AssetConversionMigration = pallet_asset_conversion_ops;
|
||||
}
|
||||
|
||||
/// The address format for describing accounts.
|
||||
@@ -2633,6 +2658,7 @@ mod benches {
|
||||
[pallet_tx_pause, TxPause]
|
||||
[pallet_safe_mode, SafeMode]
|
||||
[pallet_example_mbm, PalletExampleMbms]
|
||||
[pallet_asset_conversion_ops, AssetConversionMigration]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user