Bedeho Mender il y a 5 ans
Parent
commit
6d5cfa5606

+ 5 - 8
Cargo.toml

@@ -46,7 +46,7 @@ std = [
     'recurringrewards/std',
     'stake/std',
     'hiring/std',
-    'versioned-store-permissions/std'
+    'versioned_store_permissions/std'
 ]
 
 [dependencies.babe]
@@ -285,13 +285,10 @@ rev = 'eb4ef9711f1c375cc59f55b74b8a4e725335f4f0'
 default_features = false
 git = 'https://github.com/bedeho/substrate-hiring-module'
 package = 'substrate-hiring-module'
-rev = '0e12cee6e992ff664020be08c6264d0cde8227f8'
+rev = 'c030ae8305ef81e59934125c0927c92c4cb77ef9'
 
-[dependencies.versioned-store-permissions]
+[dependencies.versioned_store_permissions]
 default_features = false
-git = 'https://github.com/mnaamani/substrate-versioned-store-permissions-module'
+git = 'https://github.com/bedeho/substrate-versioned-store-permissions-module'
 package = 'substrate-versioned-store-permissions-module'
-rev = 'f2450af5f7f9a8989bc68b2ccbe42a462ccf93cd'
-
-
-
+rev = 'ddff0791de3774d10f79483f6609340fede35551'

+ 75 - 38
src/content-working-group/lib.rs → src/content_working_group/lib.rs

@@ -2,23 +2,15 @@
 #![cfg_attr(not(feature = "std"), no_std)]
 
 use rstd::prelude::*;
-use codec::{Codec, Decode, Encode};
-use runtime_primitives::traits::{MaybeSerializeDebug, Member, One, SimpleArithmetic};
-use srml_support::traits::Currency;
 use srml_support::{
-    decl_module, decl_storage, ensure, EnumerableStorageMap, Parameter, StorageMap, StorageValue,
+    decl_module, decl_storage, ensure, StorageMap, StorageValue,
 };
-use std::iter::Iterator;
-
-use rstd::collections::btree_map::BTreeMap;
+//use rstd::collections::btree_map::BTreeMap;
 use rstd::collections::btree_set::BTreeSet;
 
-mod types;
-mod macroes;
-mod mock;
-mod test;
+use versioned_store_permissions;
 
-pub use types;
+pub use super::types::{*};
 
 use system;
 
