add swap-to-staked-sri feature

This commit is contained in:
akildemir
2024-05-16 15:57:03 +03:00
parent 904c6ddbe3
commit 929e66c607
6 changed files with 50 additions and 6 deletions

View File

@@ -797,12 +797,19 @@ pub mod pallet {
total_required
}
// TODO: make the increase_allocation public instead?
pub fn deposit_stake(
network: NetworkId,
account: T::AccountId,
amount: Amount,
) -> DispatchResult {
// TODO: make the increase_allocation public instead?
// TODO: Should this call be part of the `increase_allocation` since we have to have it
// before each call to it?
Coins::<T>::transfer_internal(
account,
Self::account(),
Balance { coin: Coin::Serai, amount },
)?;
Self::increase_allocation(network, account, amount, true)
}