ソースを参照

Rename "bureaucracy" module to the "working group" module

Shamil Gadelshin 4 年 前
コミット
c748ec57cc

+ 26 - 26
Cargo.lock

@@ -1645,7 +1645,6 @@ dependencies = [
  "srml-timestamp",
  "srml-transaction-payment",
  "substrate-authority-discovery-primitives",
- "substrate-bureaucracy-module",
  "substrate-client",
  "substrate-common-module",
  "substrate-consensus-babe-primitives",
@@ -1670,6 +1669,7 @@ dependencies = [
  "substrate-versioned-store",
  "substrate-versioned-store-permissions-module",
  "substrate-wasm-builder-runner",
+ "substrate-working-group-module",
 ]
 
 [[package]]
@@ -4462,28 +4462,6 @@ dependencies = [
  "sha2",
 ]
 
-[[package]]
-name = "substrate-bureaucracy-module"
-version = "1.0.0"
-dependencies = [
- "parity-scale-codec",
- "serde",
- "sr-io",
- "sr-primitives",
- "sr-std",
- "srml-balances",
- "srml-support",
- "srml-system",
- "srml-timestamp",
- "substrate-common-module",
- "substrate-hiring-module",
- "substrate-membership-module",
- "substrate-primitives",
- "substrate-recurring-reward-module",
- "substrate-stake-module",
- "substrate-token-mint-module",
-]
-
 [[package]]
 name = "substrate-chain-spec"
 version = "2.0.0"
@@ -4844,7 +4822,6 @@ dependencies = [
  "srml-support-procedural",
  "srml-system",
  "srml-timestamp",
- "substrate-bureaucracy-module",
  "substrate-common-module",
  "substrate-hiring-module",
  "substrate-membership-module",
@@ -4852,6 +4829,7 @@ dependencies = [
  "substrate-recurring-reward-module",
  "substrate-stake-module",
  "substrate-token-mint-module",
+ "substrate-working-group-module",
 ]
 
 [[package]]
@@ -5379,7 +5357,6 @@ dependencies = [
  "srml-support",
  "srml-system",
  "srml-timestamp",
- "substrate-bureaucracy-module",
  "substrate-common-module",
  "substrate-hiring-module",
  "substrate-membership-module",
@@ -5387,6 +5364,7 @@ dependencies = [
  "substrate-recurring-reward-module",
  "substrate-stake-module",
  "substrate-token-mint-module",
+ "substrate-working-group-module",
 ]
 
 [[package]]
@@ -5463,7 +5441,6 @@ dependencies = [
  "srml-support",
  "srml-system",
  "srml-timestamp",
- "substrate-bureaucracy-module",
  "substrate-common-module",
  "substrate-hiring-module",
  "substrate-membership-module",
@@ -5471,6 +5448,7 @@ dependencies = [
  "substrate-recurring-reward-module",
  "substrate-stake-module",
  "substrate-token-mint-module",
+ "substrate-working-group-module",
 ]
 
 [[package]]
@@ -5613,6 +5591,28 @@ dependencies = [
  "wasmi",
 ]
 
+[[package]]
+name = "substrate-working-group-module"
+version = "1.0.0"
+dependencies = [
+ "parity-scale-codec",
+ "serde",
+ "sr-io",
+ "sr-primitives",
+ "sr-std",
+ "srml-balances",
+ "srml-support",
+ "srml-system",
+ "srml-timestamp",
+ "substrate-common-module",
+ "substrate-hiring-module",
+ "substrate-membership-module",
+ "substrate-primitives",
+ "substrate-recurring-reward-module",
+ "substrate-stake-module",
+ "substrate-token-mint-module",
+]
+
 [[package]]
 name = "subtle"
 version = "1.0.0"

+ 1 - 1
Cargo.toml

@@ -19,7 +19,7 @@ members = [
 	"runtime-modules/token-minting",
 	"runtime-modules/versioned-store",
 	"runtime-modules/versioned-store-permissions",
-	"runtime-modules/bureaucracy",
+	"runtime-modules/working-group",
 	"node",
 	"utils/chain-spec-builder/"
 ]

+ 1 - 1
node/src/forum_config/from_serialized.rs

@@ -23,7 +23,7 @@ fn parse_forum_json() -> Result<ForumData> {
     serde_json::from_str(data)
 }
 
-//TODO: should we set the forum_sudo account in the bureaucracy module?
+//TODO: should we set the forum_sudo account in the working group module?
 pub fn create(_forum_sudo: AccountId) -> ForumConfig {
     let forum_data = parse_forum_json().expect("failed loading forum data");
 

+ 4 - 4
runtime-modules/forum/Cargo.toml

@@ -30,10 +30,10 @@ git = 'https://github.com/paritytech/substrate.git'
 package = 'sr-io'
 rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'
 
-[dependencies.bureaucracy]
+[dependencies.working-group]
 default_features = false
-package = 'substrate-bureaucracy-module'
-path = '../bureaucracy'
+package = 'substrate-working-group-module'
+path = '../working-group'
 version = '1.0.0'
 
 [dev-dependencies]
@@ -89,6 +89,6 @@ std = [
 	'system/std',
   	'balances/std',
 	'timestamp/std',
-	'bureaucracy/std',
+	'working-group/std',
 	'common/std',
 ]

+ 7 - 7
runtime-modules/forum/src/mock.rs

@@ -103,7 +103,7 @@ impl timestamp::Trait for Runtime {
     type MinimumPeriod = MinimumPeriod;
 }
 
-impl bureaucracy::Trait<bureaucracy::Instance1> for Runtime {
+impl working_group::Trait<working_group::Instance1> for Runtime {
     type Event = ();
 }
 
@@ -162,7 +162,7 @@ impl minting::Trait for Runtime {
 impl Trait for Runtime {
     type Event = ();
     type MembershipRegistry = registry::TestMembershipRegistryModule;
-    type EnsureForumLeader = bureaucracy::Module<Runtime, bureaucracy::Instance1>;
+    type EnsureForumLeader = working_group::Module<Runtime, working_group::Instance1>;
     type ThreadId = u64;
     type PostId = u64;
 }
@@ -241,7 +241,7 @@ pub struct CreateCategoryFixture {
 
 impl CreateCategoryFixture {
     pub fn call_and_assert(&self) {
-        set_bureaucracy_forum_lead();
+        set_working_group_forum_lead();
         assert_eq!(
             TestForumModule::create_category(
                 mock_origin(self.origin.clone()),
@@ -264,7 +264,7 @@ pub struct UpdateCategoryFixture {
 
 impl UpdateCategoryFixture {
     pub fn call_and_assert(&self) {
-        set_bureaucracy_forum_lead();
+        set_working_group_forum_lead();
         assert_eq!(
             TestForumModule::update_category(
                 mock_origin(self.origin.clone()),
@@ -285,11 +285,11 @@ pub struct CreateThreadFixture {
     pub result: dispatch::Result,
 }
 
-type Bureaucracy1 = bureaucracy::Module<Runtime, bureaucracy::Instance1>;
+type WorkingGroup1 = working_group::Module<Runtime, working_group::Instance1>;
 
-pub(crate) fn set_bureaucracy_forum_lead() {
+pub(crate) fn set_working_group_forum_lead() {
     assert_eq!(
-        Bureaucracy1::set_lead(RawOrigin::Root.into(), FORUM_SUDO_MEMBER_ID, FORUM_SUDO_ID),
+        WorkingGroup1::set_lead(RawOrigin::Root.into(), FORUM_SUDO_MEMBER_ID, FORUM_SUDO_ID),
         Ok(())
     );
 }

+ 2 - 2
runtime-modules/forum/src/tests.rs

@@ -686,7 +686,7 @@ fn cannot_moderate_thread_with_invalid_id() {
     let origin = OriginType::Signed(FORUM_SUDO_ID);
 
     build_test_externalities(config).execute_with(|| {
-        set_bureaucracy_forum_lead();
+        set_working_group_forum_lead();
         assert_err!(
             moderate_thread(origin, INVLAID_THREAD_ID, good_rationale()),
             ERROR_THREAD_DOES_NOT_EXIST
@@ -700,7 +700,7 @@ fn cannot_moderate_post_with_invalid_id() {
     let origin = OriginType::Signed(FORUM_SUDO_ID);
 
     build_test_externalities(config).execute_with(|| {
-        mock::set_bureaucracy_forum_lead();
+        mock::set_working_group_forum_lead();
         assert_err!(
             moderate_post(origin, INVLAID_POST_ID, good_rationale()),
             ERROR_POST_DOES_NOT_EXIST

+ 4 - 4
runtime-modules/service-discovery/Cargo.toml

@@ -14,7 +14,7 @@ std = [
 	'serde',
     'codec/std',
     'primitives/std',
-    'bureaucracy/std',
+    'working-group/std',
 ]
 
 [dependencies.sr-primitives]
@@ -69,10 +69,10 @@ git = 'https://github.com/paritytech/substrate.git'
 package = 'sr-io'
 rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'
 
-[dependencies.bureaucracy]
+[dependencies.working-group]
 default_features = false
-package = 'substrate-bureaucracy-module'
-path = '../bureaucracy'
+package = 'substrate-working-group-module'
+path = '../working-group'
 
 [dev-dependencies.balances]
 default_features = false

+ 8 - 8
runtime-modules/service-discovery/src/lib.rs

@@ -5,7 +5,7 @@
 //!
 //! ## Comments
 //!
-//! Service discovery module uses bureaucracy module to authorize actions. It is generally used by
+//! Service discovery module uses working group module to authorize actions. It is generally used by
 //! the Colossus service.
 //!
 //! ## Supported extrinsics
@@ -48,11 +48,11 @@ pub type IPNSIdentity = Vec<u8>;
 /// HTTP Url string to a discovery service endpoint
 pub type Url = Vec<u8>;
 
-// Alias for storage working group bureaucracy
-pub(crate) type StorageBureaucracy<T> = bureaucracy::Module<T, bureaucracy::Instance2>;
+// Alias for storage working group
+pub(crate) type StorageWorkingGroup<T> = working_group::Module<T, working_group::Instance2>;
 
-/// Storage provider is a worker from the bureaucracy module.
-pub type StorageProviderId<T> = bureaucracy::WorkerId<T>;
+/// Storage provider is a worker from the  working_group module.
+pub type StorageProviderId<T> = working_group::WorkerId<T>;
 
 pub(crate) const MINIMUM_LIFETIME: u32 = 600; // 1hr assuming 6s block times
 pub(crate) const DEFAULT_LIFETIME: u32 = MINIMUM_LIFETIME * 24; // 24hr
@@ -68,7 +68,7 @@ pub struct AccountInfo<BlockNumber> {
 }
 
 /// The _Service discovery_ main _Trait_.
-pub trait Trait: system::Trait + bureaucracy::Trait<bureaucracy::Instance2> {
+pub trait Trait: system::Trait + working_group::Trait<working_group::Instance2> {
     /// _Service discovery_ event type.
     type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
 }
@@ -120,7 +120,7 @@ decl_module! {
             id: Vec<u8>,
             lifetime: Option<T::BlockNumber>
         ) {
-            <StorageBureaucracy<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
+            <StorageWorkingGroup<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
 
             // TODO: ensure id is a valid base58 encoded IPNS identity
 
@@ -148,7 +148,7 @@ decl_module! {
         /// Deletes the AccountInfo with the IPNS identity for the storage provider.
         /// Requires signed storage provider credentials.
         pub fn unset_ipns_id(origin, storage_provider_id: StorageProviderId<T>) {
-            <StorageBureaucracy<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
+            <StorageWorkingGroup<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
 
             // == MUTATION SAFE ==
 

+ 8 - 8
runtime-modules/service-discovery/src/mock.rs

@@ -11,10 +11,10 @@ pub use sr_primitives::{
 
 use srml_support::{impl_outer_event, impl_outer_origin, parameter_types};
 
-mod bureaucracy_mod {
-    pub use bureaucracy::Event;
-    pub use bureaucracy::Instance2;
-    pub use bureaucracy::Trait;
+mod working_group_mod {
+    pub use working_group::Event;
+    pub use working_group::Instance2;
+    pub use working_group::Trait;
 }
 
 mod membership_mod {
@@ -34,7 +34,7 @@ impl_outer_event! {
         discovery<T>,
         balances<T>,
         membership_mod<T>,
-        bureaucracy_mod Instance2 <T>,
+         working_group_mod Instance2 <T>,
     }
 }
 
@@ -127,7 +127,7 @@ impl recurringrewards::Trait for Test {
     type RewardRelationshipId = u64;
 }
 
-impl bureaucracy::Trait<bureaucracy::Instance2> for Test {
+impl working_group::Trait<working_group::Instance2> for Test {
     type Event = MetaEvent;
 }
 
@@ -153,14 +153,14 @@ pub(crate) fn hire_storage_provider() -> (u64, u64) {
     let storage_provider_id = 1;
     let role_account_id = 1;
 
-    let storage_provider = bureaucracy::Worker {
+    let storage_provider = working_group::Worker {
         member_id: 1,
         role_account: role_account_id,
         reward_relationship: None,
         role_stake_profile: None,
     };
 
-    <bureaucracy::WorkerById<Test, bureaucracy::Instance2>>::insert(
+    <working_group::WorkerById<Test, working_group::Instance2>>::insert(
         storage_provider_id,
         storage_provider,
     );

+ 4 - 4
runtime-modules/storage/Cargo.toml

@@ -17,7 +17,7 @@ std = [
 	'primitives/std',
 	'common/std',
 	'membership/std',
-	'bureaucracy/std',
+	'working-group/std',
 ]
 
 
@@ -78,10 +78,10 @@ default_features = false
 package = 'substrate-common-module'
 path = '../common'
 
-[dependencies.bureaucracy]
+[dependencies.working-group]
 default_features = false
-package = 'substrate-bureaucracy-module'
-path = '../bureaucracy'
+package = 'substrate-working-group-module'
+path = '../working-group'
 
 [dev-dependencies.runtime-io]
 default_features = false

+ 8 - 8
runtime-modules/storage/src/data_directory.rs

@@ -4,7 +4,7 @@
 //!
 //! ## Comments
 //!
-//! Data object type registry module uses bureaucracy module to authorize actions.
+//! Data object type registry module uses  working group module to authorize actions.
 //!
 //! ## Supported extrinsics
 //!
@@ -32,7 +32,7 @@ pub(crate) use common::BlockAndTime;
 
 use crate::data_object_type_registry;
 use crate::data_object_type_registry::IsActiveDataObjectType;
-use crate::{MemberId, StorageBureaucracy, StorageProviderId};
+use crate::{MemberId, StorageProviderId, StorageWorkingGroup};
 
 /// The _Data directory_ main _Trait_.
 pub trait Trait:
@@ -40,7 +40,7 @@ pub trait Trait:
     + system::Trait
     + data_object_type_registry::Trait
     + membership::members::Trait
-    + bureaucracy::Trait<bureaucracy::Instance2>
+    + working_group::Trait<working_group::Instance2>
 {
     /// _Data directory_ event type.
     type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
@@ -88,10 +88,10 @@ impl From<system::Error> for Error {
     }
 }
 
-impl From<bureaucracy::Error> for Error {
-    fn from(error: bureaucracy::Error) -> Self {
+impl From<working_group::Error> for Error {
+    fn from(error: working_group::Error) -> Self {
         match error {
-            bureaucracy::Error::Other(msg) => Error::Other(msg),
+            working_group::Error::Other(msg) => Error::Other(msg),
             _ => Error::Other(error.into()),
         }
     }
@@ -238,7 +238,7 @@ decl_module! {
             storage_provider_id: StorageProviderId<T>,
             content_id: T::ContentId
         ) {
-            <StorageBureaucracy<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
+            <StorageWorkingGroup<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
 
             // == MUTATION SAFE ==
 
@@ -256,7 +256,7 @@ decl_module! {
             storage_provider_id: StorageProviderId<T>,
             content_id: T::ContentId
         ) {
-            <StorageBureaucracy<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
+            <StorageWorkingGroup<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
 
             // == MUTATION SAFE ==
 

+ 8 - 8
runtime-modules/storage/src/data_object_storage_registry.rs

@@ -4,7 +4,7 @@
 //!
 //! ## Comments
 //!
-//! Data object storage registry module uses bureaucracy module to authorize actions.
+//! Data object storage registry module uses  working group module to authorize actions.
 //! Only registered storage providers can call extrinsics.
 //!
 //! ## Supported extrinsics
@@ -28,7 +28,7 @@ use sr_primitives::traits::{MaybeSerialize, Member, SimpleArithmetic};
 use srml_support::{decl_error, decl_event, decl_module, decl_storage, ensure, Parameter};
 
 use crate::data_directory::{self, ContentIdExists};
-use crate::{StorageBureaucracy, StorageProviderId};
+use crate::{StorageProviderId, StorageWorkingGroup};
 
 const DEFAULT_FIRST_RELATIONSHIP_ID: u32 = 1;
 
@@ -37,7 +37,7 @@ pub trait Trait:
     timestamp::Trait
     + system::Trait
     + data_directory::Trait
-    + bureaucracy::Trait<bureaucracy::Instance2>
+    + working_group::Trait<working_group::Instance2>
 {
     /// _Data object storage registry_ event type.
     type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
@@ -83,10 +83,10 @@ impl From<system::Error> for Error {
     }
 }
 
-impl From<bureaucracy::Error> for Error {
-    fn from(error: bureaucracy::Error) -> Self {
+impl From<working_group::Error> for Error {
+    fn from(error: working_group::Error) -> Self {
         match error {
-            bureaucracy::Error::Other(msg) => Error::Other(msg),
+            working_group::Error::Other(msg) => Error::Other(msg),
             _ => Error::Other(error.into()),
         }
     }
@@ -158,7 +158,7 @@ decl_module! {
         /// in the storage working group.
         pub fn add_relationship(origin, storage_provider_id: StorageProviderId<T>, cid: T::ContentId) {
             // Origin should match storage provider.
-            <StorageBureaucracy<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
+            <StorageWorkingGroup<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
 
             // Content ID must exist
             ensure!(T::ContentIdExists::has_content(&cid), Error::CidNotFound);
@@ -221,7 +221,7 @@ impl<T: Trait> Module<T> {
         id: T::DataObjectStorageRelationshipId,
         ready: bool,
     ) -> Result<(), Error> {
-        <StorageBureaucracy<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
+        <StorageWorkingGroup<T>>::ensure_worker_signed(origin, &storage_provider_id)?;
 
         // For that, we need to fetch the identified DOSR
         let mut dosr =

+ 10 - 10
runtime-modules/storage/src/data_object_type_registry.rs

@@ -3,7 +3,7 @@
 //!
 //! ## Comments
 //!
-//! Data object type registry module uses bureaucracy module to authorize actions. Only leader can
+//! Data object type registry module uses  working group module to authorize actions. Only leader can
 //! call extrinsics.
 //!
 //! ## Supported extrinsics
@@ -22,7 +22,7 @@
 // Do not delete! Cannot be uncommented by default, because of Parity decl_module! issue.
 //#![warn(missing_docs)]
 
-use crate::StorageBureaucracy;
+use crate::StorageWorkingGroup;
 use codec::{Codec, Decode, Encode};
 use rstd::prelude::*;
 use sr_primitives::traits::{MaybeSerialize, Member, SimpleArithmetic};
@@ -32,7 +32,7 @@ const DEFAULT_TYPE_DESCRIPTION: &str = "Default data object type for audio and v
 const DEFAULT_FIRST_DATA_OBJECT_TYPE_ID: u32 = 1;
 
 /// The _Data object type registry_ main _Trait_.
-pub trait Trait: system::Trait + bureaucracy::Trait<bureaucracy::Instance2> {
+pub trait Trait: system::Trait + working_group::Trait<working_group::Instance2> {
     /// _Data object type registry_ event type.
     type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
 
@@ -68,10 +68,10 @@ impl From<system::Error> for Error {
     }
 }
 
-impl From<bureaucracy::Error> for Error {
-    fn from(error: bureaucracy::Error) -> Self {
+impl From<working_group::Error> for Error {
+    fn from(error: working_group::Error) -> Self {
         match error {
-            bureaucracy::Error::Other(msg) => Error::Other(msg),
+            working_group::Error::Other(msg) => Error::Other(msg),
             _ => Error::Other(error.into()),
         }
     }
@@ -149,7 +149,7 @@ decl_module! {
 
         /// Registers the new data object type. Requires leader privileges.
         pub fn register_data_object_type(origin, data_object_type: DataObjectType) {
-            <StorageBureaucracy<T>>::ensure_origin_is_active_leader(origin)?;
+            <StorageWorkingGroup<T>>::ensure_origin_is_active_leader(origin)?;
 
             let new_do_type_id = Self::next_data_object_type_id();
             let do_type: DataObjectType = DataObjectType {
@@ -169,7 +169,7 @@ decl_module! {
 
         /// Updates existing data object type. Requires leader privileges.
         pub fn update_data_object_type(origin, id: T::DataObjectTypeId, data_object_type: DataObjectType) {
-            <StorageBureaucracy<T>>::ensure_origin_is_active_leader(origin)?;
+            <StorageWorkingGroup<T>>::ensure_origin_is_active_leader(origin)?;
 
             let mut do_type = Self::ensure_data_object_type(id)?;
 
@@ -187,7 +187,7 @@ decl_module! {
 
         /// Activates existing data object type. Requires leader privileges.
         pub fn activate_data_object_type(origin, id: T::DataObjectTypeId) {
-            <StorageBureaucracy<T>>::ensure_origin_is_active_leader(origin)?;
+            <StorageWorkingGroup<T>>::ensure_origin_is_active_leader(origin)?;
 
             let mut do_type = Self::ensure_data_object_type(id)?;
 
@@ -204,7 +204,7 @@ decl_module! {
 
         /// Deactivates existing data object type. Requires leader privileges.
         pub fn deactivate_data_object_type(origin, id: T::DataObjectTypeId) {
-            <StorageBureaucracy<T>>::ensure_origin_is_active_leader(origin)?;
+            <StorageWorkingGroup<T>>::ensure_origin_is_active_leader(origin)?;
 
             let mut do_type = Self::ensure_data_object_type(id)?;
 

+ 4 - 4
runtime-modules/storage/src/lib.rs

@@ -7,11 +7,11 @@ pub mod data_object_type_registry;
 
 mod tests;
 
-// Alias for storage working group bureaucracy
-pub(crate) type StorageBureaucracy<T> = bureaucracy::Module<T, bureaucracy::Instance2>;
+// Alias for storage working group
+pub(crate) type StorageWorkingGroup<T> = working_group::Module<T, working_group::Instance2>;
 
 // Alias for the member id.
 pub(crate) type MemberId<T> = <T as membership::members::Trait>::MemberId;
 
-/// Storage provider is a worker from the bureaucracy module.
-pub type StorageProviderId<T> = bureaucracy::WorkerId<T>;
+/// Storage provider is a worker from the working group module.
+pub type StorageProviderId<T> = working_group::WorkerId<T>;

+ 3 - 3
runtime-modules/storage/src/tests/data_object_storage_registry.rs

@@ -22,7 +22,7 @@ fn add_relationship_fails_with_invalid_authorization() {
             storage_provider_id,
             TEST_MOCK_EXISTING_CID,
         );
-        assert_eq!(res, Err(bureaucracy::Error::WorkerDoesNotExist.into()));
+        assert_eq!(res, Err(working_group::Error::WorkerDoesNotExist.into()));
     });
 }
 
@@ -44,7 +44,7 @@ fn set_relationship_ready_fails_with_invalid_authorization() {
             invalid_storage_provider_id,
             TEST_MOCK_EXISTING_CID,
         );
-        assert_eq!(res, Err(bureaucracy::Error::WorkerDoesNotExist.into()));
+        assert_eq!(res, Err(working_group::Error::WorkerDoesNotExist.into()));
     });
 }
 
@@ -66,7 +66,7 @@ fn unset_relationship_ready_fails_with_invalid_authorization() {
             invalid_storage_provider_id,
             TEST_MOCK_EXISTING_CID,
         );
-        assert_eq!(res, Err(bureaucracy::Error::WorkerDoesNotExist.into()));
+        assert_eq!(res, Err(working_group::Error::WorkerDoesNotExist.into()));
     });
 }
 

+ 5 - 5
runtime-modules/storage/src/tests/data_object_type_registry.rs

@@ -1,7 +1,7 @@
 #![cfg(test)]
 
 use super::mock::*;
-use crate::StorageBureaucracy;
+use crate::StorageWorkingGroup;
 use system::{self, EventRecord, Phase, RawOrigin};
 
 const DEFAULT_LEADER_ACCOUNT_ID: u64 = 1;
@@ -10,7 +10,7 @@ const DEFAULT_LEADER_MEMBER_ID: u64 = 1;
 struct SetLeadFixture;
 impl SetLeadFixture {
     fn set_default_lead() {
-        let set_lead_result = <StorageBureaucracy<Test>>::set_lead(
+        let set_lead_result = <StorageWorkingGroup<Test>>::set_lead(
             RawOrigin::Root.into(),
             DEFAULT_LEADER_MEMBER_ID,
             DEFAULT_LEADER_ACCOUNT_ID,
@@ -81,7 +81,7 @@ fn activate_data_object_type_fails_with_invalid_lead() {
             RawOrigin::Signed(invalid_leader_account_id).into(),
             dot_id,
         );
-        assert_eq!(res, Err(bureaucracy::Error::IsNotLeadAccount.into()));
+        assert_eq!(res, Err(working_group::Error::IsNotLeadAccount.into()));
     });
 }
 
@@ -108,7 +108,7 @@ fn deactivate_data_object_type_fails_with_invalid_lead() {
             RawOrigin::Signed(invalid_leader_account_id).into(),
             dot_id,
         );
-        assert_eq!(res, Err(bureaucracy::Error::IsNotLeadAccount.into()));
+        assert_eq!(res, Err(working_group::Error::IsNotLeadAccount.into()));
     });
 }
 
@@ -140,7 +140,7 @@ fn update_data_object_type_fails_with_invalid_lead() {
             dot_id,
             updated1,
         );
-        assert_eq!(res, Err(bureaucracy::Error::IsNotLeadAccount.into()));
+        assert_eq!(res, Err(working_group::Error::IsNotLeadAccount.into()));
     });
 }
 

+ 7 - 7
runtime-modules/storage/src/tests/mock.rs

@@ -17,9 +17,9 @@ use crate::data_directory::ContentIdExists;
 use crate::data_object_type_registry::IsActiveDataObjectType;
 use srml_support::{impl_outer_event, impl_outer_origin, parameter_types, StorageLinkedMap};
 
-mod bureaucracy_mod {
-    pub use bureaucracy::Event;
-    pub use bureaucracy::Instance2;
+mod working_group_mod {
+    pub use working_group::Event;
+    pub use working_group::Instance2;
 }
 
 impl_outer_origin! {
@@ -33,7 +33,7 @@ impl_outer_event! {
         data_object_storage_registry<T>,
         balances<T>,
         members<T>,
-        bureaucracy_mod Instance2 <T>,
+        working_group_mod Instance2 <T>,
     }
 }
 
@@ -145,7 +145,7 @@ impl GovernanceCurrency for Test {
     type Currency = balances::Module<Self>;
 }
 
-impl bureaucracy::Trait<bureaucracy::Instance2> for Test {
+impl working_group::Trait<working_group::Instance2> for Test {
     type Event = MetaEvent;
 }
 
@@ -301,14 +301,14 @@ pub(crate) fn hire_storage_provider() -> (u64, u32) {
     let storage_provider_id = 1;
     let role_account_id = 1;
 
-    let storage_provider = bureaucracy::Worker {
+    let storage_provider = working_group::Worker {
         member_id: 1,
         role_account: role_account_id,
         reward_relationship: None,
         role_stake_profile: None,
     };
 
-    <bureaucracy::WorkerById<Test, bureaucracy::Instance2>>::insert(
+    <working_group::WorkerById<Test, working_group::Instance2>>::insert(
         storage_provider_id,
         storage_provider,
     );

+ 1 - 1
runtime-modules/bureaucracy/Cargo.toml → runtime-modules/working-group/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = 'substrate-bureaucracy-module'
+name = 'substrate-working-group-module'
 version = '1.0.0'
 authors = ['Joystream contributors']
 edition = '2018'

+ 0 - 0
runtime-modules/bureaucracy/src/errors.rs → runtime-modules/working-group/src/errors.rs


+ 11 - 11
runtime-modules/bureaucracy/src/lib.rs → runtime-modules/working-group/src/lib.rs

@@ -1,12 +1,12 @@
-//! # Bureaucracy module
-//! Bureaucracy module for the Joystream platform. Version 1.
+//! # Working group module
+//! Working group module for the Joystream platform. Version 1.
 //! Contains abstract working group workflow.
 //!
 //! ## Overview
 //!
-//! The bureaucracy module provides working group workflow to use in different modules.
-//! Exact working group (eg.: forum working group) should create an instance of the Bureaucracy module.
-//! Bureacracy module contains extrinsics for the hiring workflow and the roles lifecycle.
+//! The working group module provides working group workflow to use in different modules.
+//! Exact working group (eg.: forum working group) should create an instance of the Working group module.
+//! The Working group module contains extrinsics for the hiring workflow and the roles lifecycle.
 //!
 //! ## Supported extrinsics
 //! ### Hiring flow
@@ -145,7 +145,7 @@ type WorkerOf<T> = Worker<
     MemberId<T>,
 >;
 
-/// The _Bureaucracy_ main _Trait_
+/// The _Working group_ main _Trait_
 pub trait Trait<I: Instance>:
     system::Trait
     + membership::members::Trait
@@ -154,12 +154,12 @@ pub trait Trait<I: Instance>:
     + stake::Trait
     + recurringrewards::Trait
 {
-    /// _Bureaucracy_ event type.
+    /// _Working group_ event type.
     type Event: From<Event<Self, I>> + Into<<Self as system::Trait>::Event>;
 }
 
 decl_event!(
-    /// _Bureaucracy_ events
+    /// _Working group_ events
     pub enum Event<T, I>
     where
         MemberId = MemberId<T>,
@@ -262,7 +262,7 @@ decl_event!(
 );
 
 decl_storage! {
-    trait Store for Module<T: Trait<I>, I: Instance> as Bureaucracy {
+    trait Store for Module<T: Trait<I>, I: Instance> as WorkingGroup {
         /// The mint currently funding the rewards for this module.
         pub Mint get(mint) : <T as minting::Trait>::MintId;
 
@@ -299,7 +299,7 @@ decl_storage! {
 }
 
 decl_module! {
-    /// _Bureaucracy_ substrate module.
+    /// _Working group_ substrate module.
     pub struct Module<T: Trait<I>, I: Instance> for enum Call where origin: T::Origin {
         /// Default deposit_event() handler
         fn deposit_event() = default;
@@ -960,7 +960,7 @@ where
 }
 
 impl<T: Trait<I>, I: Instance> Module<T, I> {
-    /// Checks that provided lead account id belongs to the current bureaucracy leader
+    /// Checks that provided lead account id belongs to the current working group leader
     pub fn ensure_is_lead_account(lead_account_id: T::AccountId) -> Result<(), Error> {
         let lead = <CurrentLead<T, I>>::get();
 

+ 33 - 33
runtime-modules/bureaucracy/src/tests/fixtures.rs → runtime-modules/working-group/src/tests/fixtures.rs

@@ -1,4 +1,4 @@
-use super::mock::{Balances, Bureaucracy1, Membership, System, Test, TestEvent};
+use super::mock::{Balances, Membership, System, Test, TestEvent, WorkingGroup1};
 use crate::types::{
     OpeningPolicyCommitment, RewardPolicy, Worker, WorkerApplication, WorkerOpening,
     WorkerRoleStakeProfile,
@@ -39,7 +39,7 @@ impl IncreaseWorkerStakeFixture {
         let stake_id = 0;
         let old_stake = <stake::Module<Test>>::stakes(stake_id);
         let old_balance = Balances::free_balance(&self.account_id);
-        let actual_result = Bureaucracy1::increase_worker_stake(
+        let actual_result = WorkingGroup1::increase_worker_stake(
             self.origin.clone().into(),
             self.worker_id,
             self.balance,
@@ -94,7 +94,7 @@ impl TerminateWorkerRoleFixture {
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
         <crate::WorkerExitRationaleText<Instance1>>::put(self.constraint.clone());
 
-        let actual_result = Bureaucracy1::terminate_worker_role(
+        let actual_result = WorkingGroup1::terminate_worker_role(
             self.origin.clone().into(),
             self.worker_id,
             self.text.clone(),
@@ -129,7 +129,7 @@ impl LeaveWorkerRoleFixture {
 
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
         let rationale_text = b"rationale_text".to_vec();
-        let actual_result = Bureaucracy1::leave_worker_role(
+        let actual_result = WorkingGroup1::leave_worker_role(
             self.origin.clone().into(),
             self.worker_id,
             rationale_text.clone(),
@@ -164,7 +164,7 @@ impl UpdateWorkerRewardAccountFixture {
 
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
         assert_eq!(
-            Bureaucracy1::update_worker_reward_account(
+            WorkingGroup1::update_worker_reward_account(
                 self.origin.clone().into(),
                 self.worker_id,
                 self.new_role_account_id
@@ -193,7 +193,7 @@ impl UpdateWorkerRoleAccountFixture {
     }
 
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
-        let actual_result = Bureaucracy1::update_worker_role_account(
+        let actual_result = WorkingGroup1::update_worker_role_account(
             self.origin.clone().into(),
             self.worker_id,
             self.new_role_account_id,
@@ -201,7 +201,7 @@ impl UpdateWorkerRoleAccountFixture {
         assert_eq!(actual_result, expected_result);
 
         if actual_result.is_ok() {
-            let worker = Bureaucracy1::worker_by_id(self.worker_id);
+            let worker = WorkingGroup1::worker_by_id(self.worker_id);
 
             assert_eq!(worker.role_account, self.new_role_account_id);
         }
@@ -211,11 +211,11 @@ impl UpdateWorkerRoleAccountFixture {
 pub struct UnsetLeadFixture;
 impl UnsetLeadFixture {
     pub fn unset_lead() {
-        assert_eq!(Bureaucracy1::unset_lead(RawOrigin::Root.into()), Ok(()));
+        assert_eq!(WorkingGroup1::unset_lead(RawOrigin::Root.into()), Ok(()));
     }
 
     pub fn call_and_assert(origin: RawOrigin<u64>, expected_result: Result<(), Error>) {
-        assert_eq!(Bureaucracy1::unset_lead(origin.into()), expected_result);
+        assert_eq!(WorkingGroup1::unset_lead(origin.into()), expected_result);
     }
 }
 
@@ -260,8 +260,8 @@ impl FillWorkerOpeningFixture {
     }
 
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) -> u64 {
-        let saved_worker_next_id = Bureaucracy1::next_worker_id();
-        let actual_result = Bureaucracy1::fill_worker_opening(
+        let saved_worker_next_id = WorkingGroup1::next_worker_id();
+        let actual_result = WorkingGroup1::fill_worker_opening(
             self.origin.clone().into(),
             self.opening_id,
             self.successful_worker_application_ids.clone(),
@@ -270,10 +270,10 @@ impl FillWorkerOpeningFixture {
         assert_eq!(actual_result.clone(), expected_result);
 
         if actual_result.is_ok() {
-            assert_eq!(Bureaucracy1::next_worker_id(), saved_worker_next_id + 1);
+            assert_eq!(WorkingGroup1::next_worker_id(), saved_worker_next_id + 1);
             let worker_id = saved_worker_next_id;
 
-            let opening = Bureaucracy1::worker_opening_by_id(self.opening_id);
+            let opening = WorkingGroup1::worker_opening_by_id(self.opening_id);
 
             let role_stake_profile = if opening
                 .policy_commitment
@@ -303,7 +303,7 @@ impl FillWorkerOpeningFixture {
                 role_stake_profile,
             };
 
-            let actual_worker = Bureaucracy1::worker_by_id(worker_id);
+            let actual_worker = WorkingGroup1::worker_by_id(worker_id);
 
             assert_eq!(actual_worker, expected_worker);
         }
@@ -328,7 +328,7 @@ impl BeginReviewWorkerApplicationsFixture {
         BeginReviewWorkerApplicationsFixture { origin, ..self }
     }
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
-        let actual_result = Bureaucracy1::begin_worker_applicant_review(
+        let actual_result = WorkingGroup1::begin_worker_applicant_review(
             self.origin.clone().into(),
             self.opening_id,
         );
@@ -358,7 +358,7 @@ impl TerminateApplicationFixture {
         }
     }
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
-        let actual_result = Bureaucracy1::terminate_worker_application(
+        let actual_result = WorkingGroup1::terminate_worker_application(
             self.origin.clone().into(),
             self.worker_application_id,
         );
@@ -387,7 +387,7 @@ impl WithdrawApplicationFixture {
         }
     }
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
-        let actual_result = Bureaucracy1::withdraw_worker_application(
+        let actual_result = WorkingGroup1::withdraw_worker_application(
             self.origin.clone().into(),
             self.worker_application_id,
         );
@@ -465,8 +465,8 @@ impl ApplyOnWorkerOpeningFixture {
     }
 
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) -> u64 {
-        let saved_application_next_id = Bureaucracy1::next_worker_application_id();
-        let actual_result = Bureaucracy1::apply_on_worker_opening(
+        let saved_application_next_id = WorkingGroup1::next_worker_application_id();
+        let actual_result = WorkingGroup1::apply_on_worker_opening(
             self.origin.clone().into(),
             self.member_id,
             self.worker_opening_id,
@@ -479,12 +479,12 @@ impl ApplyOnWorkerOpeningFixture {
 
         if actual_result.is_ok() {
             assert_eq!(
-                Bureaucracy1::next_worker_application_id(),
+                WorkingGroup1::next_worker_application_id(),
                 saved_application_next_id + 1
             );
             let application_id = saved_application_next_id;
 
-            let actual_application = Bureaucracy1::worker_application_by_id(application_id);
+            let actual_application = WorkingGroup1::worker_application_by_id(application_id);
 
             let expected_application = WorkerApplication {
                 role_account: self.role_account,
@@ -495,7 +495,7 @@ impl ApplyOnWorkerOpeningFixture {
 
             assert_eq!(actual_application, expected_application);
 
-            let current_opening = Bureaucracy1::worker_opening_by_id(self.worker_opening_id);
+            let current_opening = WorkingGroup1::worker_opening_by_id(self.worker_opening_id);
             assert!(current_opening
                 .worker_applications
                 .contains(&application_id));
@@ -520,7 +520,7 @@ impl AcceptWorkerApplicationsFixture {
 
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) {
         let actual_result =
-            Bureaucracy1::accept_worker_applications(self.origin.clone().into(), self.opening_id);
+            WorkingGroup1::accept_worker_applications(self.origin.clone().into(), self.opening_id);
         assert_eq!(actual_result, expected_result);
     }
 }
@@ -529,7 +529,7 @@ pub struct SetLeadFixture;
 impl SetLeadFixture {
     pub fn set_lead(lead_account_id: u64) {
         assert_eq!(
-            Bureaucracy1::set_lead(RawOrigin::Root.into(), 1, lead_account_id),
+            WorkingGroup1::set_lead(RawOrigin::Root.into(), 1, lead_account_id),
             Ok(())
         );
     }
@@ -541,7 +541,7 @@ impl SetLeadFixture {
         expected_result: Result<(), Error>,
     ) {
         assert_eq!(
-            Bureaucracy1::set_lead(origin.into(), member_id, account_id),
+            WorkingGroup1::set_lead(origin.into(), member_id, account_id),
             expected_result
         );
     }
@@ -577,8 +577,8 @@ impl AddWorkerOpeningFixture {
     }
 
     pub fn call_and_assert(&self, expected_result: Result<(), Error>) -> u64 {
-        let saved_opening_next_id = Bureaucracy1::next_worker_opening_id();
-        let actual_result = Bureaucracy1::add_worker_opening(
+        let saved_opening_next_id = WorkingGroup1::next_worker_opening_id();
+        let actual_result = WorkingGroup1::add_worker_opening(
             self.origin.clone().into(),
             self.activate_at.clone(),
             self.commitment.clone(),
@@ -588,12 +588,12 @@ impl AddWorkerOpeningFixture {
 
         if actual_result.is_ok() {
             assert_eq!(
-                Bureaucracy1::next_worker_opening_id(),
+                WorkingGroup1::next_worker_opening_id(),
                 saved_opening_next_id + 1
             );
             let opening_id = saved_opening_next_id;
 
-            let actual_opening = Bureaucracy1::worker_opening_by_id(opening_id);
+            let actual_opening = WorkingGroup1::worker_opening_by_id(opening_id);
 
             let expected_opening = WorkerOpening::<u64, u64, u64, u64> {
                 opening_id,
@@ -641,7 +641,7 @@ impl EventFixture {
     ) {
         let converted_events = expected_raw_events
             .iter()
-            .map(|ev| TestEvent::bureaucracy_Instance1(ev.clone()))
+            .map(|ev| TestEvent::working_group_Instance1(ev.clone()))
             .collect::<Vec<TestEvent>>();
 
         Self::assert_global_events(converted_events)
@@ -672,7 +672,7 @@ impl EventFixture {
             crate::Instance1,
         >,
     ) {
-        let converted_event = TestEvent::bureaucracy_Instance1(expected_raw_event);
+        let converted_event = TestEvent::working_group_Instance1(expected_raw_event);
 
         Self::assert_last_global_event(converted_event)
     }
@@ -717,7 +717,7 @@ impl DecreaseWorkerStakeFixture {
         let stake_id = 0;
         let old_balance = Balances::free_balance(&self.account_id);
         let old_stake = <stake::Module<Test>>::stakes(stake_id);
-        let actual_result = Bureaucracy1::decrease_worker_stake(
+        let actual_result = WorkingGroup1::decrease_worker_stake(
             self.origin.clone().into(),
             self.worker_id,
             self.balance,
@@ -779,7 +779,7 @@ impl SlashWorkerStakeFixture {
         let stake_id = 0;
         let old_balance = Balances::free_balance(&self.account_id);
         let old_stake = <stake::Module<Test>>::stakes(stake_id);
-        let actual_result = Bureaucracy1::slash_worker_stake(
+        let actual_result = WorkingGroup1::slash_worker_stake(
             self.origin.clone().into(),
             self.worker_id,
             self.balance,

+ 3 - 3
runtime-modules/bureaucracy/src/tests/mock.rs → runtime-modules/working-group/src/tests/mock.rs

@@ -12,7 +12,7 @@ impl_outer_origin! {
         pub enum Origin for Test {}
 }
 
-mod bureaucracy {
+mod working_group {
     pub use crate::Event;
     pub use crate::Instance1;
 }
@@ -24,7 +24,7 @@ mod membership_mod {
 impl_outer_event! {
     pub enum TestEvent for Test {
         balances<T>,
-        bureaucracy Instance1 <T>,
+        working_group Instance1 <T>,
         membership_mod<T>,
     }
 }
@@ -129,7 +129,7 @@ impl Trait<Instance1> for Test {
 }
 
 pub type Membership = membership::members::Module<Test>;
-pub type Bureaucracy1 = Module<Test, Instance1>;
+pub type WorkingGroup1 = Module<Test, Instance1>;
 
 pub fn build_test_externalities() -> runtime_io::TestExternalities {
     let t = system::GenesisConfig::default()

+ 25 - 21
runtime-modules/bureaucracy/src/tests/mod.rs → runtime-modules/working-group/src/tests/mod.rs

@@ -5,7 +5,7 @@ use crate::tests::mock::Test;
 use crate::types::{OpeningPolicyCommitment, RewardPolicy};
 use crate::{Error, Instance1, Lead, RawEvent};
 use common::constraints::InputValidationLengthConstraint;
-use mock::{build_test_externalities, Bureaucracy1, TestEvent};
+use mock::{build_test_externalities, TestEvent, WorkingGroup1};
 use srml_support::{StorageLinkedMap, StorageValue};
 use std::collections::BTreeMap;
 use system::RawOrigin;
@@ -16,14 +16,14 @@ use fixtures::*;
 fn set_lead_succeeds() {
     build_test_externalities().execute_with(|| {
         // Ensure that lead is default
-        assert_eq!(Bureaucracy1::current_lead(), None);
+        assert_eq!(WorkingGroup1::current_lead(), None);
 
         let lead_account_id = 1;
         let lead_member_id = 1;
 
         // Set lead
         assert_eq!(
-            Bureaucracy1::set_lead(RawOrigin::Root.into(), lead_member_id, lead_account_id),
+            WorkingGroup1::set_lead(RawOrigin::Root.into(), lead_member_id, lead_account_id),
             Ok(())
         );
 
@@ -31,7 +31,7 @@ fn set_lead_succeeds() {
             member_id: lead_member_id,
             role_account_id: lead_account_id,
         };
-        assert_eq!(Bureaucracy1::current_lead(), Some(lead));
+        assert_eq!(WorkingGroup1::current_lead(), Some(lead));
 
         EventFixture::assert_crate_events(vec![RawEvent::LeaderSet(
             lead_member_id,
@@ -190,11 +190,11 @@ fn apply_on_worker_opening_succeeds() {
         appy_on_worker_opening_fixture.call_and_assert(Ok(()));
 
         EventFixture::assert_global_events(vec![
-            TestEvent::bureaucracy_Instance1(RawEvent::LeaderSet(1, lead_account_id)),
+            TestEvent::working_group_Instance1(RawEvent::LeaderSet(1, lead_account_id)),
             TestEvent::membership_mod(membership::members::RawEvent::MemberRegistered(0, 0)),
             TestEvent::membership_mod(membership::members::RawEvent::MemberRegistered(1, 1)),
-            TestEvent::bureaucracy_Instance1(RawEvent::WorkerOpeningAdded(opening_id)),
-            TestEvent::bureaucracy_Instance1(RawEvent::AppliedOnWorkerOpening(opening_id, 0)),
+            TestEvent::working_group_Instance1(RawEvent::WorkerOpeningAdded(opening_id)),
+            TestEvent::working_group_Instance1(RawEvent::AppliedOnWorkerOpening(opening_id, 0)),
         ]);
     });
 }
@@ -374,15 +374,17 @@ fn withdraw_worker_application_succeeds() {
         withdraw_application_fixture.call_and_assert(Ok(()));
 
         EventFixture::assert_global_events(vec![
-            TestEvent::bureaucracy_Instance1(RawEvent::LeaderSet(1, lead_account_id)),
+            TestEvent::working_group_Instance1(RawEvent::LeaderSet(1, lead_account_id)),
             TestEvent::membership_mod(membership::members::RawEvent::MemberRegistered(0, 0)),
             TestEvent::membership_mod(membership::members::RawEvent::MemberRegistered(1, 1)),
-            TestEvent::bureaucracy_Instance1(RawEvent::WorkerOpeningAdded(opening_id)),
-            TestEvent::bureaucracy_Instance1(RawEvent::AppliedOnWorkerOpening(
+            TestEvent::working_group_Instance1(RawEvent::WorkerOpeningAdded(opening_id)),
+            TestEvent::working_group_Instance1(RawEvent::AppliedOnWorkerOpening(
                 opening_id,
                 application_id,
             )),
-            TestEvent::bureaucracy_Instance1(RawEvent::WorkerApplicationWithdrawn(application_id)),
+            TestEvent::working_group_Instance1(RawEvent::WorkerApplicationWithdrawn(
+                application_id,
+            )),
         ]);
     });
 }
@@ -501,15 +503,17 @@ fn terminate_worker_application_succeeds() {
         terminate_application_fixture.call_and_assert(Ok(()));
 
         EventFixture::assert_global_events(vec![
-            TestEvent::bureaucracy_Instance1(RawEvent::LeaderSet(1, lead_account_id)),
+            TestEvent::working_group_Instance1(RawEvent::LeaderSet(1, lead_account_id)),
             TestEvent::membership_mod(membership::members::RawEvent::MemberRegistered(0, 0)),
             TestEvent::membership_mod(membership::members::RawEvent::MemberRegistered(1, 1)),
-            TestEvent::bureaucracy_Instance1(RawEvent::WorkerOpeningAdded(opening_id)),
-            TestEvent::bureaucracy_Instance1(RawEvent::AppliedOnWorkerOpening(
+            TestEvent::working_group_Instance1(RawEvent::WorkerOpeningAdded(opening_id)),
+            TestEvent::working_group_Instance1(RawEvent::AppliedOnWorkerOpening(
                 opening_id,
                 application_id,
             )),
-            TestEvent::bureaucracy_Instance1(RawEvent::WorkerApplicationTerminated(application_id)),
+            TestEvent::working_group_Instance1(RawEvent::WorkerApplicationTerminated(
+                application_id,
+            )),
         ]);
     });
 }
@@ -923,11 +927,11 @@ fn unset_lead_succeeds() {
             member_id: lead_member_id,
             role_account_id: lead_account_id,
         };
-        assert_eq!(Bureaucracy1::current_lead(), Some(lead));
+        assert_eq!(WorkingGroup1::current_lead(), Some(lead));
 
         UnsetLeadFixture::unset_lead();
 
-        assert_eq!(Bureaucracy1::current_lead(), None);
+        assert_eq!(WorkingGroup1::current_lead(), None);
 
         EventFixture::assert_crate_events(vec![
             RawEvent::LeaderSet(lead_member_id, lead_account_id),
@@ -1200,7 +1204,7 @@ fn leave_worker_role_fails_with_invalid_recurring_reward_relationships() {
     build_test_externalities().execute_with(|| {
         let worker_id = fill_default_worker_position();
 
-        let mut worker = Bureaucracy1::worker_by_id(worker_id);
+        let mut worker = WorkingGroup1::worker_by_id(worker_id);
         worker.reward_relationship = Some(2);
 
         <crate::WorkerById<Test, crate::Instance1>>::insert(worker_id, worker);
@@ -1532,7 +1536,7 @@ fn slash_worker_stake_fails_with_not_set_lead() {
 #[test]
 fn get_all_worker_ids_succeeds() {
     build_test_externalities().execute_with(|| {
-        let worker_ids = Bureaucracy1::get_all_worker_ids();
+        let worker_ids = WorkingGroup1::get_all_worker_ids();
         assert_eq!(worker_ids, Vec::new());
 
         let worker_id1 = fill_worker_position(None, None, true);
@@ -1541,12 +1545,12 @@ fn get_all_worker_ids_succeeds() {
         let mut expected_ids = vec![worker_id1, worker_id2];
         expected_ids.sort();
 
-        let mut worker_ids = Bureaucracy1::get_all_worker_ids();
+        let mut worker_ids = WorkingGroup1::get_all_worker_ids();
         worker_ids.sort();
         assert_eq!(worker_ids, expected_ids);
 
         <crate::WorkerById<Test, crate::Instance1>>::remove(worker_id1);
-        let worker_ids = Bureaucracy1::get_all_worker_ids();
+        let worker_ids = WorkingGroup1::get_all_worker_ids();
         assert_eq!(worker_ids, vec![worker_id2]);
     });
 }

+ 0 - 0
runtime-modules/bureaucracy/src/types.rs → runtime-modules/working-group/src/types.rs


+ 4 - 4
runtime/Cargo.toml

@@ -62,7 +62,7 @@ std = [
     'proposals_engine/std',
     'proposals_discussion/std',
     'proposals_codex/std',
-    'bureaucracy/std',
+    'working-group/std',
 ]
 
 # [dependencies]
@@ -376,8 +376,8 @@ package = 'substrate-proposals-codex-module'
 path = '../runtime-modules/proposals/codex'
 version = '2.0.0'
 
-[dependencies.bureaucracy]
+[dependencies.working-group]
 default_features = false
-package = 'substrate-bureaucracy-module'
-path = '../runtime-modules/bureaucracy'
+package = 'substrate-working-group-module'
+path = '../runtime-modules/working-group'
 version = '1.0.0'

+ 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::StorageBureaucracy::get_all_worker_ids();
+        let ids = crate::StorageWorkingGroup::get_all_worker_ids();
 
         let live_ids: Vec<ActorId> = ids
             .into_iter()

+ 8 - 8
runtime/src/lib.rs

@@ -746,7 +746,7 @@ impl forum::ForumUserRegistry<AccountId> for ShimMembershipRegistry {
 impl forum::Trait for Runtime {
     type Event = Event;
     type MembershipRegistry = ShimMembershipRegistry;
-    type EnsureForumLeader = bureaucracy::Module<Runtime, bureaucracy::Instance1>;
+    type EnsureForumLeader = working_group::Module<Runtime, working_group::Instance1>;
     type ThreadId = ThreadId;
     type PostId = PostId;
 }
@@ -755,13 +755,13 @@ impl migration::Trait for Runtime {
     type Event = Event;
 }
 
-// Forum bureaucracy
-impl bureaucracy::Trait<bureaucracy::Instance1> for Runtime {
+// Forum working group
+impl working_group::Trait<working_group::Instance1> for Runtime {
     type Event = Event;
 }
 
-// Storage working group bureaucracy
-impl bureaucracy::Trait<bureaucracy::Instance2> for Runtime {
+// Storage working group
+impl working_group::Trait<working_group::Instance2> for Runtime {
     type Event = Event;
 }
 
@@ -884,9 +884,9 @@ construct_runtime!(
         ProposalsEngine: proposals_engine::{Module, Call, Storage, Event<T>},
         ProposalsDiscussion: proposals_discussion::{Module, Call, Storage, Event<T>},
         ProposalsCodex: proposals_codex::{Module, Call, Storage, Error, Config<T>},
-        // --- Bureaucracy
-        ForumBureaucracy: bureaucracy::<Instance1>::{Module, Call, Storage, Event<T>},
-        StorageBureaucracy: bureaucracy::<Instance2>::{Module, Call, Storage, Event<T>},
+        // --- Working groups
+        ForumWorkingGroup: working_group::<Instance1>::{Module, Call, Storage, Event<T>},
+        StorageWorkingGroup: working_group::<Instance2>::{Module, Call, Storage, Event<T>},
     }
 );
 

+ 4 - 4
runtime/src/tests/storage_integration.rs

@@ -2,8 +2,8 @@ use super::initial_test_ext;
 use crate::integration::storage::StorageProviderHelper;
 use crate::Runtime;
 
-use bureaucracy::{Instance2, Worker};
 use srml_support::{StorageLinkedMap, StorageMap};
+use working_group::{Instance2, Worker};
 
 #[test]
 fn storage_provider_helper_succeeds() {
@@ -17,9 +17,9 @@ fn storage_provider_helper_succeeds() {
 		let worker_id2 = 7;
 		let worker_id3 = 19;
 
-		<bureaucracy::WorkerById<Runtime, Instance2>>::insert(worker_id1, Worker::default());
-		<bureaucracy::WorkerById<Runtime, Instance2>>::insert(worker_id2, Worker::default());
-		<bureaucracy::WorkerById<Runtime, Instance2>>::insert(worker_id3, Worker::default());
+		<working_group::WorkerById<Runtime, Instance2>>::insert(worker_id1, Worker::default());
+		<working_group::WorkerById<Runtime, Instance2>>::insert(worker_id2, Worker::default());
+		<working_group::WorkerById<Runtime, Instance2>>::insert(worker_id3, Worker::default());
 
 		// Still error - not registered in the service discovery.
 		let random_provider_result = <StorageProviderHelper as storage::data_directory::StorageProviderHelper<Runtime>>::get_random_storage_provider();