Browse Source

storage liasison selection includes lead

Mokhtar Naamani 4 years ago
parent
commit
0d45512406
2 changed files with 8 additions and 1 deletions
  1. 7 0
      runtime-modules/working-group/src/lib.rs
  2. 1 1
      runtime/src/integration/storage.rs

+ 7 - 0
runtime-modules/working-group/src/lib.rs

@@ -1395,6 +1395,13 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
             .collect()
     }
 
+    /// Returns all existing worker id list.
+    pub fn get_all_worker_ids() -> Vec<WorkerId<T>> {
+        <WorkerById<T, I>>::iter()
+            .map(|(worker_id, _)| worker_id)
+            .collect()
+    }
+
     fn make_stake_opt_imbalance(
         opt_balance: &Option<BalanceOf<T>>,
         source_account: &T::AccountId,

+ 1 - 1
runtime/src/integration/storage.rs

@@ -8,7 +8,7 @@ pub struct StorageProviderHelper;
 
 impl storage::data_directory::StorageProviderHelper<Runtime> for StorageProviderHelper {
     fn get_random_storage_provider() -> Result<ActorId, &'static str> {
-        let ids = crate::StorageWorkingGroup::get_regular_worker_ids();
+        let ids = crate::StorageWorkingGroup::get_all_worker_ids();
 
         let live_ids: Vec<ActorId> = ids
             .into_iter()