Asset Conversion: Pool Touch Call (#3251)

Introduce `touch` call designed to address operational prerequisites
before providing liquidity to a pool.

This function ensures that essential requirements, such as the presence
of the pool's accounts, are fulfilled. It is particularly beneficial in
scenarios where a pool creator removes the pool's accounts without
providing liquidity.

---------

Co-authored-by: command-bot <>
This commit is contained in:
Muharem
2024-04-17 18:45:01 +02:00
committed by GitHub
parent aa78fe2180
commit 305d311d5c
7 changed files with 268 additions and 53 deletions
+2
View File
@@ -1697,7 +1697,9 @@ pub mod pallet {
fn should_touch(asset: T::AssetId, who: &T::AccountId) -> bool {
match Asset::<T, I>::get(&asset) {
// refer to the [`Self::new_account`] function for more details.
Some(info) if info.is_sufficient => false,
Some(_) if frame_system::Pallet::<T>::can_accrue_consumers(who, 2) => false,
Some(_) => !Account::<T, I>::contains_key(asset, who),
_ => true,
}