Browse Source

common refactoring: use WorkingGroup in AbstractStorageObjectOwner definition

iorveth 4 years ago
parent
commit
f4170d4c44

+ 2 - 9
runtime-modules/common/src/storage.rs

@@ -3,6 +3,7 @@ use codec::{Decode, Encode};
 use serde::{Deserialize, Serialize};
 use sp_runtime::DispatchResult;
 use sp_std::vec::Vec;
+use crate::working_group::WorkingGroup;
 
 #[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
 pub struct ContentParameters<ContentId, DataObjectTypeId> {
@@ -12,21 +13,13 @@ pub struct ContentParameters<ContentId, DataObjectTypeId> {
     pub ipfs_content_id: Vec<u8>,
 }
 
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
-#[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
-pub enum WorkinGroupType {
-    ContentDirectory,
-    Builders,
-    StorageProviders,
-}
-
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
 pub enum AbstractStorageObjectOwner<ChannelId, DAOId> {
     Channel(ChannelId), // acts through content directory module, where again DAOs can own channels for example
     DAO(DAOId),         // acts through upcoming `content_finance` module
     Council,            // acts through proposal system
-    WorkingGroup(WorkinGroupType), // acts through new extrinsic in working group
+    WorkingGroup(WorkingGroup), // acts through new extrinsic in working group
 }
 
 // New owner type for storage object struct

+ 2 - 1
runtime-modules/common/src/working_group.rs

@@ -6,7 +6,7 @@ use strum_macros::EnumIter;
 
 /// Defines well-known working groups.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize, EnumIter))]
-#[derive(Encode, Decode, Clone, PartialEq, Eq, Copy, Debug)]
+#[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
 pub enum WorkingGroup {
     /* Reserved
         /// Forum working group: working_group::Instance1.
@@ -16,4 +16,5 @@ pub enum WorkingGroup {
     Storage,
     /// Storage working group: working_group::Instance3.
     Content,
+    Builders,
 }