@@ -41,8 +33,10 @@ decl_storage! {
         /// Using map to model a set.
         pub Openings get(openings) config(): linked_map T::OpeningId => ();
 
+        pub ChannelById get(channel_by_id) config(): linked_map T::ChannelId => Channel<T::MemberId, T::AccountId, T::BlockNumber>;
+
         /// Maps identifier to corresponding curator.
-        pub CuratorById get(curator_by_id) config(): linked_map T::CuratorId => Curator<T>;
+        pub CuratorById get(curator_by_id) config(): linked_map T::CuratorId => Curator<T::AccountId, T::RewardRelationshipId, T::StakeId, T::BlockNumber, T::LeadId, T::ApplicationId>;
         
         /// Next identifier for new curator.
         pub NextCuratorId get(next_curator_id) config(): T::CuratorId;
@@ -61,7 +55,7 @@ decl_storage! {
         pub AnyMemberCredential get(any_member_credential) config(): AnyMemberCredential;
 
         /// Maps dynamic credential by
-        pub DynamicCredentialById get(dynamic_credential_by_id) config(): linked_map DynamicCredentialId => DynamicCredential<T::CuratorId, T::ChannelId>;
+        pub DynamicCredentialById get(dynamic_credential_by_id) config(): linked_map DynamicCredentialId => DynamicCredential<T::CuratorId, T::ChannelId, T::BlockNumber>;
 
         /// ...
         pub NextDynamicCredentialId get(next_dynamic_credential_id) config(): T::DynamicCredentialId;
@@ -118,14 +112,14 @@ decl_module! {
         fn deposit_event() = default;
 
         /// ...
-        pub fn create_channel(type: ChannelType, owner: Trait::MemberId) {
+        pub fn create_channel(origin, channel_type: ChannelType, owner: T::MemberId) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn transfer_channel_ownerhsip(channel_id: T::ChannelId) {
+        pub fn transfer_channel_ownerhsip(origin, channel_id: T::ChannelId) {
 
             // DONE
             Ok(())
@@ -136,112 +130,112 @@ decl_module! {
 
 
         /// ...
-        pub fn update_channel_as_owner() {
+        pub fn update_channel_as_owner(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn update_channel_as_curator() {
+        pub fn update_channel_as_curator(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ..
-        pub fn create_version_store_credential()  {
+        pub fn create_version_store_credential(origin)  {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn update_lead_role_account() {
+        pub fn update_lead_role_account(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn update_lead_reward_account()  {
+        pub fn update_lead_reward_account(origin)  {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn add_curator_opening()  {
+        pub fn add_curator_opening(origin)  {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn accept_curator_applications()  {
+        pub fn accept_curator_applications(origin)  {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn begin_curator_applicant_review() {
+        pub fn begin_curator_applicant_review(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn fill_curator_opening() {
+        pub fn fill_curator_opening(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn update_curator_reward() {
+        pub fn update_curator_reward(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn slash_curator() {
+        pub fn slash_curator(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn terminate_curator() {
+        pub fn terminate_curator(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn apply_on_curator_opening() {
+        pub fn apply_on_curator_opening(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn update_curator_role_account() {
+        pub fn update_curator_role_account(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn update_curator_reward_account() {
+        pub fn update_curator_reward_account(origin) {
 
             // DONE
             Ok(())
         }
 
         /// ...
-        pub fn exit_curator_role() {
+        pub fn exit_curator_role(origin) {
 
             // DONE
             Ok(())
@@ -280,24 +274,67 @@ impl<T: Trait> Module<T> {
  */
 
 /// ...
-enum Credential {
+enum Credential<CuratorId, ChannelId, BlockNumber> {
     Lead(LeadCredential),
     AnyCurator(AnyCuratorCredential),
-    AnyMember(AnyMemberCredential)
-    Dynamic(DynamicVersionedStoreCredential)
+    AnyMember(AnyMemberCredential),
+    Dynamic(DynamicCredential<CuratorId, ChannelId, BlockNumber>)
+}
+
+/// Holder of a credential.
+enum CredentialHolder<DynamicCredentialId> {
+
+    /// Built in credential holder.
+    BuiltInCredentialHolder(BuiltInCredentialHolder),
+
+    /// A possible dynamic credendtial holder.
+    CandidateDynamicCredentialId(DynamicCredentialId)
 }
 
 impl<T: Trait> Module<T> {
+
+    /// Maps a permission module credential identifier to a credential holder.
+    /// 
+    /// **CRITICAL**: 
+    /// 
+    /// Credential identifiers are stored in the permissions module, this means that
+    /// the mapping in this function _must_ not disturb how it maps any id that is actually in use
+    /// across runtime upgrades, _unless_ one is also prepared to make the corresponding migrations
+    /// in the permissions module. Best to keep mapping stable.
+    /// 
+    /// In practice the only way one may want augment this map is to support new
+    /// built in credentials. In this case, the mapping has to be written and deployed while
+    /// no new dynamic credentials are created, and a new case of the form below must be introcued
+    /// in the match: CandidateDynamicCredentialId(credential_id - X), where X = #ChannelIds mapped so far.
+    fn credential_id_to_holder(credential_id: T::PrincipalId) -> CredentialHolder<DynamicCredentialId<T>> {
+
+        // Credential identifiers for built in credential holder types.
+        let LEAD_CREDENTIAL_ID = T::PrincipalId::from(0);
+        let ANY_CURATOR_CREDENTIAL_ID = T::PrincipalId::from(1);
+        let ANY_MEMBER_CREDENTIAL_ID = T::PrincipalId::from(2);
+
+        match credential_id {
+
+            LEAD_CREDENTIAL_ID => CredentialHolder(BuiltInCredentialHolder(BuiltInCredentialHolder::Lead)),
+            ANY_CURATOR_CREDENTIAL_ID => CredentialHolder(BuiltInCredentialHolder(BuiltInCredentialHolder::AnyCurator)),
+            ANY_MEMBER_CREDENTIAL_ID => CredentialHolder(BuiltInCredentialHolder(BuiltInCredentialHolder::AnyMember)),
+            _ => CredentialHolder(CandidateDynamicCredentialId(credential_id - 3)) // will map first dynamic id to 0
+
+            /*
+            Add new built in credentials here below
+            */
+        }
+    }
     
     /// .
-    fn credential_from_id(credential_id: VersionedStorePermissions::Trait::CredentialId) -> Option<Credential> {
+    fn credential_from_id(credential_id: T::PrincipalId) -> Option<DynamicCredential<T::CuratorId, T::ChannelId, T::BlockNumber>> {
 
-        let  = credential_id_to_built_in_credential_holder(credential_id);
+        //let  = credential_id_to_built_in_credential_holder(credential_id);
 
         // 2. 
 
 
-
+        None
     }
     
 }

+ 0 - 0
src/content-working-group/macroes.rs → src/content_working_group/macroes.rs


+ 0 - 0
src/content-working-group/mock.rs → src/content_working_group/mock.rs


+ 5 - 0
src/content_working_group/mod.rs

@@ -0,0 +1,5 @@
+pub mod lib;
+pub mod types;
+
+mod mock;
+mod tests;

+ 0 - 0
src/content-working-group/test.rs → src/content_working_group/tests.rs


+ 94 - 60
src/content-working-group/types.rs → src/content_working_group/types.rs

@@ -1,15 +1,26 @@
-use codec::{Decode, Encode};
-use rstd::collections::btree_map::BTreeMap;
+use codec::{Codec, Decode, Encode};
+//use rstd::collections::btree_map::BTreeMap;
 use rstd::collections::btree_set::BTreeSet;
+use rstd::prelude::*;
+use srml_support::traits::Currency;
+use srml_support::{
+    decl_module, decl_storage, ensure, Parameter, StorageMap, StorageValue,
+};
+use runtime_primitives::traits::{Member, One, SimpleArithmetic, MaybeSerialize};
 
 use minting;
 use recurringrewards;
 use stake;
 use hiring;
-use versioned-store-permissions;
+use versioned_store_permissions;
+
+use super::super::membership::members as membership;
 
 /// Module configuration trait for this Substrate module.
-pub trait Trait: system::Trait + minting::Trait + RecurringReward::Trait + stake::Trait + Hiring::Trait + VersionedStorePermissions::Trait + Membership::Trait + Sized {
+pub trait Trait: system::Trait + minting::Trait + recurringrewards::Trait + stake::Trait + hiring::Trait + versioned_store_permissions::Trait + membership::Trait + Sized {
+
+    /// The event type.
+    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
 
     /// Type for identifier for lead.
     type LeadId: Parameter
@@ -18,7 +29,7 @@ pub trait Trait: system::Trait + minting::Trait + RecurringReward::Trait + stake
         + Codec
         + Default
         + Copy
-        + MaybeSerializeDebug
+        + MaybeSerialize
         + PartialEq;
 
     /// Type for identifier for curators.
@@ -28,7 +39,7 @@ pub trait Trait: system::Trait + minting::Trait + RecurringReward::Trait + stake
         + Codec
         + Default
         + Copy
-        + MaybeSerializeDebug
+        + MaybeSerialize
         + PartialEq;
 
     /// Type for identifier for channels.
@@ -38,12 +49,12 @@ pub trait Trait: system::Trait + minting::Trait + RecurringReward::Trait + stake
         + Codec
         + Default
         + Copy
-        + MaybeSerializeDebug
+        + MaybeSerialize
         + PartialEq;
 }
 
 /// Type for identifier for dynamic version store credential.
-pub type DynamicCredentialId = VersionedStorePermissions::Trait::CredentialId;
+pub type DynamicCredentialId<T: Trait> = T::PrincipalId;
 
 /// Balance type of runtime
 pub type BalanceOf<T> =
@@ -54,6 +65,7 @@ pub type NegativeImbalance<T> =
     <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
 
 /// The exit stage of a lead involvement in the working group.
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct ExitedLeadRole<BlockNumber> {
 
     /// When exit was initiated.
@@ -61,7 +73,7 @@ pub struct ExitedLeadRole<BlockNumber> {
 }
 
 /// The stage of the involvement of a lead in the working group.
-#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd, Ord)]
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum LeadRoleState<BlockNumber> {
 
     /// Currently active.
@@ -71,9 +83,19 @@ pub enum LeadRoleState<BlockNumber> {
     Exited(ExitedLeadRole<BlockNumber>)
 }
 
+/// Must be default constructible because it indirectly is a value in a storage map.
+/// ***SHOULD NEVER ACTUALLY GET CALLED, IS REQUIRED TO DUE BAD STORAGE MODEL IN SUBSTRATE***
+impl<BlockNumber> Default for LeadRoleState<BlockNumber> {
+
+    fn default() -> Self {
+        LeadRoleState::Active
+    }
+}
+
 /// Working group lead: curator lead
 /// For now this role is not staked or inducted through an structured process, like the hiring module,
 /// hence information about this is missing. Recurring rewards is included, somewhat arbitrarily!
+#[derive(Encode, Decode, Default, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct Lead<AccountId, RewardRelationshipId, BlockNumber> {
 
     /// Account used to authenticate in this role,
@@ -91,7 +113,7 @@ pub struct Lead<AccountId, RewardRelationshipId, BlockNumber> {
 }
 
 /// Origin of exit initiation on behalf of a curator.'
-#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd, Ord)]
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum CuratorExitInitiationOrigin {
 
     /// Lead is origin.
@@ -102,6 +124,7 @@ pub enum CuratorExitInitiationOrigin {
 }
 
 /// The exit stage of a curators involvement in the working group.
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct ExitedCuratorRoleStage<BlockNumber> {
 
     /// Origin for exit.
@@ -115,7 +138,7 @@ pub struct ExitedCuratorRoleStage<BlockNumber> {
 }
 
 /// The stage of the involvement of a curator in the working group.
-#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd, Ord)]
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum CuratorRoleStage<BlockNumber> {
 
     /// Currently active.
@@ -125,7 +148,17 @@ pub enum CuratorRoleStage<BlockNumber> {
     Exited(ExitedCuratorRoleStage<BlockNumber>)
 }
 
+/// Must be default constructible because it indirectly is a value in a storage map.
+/// ***SHOULD NEVER ACTUALLY GET CALLED, IS REQUIRED TO DUE BAD STORAGE MODEL IN SUBSTRATE***
+impl<BlockNumber> Default for CuratorRoleStage<BlockNumber> {
+
+    fn default() -> Self {
+        CuratorRoleStage::Active
+    }
+}
+
 /// The induction of a curator in the working group.
+#[derive(Encode, Decode, Default, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct CuratorInduction<LeadId, ApplicationId, BlockNumber> {
 
     /// Lead responsible
@@ -140,8 +173,8 @@ pub struct CuratorInduction<LeadId, ApplicationId, BlockNumber> {
 
 /// Working group participant: curator
 /// This role can be staked, have reward and be inducted through the hiring module.
-#[derive(Encode, Decode, Default, Debug, Eq, PartialEq, Clone, PartialOrd, Ord)]
-pub struct Curator<AccountId, RewardRelationshipId, StakeId> {
+#[derive(Encode, Decode, Default, Debug, Eq, PartialEq, Clone, PartialOrd)]
+pub struct Curator<AccountId, RewardRelationshipId, StakeId, BlockNumber, LeadId, ApplicationId> {
 
     /// Account used to authenticate in this role,
     pub role_account: AccountId,
@@ -156,19 +189,30 @@ pub struct Curator<AccountId, RewardRelationshipId, StakeId> {
     pub stage: CuratorRoleStage<BlockNumber>,
 
     /// How the curator was inducted into the working group.
-    pub induction: CuratorInduction<T>
+    pub induction: CuratorInduction<LeadId, ApplicationId, BlockNumber>
 }
 
 /// Type of channel content.
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum ChannelContentType {
     Video,
     Music,
     Ebook
 }
 
+/// Must be default constructible because it indirectly is a value in a storage map.
+/// ***SHOULD NEVER ACTUALLY GET CALLED, IS REQUIRED TO DUE BAD STORAGE MODEL IN SUBSTRATE***
+impl Default for ChannelContentType {
+
+    fn default() -> Self {
+        ChannelContentType::Video
+    }
+}
+
 /// Status of channel, as set by the owner.
 /// Is only meant to affect visibility, mutation of channel and child content
 /// is unaffected on runtime.
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum ChannelPublishingStatus {
 
     /// Compliant UIs should render.
@@ -178,17 +222,37 @@ pub enum ChannelPublishingStatus {
     NotPublished
 }
 
+/// Must be default constructible because it indirectly is a value in a storage map.
+/// ***SHOULD NEVER ACTUALLY GET CALLED, IS REQUIRED TO DUE BAD STORAGE MODEL IN SUBSTRATE***
+impl Default for ChannelPublishingStatus {
+
+    fn default() -> Self {
+        ChannelPublishingStatus::Published
+    }
+}
+
 /// Status of channel, as set by curators.
 /// Is only meant to affect visibility currently, but in the future
 /// it will also gate publication of new child content,
 /// editing properties, revenue flows, etc. 
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum ChannelCurationStatus {
     Normal,
     Censored
 }
 
+/// Must be default constructible because it indirectly is a value in a storage map.
+/// ***SHOULD NEVER ACTUALLY GET CALLED, IS REQUIRED TO DUE BAD STORAGE MODEL IN SUBSTRATE***
+impl Default for ChannelCurationStatus {
+
+    fn default() -> Self {
+        ChannelCurationStatus::Normal
+    }
+}
+
 /// A channel for publishing content.
-pub struct Channel<BlockNumber> {
+#[derive(Encode, Decode, Default, Debug, Eq, PartialEq, Clone, PartialOrd)]
+pub struct Channel<MemberId, AccountId, BlockNumber> {
 
     /// Unique human readble channel handle.
     pub handle: Vec<u8>, 
@@ -203,7 +267,7 @@ pub struct Channel<BlockNumber> {
     pub content: ChannelContentType,
 
     /// Member who owns channel.
-    pub owner: Trait::MemberId,
+    pub owner: MemberId,
 
     /// Account used to authenticate as owner.
     /// Can be updated through membership role key.
@@ -221,6 +285,7 @@ pub struct Channel<BlockNumber> {
 }
 
 /// The types of built in credential holders.
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum BuiltInCredentialHolder {
 
     /// Cyrrent working group lead.
@@ -233,13 +298,8 @@ pub enum BuiltInCredentialHolder {
     AnyMember
 }
 
-/// Credential identifiers for built in credential holder types.
-pub static LEAD_CREDENTIAL_ID: VersionedStorePermissions::Trait::CredentialId = VersionedStorePermissions::Trait::CredentialId::from(0);
-pub static ANY_CURATOR_CREDENTIAL_ID: VersionedStorePermissions::Trait::CredentialId = VersionedStorePermissions::Trait::CredentialId::from(1);
-pub static ANY_MEMBER_CREDENTIAL_ID: VersionedStorePermissions::Trait::CredentialId = VersionedStorePermissions::Trait::CredentialId::from(2);
-
 /// Holder of dynamic credential.
-#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd, Ord)]
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub enum DynamicCredentialHolder<CuratorId, ChannelId> {
 
     /// Sets of curators.
@@ -249,45 +309,17 @@ pub enum DynamicCredentialHolder<CuratorId, ChannelId> {
     ChannelOwner(ChannelId),
 }
 
-/// Holder of a credential.
-enum CredentialHolder {
-
-    /// Built in credential holder.
-    BuiltInCredentialHolder(BuiltInCredentialHolder),
+/// Must be default constructible because it indirectly is a value in a storage map.
+/// ***SHOULD NEVER ACTUALLY GET CALLED, IS REQUIRED TO DUE BAD STORAGE MODEL IN SUBSTRATE***
+impl<CuratorId, ChannelId> Default for DynamicCredentialHolder<CuratorId, ChannelId> {
 
-    /// A possible dynamic credendtial holder.
-    CandidateDynamicCredentialId(DynamicCredentialId)
-}
-
-/// Maps a permission module credential identifier to a credential holder.
-/// 
-/// **CRITICAL**: 
-/// 
-/// Credential identifiers are stored in the permissions module, this means that
-/// the mapping in this function _must_ not disturb how it maps any id that is actually in use
-/// across runtime upgrades, _unless_ one is also prepared to make the corresponding migrations
-/// in the permissions module. Best to keep mapping stable.
-/// 
-/// In practice the only way one may want augment this map is to support new
-/// built in credentials. In this case, the mapping has to be written and deployed while
-/// no new dynamic credentials are created, and a new case of the form below must be introcued
-/// in the match: CandidateDynamicCredentialId(credential_id - X), where X = #ChannelIds mapped so far.
-fn credential_id_to_holder(credential_id: VersionedStorePermissions::Trait::CredentialId) -> CredentialHolder {
-
-    match credential_id {
-
-        LEAD_CREDENTIAL_ID: BuiltInCredentialHolder(BuiltInCredentialHolder::Lead),
-        ANY_CURATOR_CREDENTIAL_ID: BuiltInCredentialHolder(BuiltInCredentialHolder::AnyCurator),
-        ANY_MEMBER_CREDENTIAL_ID: BuiltInCredentialHolder(BuiltInCredentialHolder::AnyMember),
-        _ => CandidateDynamicCredentialId(credential_id - 3) // will map first dynamic id to 0
-
-        /*
-         Add new built in credentials here below
-        */
+    fn default() -> Self {
+        DynamicCredentialHolder::Curators(BTreeSet::new())
     }
 }
 
 /// Represents credential for authenticating as "the current lead".
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct LeadCredential {
 
     /// Whether it is currently possible to authenticate with this credential.
@@ -295,6 +327,7 @@ pub struct LeadCredential {
 }
 
 /// Represents credential for authenticating as "any curator".
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct AnyCuratorCredential {
 
     /// Whether it is currently possible to authenticate with this credential.
@@ -302,6 +335,7 @@ pub struct AnyCuratorCredential {
 }
 
 /// Represents credential for authenticating as "any member".
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct AnyMemberCredential {
 
     /// Whether it is currently possible to authenticate with this credential.
@@ -311,7 +345,7 @@ pub struct AnyMemberCredential {
 /// Represents credential to be referenced from the version store.
 /// It is dynamic in the sense that these can be created on the fly.
 #[derive(Encode, Decode, Default, Debug, Eq, PartialEq, Clone, PartialOrd)]
-pub struct DynamicCredential<CuratorId, ChannelId> {
+pub struct DynamicCredential<CuratorId, ChannelId, BlockNumber> {
 
     /// Who holds this credential, meaning they can successfully authenticate with this credential.
     pub holder: DynamicCredentialHolder<CuratorId, ChannelId>,
@@ -320,7 +354,7 @@ pub struct DynamicCredential<CuratorId, ChannelId> {
     pub is_active: bool,
 
     /// When it was created.
-    pub created: T::BlockNumber,
+    pub created: BlockNumber,
 
     /// Human readable description of credential.
     pub description: Vec<u8>
@@ -329,7 +363,7 @@ pub struct DynamicCredential<CuratorId, ChannelId> {
 /// Policy governing any curator opening which can be made by lead.
 /// Be aware that all limits are forward looking in constrainign future extrinsics or method calls.
 /// Updating them has no side-effects beyond changing the limit.
-#[derive(Encode, Decode, Default, Debug, Eq, PartialEq, Clone, PartialOrd)]
+#[derive(Encode, Decode, Debug, Eq, PartialEq, Clone, PartialOrd)]
 pub struct OpeningPolicy<BlockNumber, StakingPolicy> {
 
     /// Limits the total number of curators which can be active, or possibly active through an active opening. 
@@ -337,7 +371,7 @@ pub struct OpeningPolicy<BlockNumber, StakingPolicy> {
     /// A limit of N is counted as there being N actual active curators, as a worst case bound.
     /// The absence of a limit is counted as "infinity", thus blocking any further openings from being created,
     /// and is is not possible to actually hire a number of curators that would bring the number above this parameter `curator_limit`.
-    pub curator_limit: Option<u16>
+    pub curator_limit: Option<u16>,
 
     /// Maximum length of review period of applications
     pub max_review_period_length: BlockNumber,

+ 3 - 0
src/lib.rs

@@ -401,12 +401,15 @@ mod traits;
 pub use forum;
 use membership::members;
 
+mod content_working_group;
+
 mod migration;
 mod roles;
 mod service_discovery;
 use roles::actors;
 use service_discovery::discovery;
 
+
 /// Alias for ContentId, used in various places.
 pub type ContentId = primitives::H256;