Skip to content
Snippets Groups Projects
Commit c5df57ff authored by Éloïs's avatar Éloïs
Browse files

fix:1st receipt of currency from an account must increment its providers

parent dfd744af
No related branches found
No related tags found
1 merge request!36feat(runtimes): add account random id & provide randomness calls
...@@ -260,9 +260,12 @@ where ...@@ -260,9 +260,12 @@ where
let result = f(&mut some_data)?; let result = f(&mut some_data)?;
let is_providing = some_data.is_some(); let is_providing = some_data.is_some();
if !was_providing && is_providing { if !was_providing && is_providing {
// If the account does not exist, we should program its creation
if !frame_system::Pallet::<T>::account_exists(account_id) { if !frame_system::Pallet::<T>::account_exists(account_id) {
// If the account does not exist, we should program its creation
PendingNewAccounts::<T>::insert(account_id, ()); PendingNewAccounts::<T>::insert(account_id, ());
} else {
// If the account already exists, we should register increment providers directly
frame_system::Pallet::<T>::inc_providers(account_id);
} }
} else if was_providing && !is_providing { } else if was_providing && !is_providing {
match frame_system::Pallet::<T>::dec_providers(account_id)? { match frame_system::Pallet::<T>::dec_providers(account_id)? {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment