Skip to content
Snippets Groups Projects

feat(runtimes): add account random id & provide randomness calls

Merged Éloïs requested to merge elois-random-id into master
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -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)? {
Loading