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

fix(account): bug #85

When a self-sufficient accounts receive money for the first time, that should trigger the random id assignment
parent ebcc1423
No related branches found
No related tags found
1 merge request!90fix(account): When a self-sufficient accounts receive money for the first time, that should trigger the random id assignment
......@@ -284,13 +284,11 @@ where
let result = f(&mut some_data)?;
let is_providing = some_data.is_some();
if !was_providing && is_providing {
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, ());
} else {
// If the account already exists, we should register increment providers directly
if frame_system::Pallet::<T>::account_exists(account_id) {
// If the account is self-sufficient, we should increment providers directly
frame_system::Pallet::<T>::inc_providers(account_id);
}
PendingNewAccounts::<T>::insert(account_id, ());
} else if was_providing && !is_providing {
match frame_system::Pallet::<T>::dec_providers(account_id)? {
frame_system::DecRefStatus::Reaped => return Ok(result),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment