Asset Conversion: Pool Account ID derivation with additional Pallet ID seed#3250
Conversation
This reverts commit 03363c8.
…rsion-pool-account
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
Review required! Latest push from author must always be reviewed |
| pub type PalletExampleMbms = pallet_example_mbm; | ||
|
|
||
| #[runtime::pallet_index(79)] | ||
| pub type AssetConversionMigration = pallet_asset_conversion_ops; |
There was a problem hiding this comment.
Do you need to add the migration to this runtime? It's not live, is it?
There was a problem hiding this comment.
This runtime serves as an example of pallets integration. I think it make sense to have here.
There was a problem hiding this comment.
Not required, I'm guessing it was probably added for pallet benchmarks.
There was a problem hiding this comment.
true, we also need it for the benchmarks.
|
|
||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | |
There was a problem hiding this comment.
Shouldn't you mention the migration?
There was a problem hiding this comment.
Yes, I can improve this
| if let Some((depositor, deposit)) = | ||
| T::AssetsRefund::deposit_held(asset1.clone(), prior_account.clone()) | ||
| { | ||
| T::DepositAsset::mint_into(&depositor, deposit + deposit_asset_ed)?; |
There was a problem hiding this comment.
Why do you mint deposit + deposit_asset_ed? Doesn't the depositor already have the deposit?
There was a problem hiding this comment.
No, depositor might now have it. There is a comment above.
| } | ||
| ); | ||
|
|
||
| #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] |
There was a problem hiding this comment.
You can remove many types given that you're deriving the defaults. Take a look at:
| type MaxConsumers = ConstU32<16>; | ||
| } | ||
|
|
||
| impl pallet_balances::Config for Test { |
There was a problem hiding this comment.
If you use derive_impl here, it means less maintenance when we add new config items to these traits.
| type RuntimeFreezeReason = (); | ||
| } | ||
|
|
||
| impl pallet_assets::Config<Instance1> for Test { |
| .collect::<Vec<_>>() | ||
| } | ||
|
|
||
| /// Reset the team for the asset with the given `id`. |
There was a problem hiding this comment.
What's the "team" of an asset?
There was a problem hiding this comment.
is not it clear from arguments? this also how we name it in pallet's call
|
@franciscoaguirre all the comments addressed, can you have a look again please |
| pub type PalletExampleMbms = pallet_example_mbm; | ||
|
|
||
| #[runtime::pallet_index(79)] | ||
| pub type AssetConversionMigration = pallet_asset_conversion_ops; |
There was a problem hiding this comment.
Not required, I'm guessing it was probably added for pallet benchmarks.
| /// Trait for resetting the team configuration of an existing fungible asset. | ||
| pub trait ResetTeam<AccountId>: Inspect<AccountId> { | ||
| /// Reset the team for the asset with the given `id`. | ||
| /// | ||
| /// ### Parameters | ||
| /// - `id`: The identifier of the asset for which the team is being reset. | ||
| /// - `owner`: The new `owner` account for the asset. | ||
| /// - `admin`: The new `admin` account for the asset. | ||
| /// - `issuer`: The new `issuer` account for the asset. | ||
| /// - `freezer`: The new `freezer` account for the asset. | ||
| fn reset_team( | ||
| id: Self::AssetId, | ||
| owner: AccountId, | ||
| admin: AccountId, | ||
| issuer: AccountId, | ||
| freezer: AccountId, | ||
| ) -> DispatchResult; | ||
| } |
There was a problem hiding this comment.
Not sure this belongs in lifetime.rs.. Maybe roles.rs?
…D 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 <>
Introduce
PalletIdas an additional seed parameter for pool's account id derivation.The PR also introduces the
pallet_asset_conversion_opspallet with a call to migrate a given pool to thew new account. Additionallyfungibles::lifetime::ResetTeamandfungible::lifetime::Refundtraits, to facilitate the migration of pools.