Browse Source

renamed Post -> VideoPost to avoid runtime-modules/forum conflicts

ignazio 3 years ago
parent
commit
426bbc885f

+ 1 - 1
node/src/chain_spec/mod.rs

@@ -365,7 +365,7 @@ pub fn testnet_genesis(
                 next_playlist_id: 1,
                 next_playlist_id: 1,
                 next_series_id: 1,
                 next_series_id: 1,
                 next_person_id: 1,
                 next_person_id: 1,
-                next_post_id: 1,
+                next_video_post_id: 1,
                 next_channel_transfer_request_id: 1,
                 next_channel_transfer_request_id: 1,
                 video_migration: node_runtime::content::MigrationConfigRecord {
                 video_migration: node_runtime::content::MigrationConfigRecord {
                     current_id: 1,
                     current_id: 1,

+ 3 - 3
runtime-modules/content/src/errors.rs

@@ -79,8 +79,8 @@ decl_error! {
         /// Bag Size specified is not valid
         /// Bag Size specified is not valid
         InvalidBagSizeSpecified,
         InvalidBagSizeSpecified,
 
 
-        /// Post does not exists
-        PostDoesNotExist,
+        /// VideoPost does not exists
+        VideoPostDoesNotExist,
 
 
         /// Migration not done yet
         /// Migration not done yet
         MigrationNotFinished,
         MigrationNotFinished,
@@ -95,7 +95,7 @@ decl_error! {
         ModeratorsLimitReached,
         ModeratorsLimitReached,
 
 
         /// cannot edit video post
         /// cannot edit video post
-        CannotEditVideoPost,
+        CannotEditDescription,
 
 
         /// failed witness verification
         /// failed witness verification
         WitnessVerificationFailed,
         WitnessVerificationFailed,

+ 85 - 81
runtime-modules/content/src/lib.rs

@@ -186,10 +186,10 @@ pub trait Trait:
     /// The storage type used
     /// The storage type used
     type DataObjectStorage: storage::DataObjectStorage<Self>;
     type DataObjectStorage: storage::DataObjectStorage<Self>;
 
 
-    /// Type of PostId
-    type PostId: NumericIdentifier;
+    /// Type of VideoPostId
+    type VideoPostId: NumericIdentifier;
 
 
-    /// Type of PostId
+    /// Type of VideoPostId
     type ReactionId: NumericIdentifier;
     type ReactionId: NumericIdentifier;
 
 
     /// Max Number of moderators
     /// Max Number of moderators
@@ -456,7 +456,7 @@ type VideoUpdateParameters<T> = VideoUpdateParametersRecord<StorageAssets<T>, Da
 /// A video which belongs to a channel. A video may be part of a series or playlist.
 /// A video which belongs to a channel. A video may be part of a series or playlist.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct VideoRecord<ChannelId, SeriesId, PostId> {
+pub struct VideoRecord<ChannelId, SeriesId, VideoPostId> {
     pub in_channel: ChannelId,
     pub in_channel: ChannelId,
 
 
     pub in_series: Option<SeriesId>,
     pub in_series: Option<SeriesId>,
@@ -468,11 +468,14 @@ pub struct VideoRecord<ChannelId, SeriesId, PostId> {
     pub enable_comments: bool,
     pub enable_comments: bool,
 
 
     /// First post to a video works as a description
     /// First post to a video works as a description
-    pub video_post_id: Option<PostId>,
+    pub video_post_id: Option<VideoPostId>,
 }
 }
 
 
-pub type Video<T> =
-    VideoRecord<<T as storage::Trait>::ChannelId, <T as Trait>::SeriesId, <T as Trait>::PostId>;
+pub type Video<T> = VideoRecord<
+    <T as storage::Trait>::ChannelId,
+    <T as Trait>::SeriesId,
+    <T as Trait>::VideoPostId,
+>;
 
 
 /// Information about the plyalist being created.
 /// Information about the plyalist being created.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
@@ -609,10 +612,10 @@ pub struct Person<MemberId> {
 }
 }
 
 
 type DataObjectId<T> = <T as storage::Trait>::DataObjectId;
 type DataObjectId<T> = <T as storage::Trait>::DataObjectId;
-/// A Post associated to a video
+/// A VideoPost associated to a video
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct PostRecord<ContentActor, Balance, PostId, PostType, VideoId> {
+pub struct VideoPostRecord<ContentActor, Balance, VideoPostId, VideoPostType, VideoId> {
     /// Author of post.
     /// Author of post.
     pub author: ContentActor,
     pub author: ContentActor,
 
 
@@ -620,46 +623,46 @@ pub struct PostRecord<ContentActor, Balance, PostId, PostType, VideoId> {
     pub bloat_bond: Balance,
     pub bloat_bond: Balance,
 
 
     /// Overall replies counter
     /// Overall replies counter
-    pub replies_count: PostId,
+    pub replies_count: VideoPostId,
 
 
     /// video associated to the post (instead of the body hash as in the blog module)
     /// video associated to the post (instead of the body hash as in the blog module)
-    pub post_type: PostType,
+    pub post_type: VideoPostType,
 
 
     /// video reference
     /// video reference
     pub video_reference: VideoId,
     pub video_reference: VideoId,
 }
 }
 
 
-/// alias for Post
-pub type Post<T> = PostRecord<
+/// alias for VideoPost
+pub type VideoPost<T> = VideoPostRecord<
     ContentActor<
     ContentActor<
         <T as ContentActorAuthenticator>::CuratorGroupId,
         <T as ContentActorAuthenticator>::CuratorGroupId,
         <T as ContentActorAuthenticator>::CuratorId,
         <T as ContentActorAuthenticator>::CuratorId,
         <T as MembershipTypes>::MemberId,
         <T as MembershipTypes>::MemberId,
     >,
     >,
     BalanceOf<T>,
     BalanceOf<T>,
-    <T as Trait>::PostId,
-    PostType<T>,
+    <T as Trait>::VideoPostId,
+    VideoPostType<T>,
     <T as Trait>::VideoId,
     <T as Trait>::VideoId,
 >;
 >;
 
 
-/// Post type structured as linked list with the video post as beginning
+/// VideoPost type structured as linked list with the video post as beginning
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
 #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
-pub enum PostTypeRecord<ParentPostId> {
+pub enum VideoPostTypeRecord<ParentVideoPostId> {
     /// Equivalent to a video description
     /// Equivalent to a video description
-    VideoPost,
+    Description,
 
 
     /// Comment to a post with specified id
     /// Comment to a post with specified id
-    Comment(ParentPostId),
+    Comment(ParentVideoPostId),
 }
 }
 
 
-impl<ParentPostId> Default for PostTypeRecord<ParentPostId> {
+impl<ParentVideoPostId> Default for VideoPostTypeRecord<ParentVideoPostId> {
     fn default() -> Self {
     fn default() -> Self {
-        PostTypeRecord::<ParentPostId>::VideoPost
+        VideoPostTypeRecord::<ParentVideoPostId>::Description
     }
     }
 }
 }
 
 
-pub type PostType<T> = PostTypeRecord<<T as Trait>::PostId>;
+pub type VideoPostType<T> = VideoPostTypeRecord<<T as Trait>::VideoPostId>;
 
 
 /// Side used to construct hash values during merkle proof verification
 /// Side used to construct hash values during merkle proof verification
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
@@ -695,7 +698,7 @@ pub type ProofElement<T> = ProofElementRecord<<T as frame_system::Trait>::Hash,
 pub enum CleanupActor {
 pub enum CleanupActor {
     ChannelOwner,
     ChannelOwner,
     Moderator,
     Moderator,
-    PostAuthor,
+    VideoPostAuthor,
 }
 }
 
 
 impl Default for CleanupActor {
 impl Default for CleanupActor {
@@ -707,28 +710,29 @@ impl Default for CleanupActor {
 /// Information on the post being created
 /// Information on the post being created
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct PostCreationParametersRecord<PostType, VideoId> {
+pub struct VideoPostCreationParametersRecord<VideoPostType, VideoId> {
     /// content
     /// content
-    post_type: PostType,
+    post_type: VideoPostType,
 
 
     /// video reference
     /// video reference
     video_reference: VideoId,
     video_reference: VideoId,
 }
 }
 
 
-pub type PostCreationParameters<T> =
-    PostCreationParametersRecord<PostType<T>, <T as Trait>::VideoId>;
+pub type VideoPostCreationParameters<T> =
+    VideoPostCreationParametersRecord<VideoPostType<T>, <T as Trait>::VideoId>;
 
 
 /// Information on the post being deleted
 /// Information on the post being deleted
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
-pub struct PostDeletionParametersRecord<HashOutput> {
+pub struct VideoPostDeletionParametersRecord<HashOutput> {
     /// optional witnesses in case of video post deletion
     /// optional witnesses in case of video post deletion
     witness: Option<HashOutput>,
     witness: Option<HashOutput>,
     /// rationale in case actor is moderator
     /// rationale in case actor is moderator
     rationale: Option<Vec<u8>>,
     rationale: Option<Vec<u8>>,
 }
 }
 
 
-pub type PostDeletionParameters<T> = PostDeletionParametersRecord<<T as frame_system::Trait>::Hash>;
+pub type VideoPostDeletionParameters<T> =
+    VideoPostDeletionParametersRecord<<T as frame_system::Trait>::Hash>;
 
 
 /// Payment claim by a channel
 /// Payment claim by a channel
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
@@ -787,13 +791,10 @@ decl_storage! {
         pub CuratorGroupById get(fn curator_group_by_id):
         pub CuratorGroupById get(fn curator_group_by_id):
         map hasher(blake2_128_concat) T::CuratorGroupId => CuratorGroup<T>;
         map hasher(blake2_128_concat) T::CuratorGroupId => CuratorGroup<T>;
 
 
-        pub PostById get(fn post_by_id) : double_map hasher(blake2_128_concat) T::VideoId,
-        hasher(blake2_128_concat) T::PostId => Post<T>;
-
-        pub NextPostId get(fn next_post_id) config(): T::PostId;
+        pub VideoPostById get(fn video_post_by_id) : double_map hasher(blake2_128_concat) T::VideoId,
+        hasher(blake2_128_concat) T::VideoPostId => VideoPost<T>;
 
 
-        pub VideoPostIdByVideoId get(fn video_post_by_video_id): map hasher(blake2_128_concat)
-            T::VideoId => T::PostId;
+        pub NextVideoPostId get(fn next_video_post_id) config(): T::VideoPostId;
 
 
         pub ChannelMigration get(fn channel_migration) config(): ChannelMigrationConfig<T>;
         pub ChannelMigration get(fn channel_migration) config(): ChannelMigrationConfig<T>;
 
 
@@ -1475,7 +1476,7 @@ decl_module! {
             VideoById::<T>::remove(video_id);
             VideoById::<T>::remove(video_id);
 
 
             // Remove all comments related
             // Remove all comments related
-            <PostById<T>>::remove_prefix(video_id);
+            <VideoPostById<T>>::remove_prefix(video_id);
 
 
             // Update corresponding channel
             // Update corresponding channel
             // Remove recently deleted video from the channel
             // Remove recently deleted video from the channel
@@ -1712,7 +1713,7 @@ decl_module! {
         pub fn create_post(
         pub fn create_post(
             origin,
             origin,
             actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
             actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            params: PostCreationParameters<T>,
+            params: VideoPostCreationParameters<T>,
         ) -> DispatchResult {
         ) -> DispatchResult {
 
 
             let sender = ensure_signed(origin.clone())?;
             let sender = ensure_signed(origin.clone())?;
@@ -1722,12 +1723,12 @@ decl_module! {
             let owner = ChannelById::<T>::get(video.in_channel).owner;
             let owner = ChannelById::<T>::get(video.in_channel).owner;
 
 
             match params.post_type {
             match params.post_type {
-                PostType::<T>::Comment(parent_id) => {
+                VideoPostType::<T>::Comment(parent_id) => {
                     ensure!(video.enable_comments, Error::<T>::CommentsDisabled);
                     ensure!(video.enable_comments, Error::<T>::CommentsDisabled);
                     Self::ensure_post_exists( params.video_reference, parent_id).map(|_| ())?;
                     Self::ensure_post_exists( params.video_reference, parent_id).map(|_| ())?;
                     ensure_actor_authorized_to_add_comment::<T>(&sender, &actor)?
                     ensure_actor_authorized_to_add_comment::<T>(&sender, &actor)?
                 },
                 },
-                PostType::<T>::VideoPost => ensure_actor_authorized_to_add_video_post::<T>(
+                VideoPostType::<T>::Description => ensure_actor_authorized_to_add_video_post::<T>(
                     &sender,
                     &sender,
                     &actor,
                     &actor,
                     &owner
                     &owner
@@ -1735,12 +1736,12 @@ decl_module! {
             };
             };
 
 
             let initial_bloat_bond = Self::compute_initial_bloat_bond();
             let initial_bloat_bond = Self::compute_initial_bloat_bond();
-            let post_id = <NextPostId<T>>::get();
+            let post_id = <NextVideoPostId<T>>::get();
 
 
-            let post = Post::<T> {
+            let post = VideoPost::<T> {
                 author: actor,
                 author: actor,
                 bloat_bond: initial_bloat_bond,
                 bloat_bond: initial_bloat_bond,
-                replies_count: T::PostId::zero(),
+                replies_count: T::VideoPostId::zero(),
                 video_reference: params.video_reference.clone(),
                 video_reference: params.video_reference.clone(),
                 post_type: params.post_type.clone(),
                 post_type: params.post_type.clone(),
             };
             };
@@ -1755,22 +1756,22 @@ decl_module! {
 
 
             <ContentTreasury<T>>::deposit(&sender, initial_bloat_bond.clone())?;
             <ContentTreasury<T>>::deposit(&sender, initial_bloat_bond.clone())?;
 
 
-            <NextPostId<T>>::mutate(|x| *x = x.saturating_add(One::one()));
-            <PostById<T>>::insert(&params.video_reference, &post_id, post.clone());
+            <NextVideoPostId<T>>::mutate(|x| *x = x.saturating_add(One::one()));
+            <VideoPostById<T>>::insert(&params.video_reference, &post_id, post.clone());
 
 
             // increment replies count in the parent post
             // increment replies count in the parent post
             match params.post_type {
             match params.post_type {
-                PostType::<T>::Comment(parent_id) => <PostById<T>>::mutate(
+                VideoPostType::<T>::Comment(parent_id) => <VideoPostById<T>>::mutate(
                     &params.video_reference,
                     &params.video_reference,
                     parent_id,
                     parent_id,
                     |x| x.replies_count = x.replies_count.saturating_add(One::one())),
                     |x| x.replies_count = x.replies_count.saturating_add(One::one())),
-                PostType::<T>::VideoPost => VideoById::<T>::mutate(
+                VideoPostType::<T>::Description => VideoById::<T>::mutate(
                     &params.video_reference,
                     &params.video_reference,
                     |video| video.video_post_id = Some(post_id.clone())),
                     |video| video.video_post_id = Some(post_id.clone())),
             };
             };
 
 
             // deposit event
             // deposit event
-            Self::deposit_event(RawEvent::PostCreated(post, post_id));
+            Self::deposit_event(RawEvent::VideoPostCreated(post, post_id));
 
 
             Ok(())
             Ok(())
         }
         }
@@ -1779,7 +1780,7 @@ decl_module! {
         pub fn edit_post_text(
         pub fn edit_post_text(
             origin,
             origin,
             video_id: T::VideoId,
             video_id: T::VideoId,
-            post_id: T::PostId,
+            post_id: T::VideoPostId,
             actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
             actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
             new_text: Vec<u8>,
             new_text: Vec<u8>,
         ) {
         ) {
@@ -1789,12 +1790,12 @@ decl_module! {
             let channel = ChannelById::<T>::get(video.in_channel);
             let channel = ChannelById::<T>::get(video.in_channel);
 
 
             match post.post_type {
             match post.post_type {
-                PostType::<T>::VideoPost => ensure_actor_authorized_to_edit_video_post::<T>(
+                VideoPostType::<T>::Description => ensure_actor_authorized_to_edit_video_post::<T>(
                     &sender,
                     &sender,
                     &actor,
                     &actor,
                     &channel.owner
                     &channel.owner
                 )?,
                 )?,
-                PostType::<T>::Comment(_) => ensure_actor_authorized_to_edit_comment::<T>(
+                VideoPostType::<T>::Comment(_) => ensure_actor_authorized_to_edit_comment::<T>(
                     &sender,
                     &sender,
                     &actor,
                     &actor,
                     &post
                     &post
@@ -1802,16 +1803,16 @@ decl_module! {
             };
             };
 
 
             // deposit event
             // deposit event
-            Self::deposit_event(RawEvent::PostTextUpdated(actor, new_text, post_id, video_id));
+            Self::deposit_event(RawEvent::VideoPostTextUpdated(actor, new_text, post_id, video_id));
         }
         }
 
 
         #[weight = 10_000_000] // TODO: adjust weight
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn delete_post(
         pub fn delete_post(
             origin,
             origin,
-            post_id: T::PostId,
+            post_id: T::VideoPostId,
             video_id: T::VideoId,
             video_id: T::VideoId,
             actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
             actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            params: PostDeletionParameters<T>,
+            params: VideoPostDeletionParameters<T>,
         ) {
         ) {
             let sender = ensure_signed(origin.clone())?;
             let sender = ensure_signed(origin.clone())?;
             let post = Self::ensure_post_exists(video_id, post_id)?;
             let post = Self::ensure_post_exists(video_id, post_id)?;
@@ -1819,15 +1820,15 @@ decl_module! {
             let channel = ChannelById::<T>::get(video.in_channel);
             let channel = ChannelById::<T>::get(video.in_channel);
 
 
             let cleanup_actor = match post.post_type {
             let cleanup_actor = match post.post_type {
-                PostType::<T>::VideoPost => {
+                VideoPostType::<T>::Description => {
                     Self::ensure_witness_verification(
                     Self::ensure_witness_verification(
                         params.witness,
                         params.witness,
                         post.replies_count,
                         post.replies_count,
                     )?;
                     )?;
                     ensure_actor_authorized_to_remove_video_post::<T>(&sender, &actor, &channel)?;
                     ensure_actor_authorized_to_remove_video_post::<T>(&sender, &actor, &channel)?;
-                    CleanupActor::PostAuthor
+                    CleanupActor::VideoPostAuthor
                 },
                 },
-                PostType::<T>::Comment(_) => {
+                VideoPostType::<T>::Comment(_) => {
                     let cleanup_actor = ensure_actor_authorized_to_remove_comment::<T>(
                     let cleanup_actor = ensure_actor_authorized_to_remove_comment::<T>(
                         &sender,
                         &sender,
                         &actor,
                         &actor,
@@ -1856,24 +1857,24 @@ decl_module! {
             Self::refund(&sender, cleanup_actor, post.bloat_bond.clone())?;
             Self::refund(&sender, cleanup_actor, post.bloat_bond.clone())?;
 
 
             match post.post_type {
             match post.post_type {
-                PostType::<T>::Comment(parent_id) => {
-                    PostById::<T>::remove(&video_id, &post_id);
+                VideoPostType::<T>::Comment(parent_id) => {
+                    VideoPostById::<T>::remove(&video_id, &post_id);
                     // parent post might have been already deleted
                     // parent post might have been already deleted
                     if let Ok(mut parent_post) = Self::ensure_post_exists(
                     if let Ok(mut parent_post) = Self::ensure_post_exists(
                         video_id.clone(),
                         video_id.clone(),
                         parent_id.clone(),
                         parent_id.clone(),
                     ){
                     ){
                         parent_post.replies_count =
                         parent_post.replies_count =
-                            parent_post.replies_count.saturating_sub(T::PostId::one());
-                        PostById::<T>::insert(&video_id, &parent_id, parent_post);
+                            parent_post.replies_count.saturating_sub(T::VideoPostId::one());
+                        VideoPostById::<T>::insert(&video_id, &parent_id, parent_post);
                     }
                     }
                 }
                 }
-                PostType::<T>::VideoPost => PostById::<T>::remove_prefix(&video_id),
+                VideoPostType::<T>::Description => VideoPostById::<T>::remove_prefix(&video_id),
             }
             }
 
 
             // deposit event
             // deposit event
             Self::deposit_event(
             Self::deposit_event(
-                RawEvent::PostDeleted(
+                RawEvent::VideoPostDeleted(
                     post,
                     post,
                     post_id,
                     post_id,
                     actor,
                     actor,
@@ -1885,7 +1886,7 @@ decl_module! {
             origin,
             origin,
             member_id: T::MemberId,
             member_id: T::MemberId,
             video_id: T::VideoId,
             video_id: T::VideoId,
-            post_id: T::PostId,
+            post_id: T::VideoPostId,
             reaction_id: T::ReactionId,
             reaction_id: T::ReactionId,
         ) {
         ) {
             // post existence verification purposely avoided
             // post existence verification purposely avoided
@@ -1896,7 +1897,7 @@ decl_module! {
             // == MUTATION_SAFE ==
             // == MUTATION_SAFE ==
             //
             //
 
 
-            Self::deposit_event(RawEvent::ReactionToPost(member_id, video_id, post_id, reaction_id));
+            Self::deposit_event(RawEvent::ReactionToVideoPost(member_id, video_id, post_id, reaction_id));
         }
         }
 
 
         #[weight = 10_000_000] // TODO: adjust weight
         #[weight = 10_000_000] // TODO: adjust weight
@@ -2171,12 +2172,15 @@ impl<T: Trait> Module<T> {
         Ok(VideoCategoryById::<T>::get(video_category_id))
         Ok(VideoCategoryById::<T>::get(video_category_id))
     }
     }
 
 
-    fn ensure_post_exists(video_id: T::VideoId, post_id: T::PostId) -> Result<Post<T>, Error<T>> {
+    fn ensure_post_exists(
+        video_id: T::VideoId,
+        post_id: T::VideoPostId,
+    ) -> Result<VideoPost<T>, Error<T>> {
         ensure!(
         ensure!(
-            PostById::<T>::contains_key(video_id, post_id),
-            Error::<T>::PostDoesNotExist
+            VideoPostById::<T>::contains_key(video_id, post_id),
+            Error::<T>::VideoPostDoesNotExist
         );
         );
-        Ok(PostById::<T>::get(video_id, post_id))
+        Ok(VideoPostById::<T>::get(video_id, post_id))
     }
     }
 
 
     fn not_implemented() -> DispatchResult {
     fn not_implemented() -> DispatchResult {
@@ -2189,7 +2193,7 @@ impl<T: Trait> Module<T> {
         bloat_bond: <T as balances::Trait>::Balance,
         bloat_bond: <T as balances::Trait>::Balance,
     ) -> DispatchResult {
     ) -> DispatchResult {
         match cleanup_actor {
         match cleanup_actor {
-            CleanupActor::PostAuthor => {
+            CleanupActor::VideoPostAuthor => {
                 let cap = <T as balances::Trait>::Balance::from(T::BloatBondCap::get());
                 let cap = <T as balances::Trait>::Balance::from(T::BloatBondCap::get());
 
 
                 if bloat_bond > cap {
                 if bloat_bond > cap {
@@ -2216,16 +2220,16 @@ impl<T: Trait> Module<T> {
     fn video_deletion_refund_logic(
     fn video_deletion_refund_logic(
         sender: &T::AccountId,
         sender: &T::AccountId,
         video_id: &T::VideoId,
         video_id: &T::VideoId,
-        video_post_id: &T::PostId,
+        video_post_id: &T::VideoPostId,
     ) -> DispatchResult {
     ) -> DispatchResult {
-        let bloat_bond = <PostById<T>>::get(video_id, video_post_id).bloat_bond;
-        Self::refund(&sender, CleanupActor::PostAuthor, bloat_bond)?;
+        let bloat_bond = <VideoPostById<T>>::get(video_id, video_post_id).bloat_bond;
+        Self::refund(&sender, CleanupActor::VideoPostAuthor, bloat_bond)?;
         Ok(())
         Ok(())
     }
     }
 
 
     fn compute_initial_bloat_bond() -> BalanceOf<T> {
     fn compute_initial_bloat_bond() -> BalanceOf<T> {
         let storage_price =
         let storage_price =
-            T::PricePerByte::get().saturating_mul((size_of::<Post<T>>() as u32).into());
+            T::PricePerByte::get().saturating_mul((size_of::<VideoPost<T>>() as u32).into());
 
 
         let cleanup_cost = T::CleanupCost::get().saturating_add(T::CleanupMargin::get());
         let cleanup_cost = T::CleanupCost::get().saturating_add(T::CleanupMargin::get());
 
 
@@ -2235,7 +2239,7 @@ impl<T: Trait> Module<T> {
     // If we are trying to delete a video post we need witness verification
     // If we are trying to delete a video post we need witness verification
     fn ensure_witness_verification(
     fn ensure_witness_verification(
         witness: Option<<T as frame_system::Trait>::Hash>,
         witness: Option<<T as frame_system::Trait>::Hash>,
-        replies_count: T::PostId,
+        replies_count: T::VideoPostId,
     ) -> DispatchResult {
     ) -> DispatchResult {
         let wit_hash = witness.ok_or(Error::<T>::WitnessNotProvided)?;
         let wit_hash = witness.ok_or(Error::<T>::WitnessNotProvided)?;
         ensure!(
         ensure!(
@@ -2320,8 +2324,8 @@ decl_event!(
         VideoCreationParameters = VideoCreationParameters<T>,
         VideoCreationParameters = VideoCreationParameters<T>,
         VideoUpdateParameters = VideoUpdateParameters<T>,
         VideoUpdateParameters = VideoUpdateParameters<T>,
         StorageAssets = StorageAssets<T>,
         StorageAssets = StorageAssets<T>,
-        Post = Post<T>,
-        PostId = <T as Trait>::PostId,
+        VideoPost = VideoPost<T>,
+        VideoPostId = <T as Trait>::VideoPostId,
         MemberId = <T as MembershipTypes>::MemberId,
         MemberId = <T as MembershipTypes>::MemberId,
         ReactionId = <T as Trait>::ReactionId,
         ReactionId = <T as Trait>::ReactionId,
         ModeratorSet = BTreeSet<<T as MembershipTypes>::MemberId>,
         ModeratorSet = BTreeSet<<T as MembershipTypes>::MemberId>,
@@ -2429,11 +2433,11 @@ decl_event!(
         PersonDeleted(ContentActor, PersonId),
         PersonDeleted(ContentActor, PersonId),
         ChannelDeleted(ContentActor, ChannelId),
         ChannelDeleted(ContentActor, ChannelId),
 
 
-        // Posts & Replies
-        PostCreated(Post, PostId),
-        PostTextUpdated(ContentActor, Vec<u8>, PostId, VideoId),
-        PostDeleted(Post, PostId, ContentActor),
-        ReactionToPost(MemberId, VideoId, PostId, ReactionId),
+        // VideoPosts & Replies
+        VideoPostCreated(VideoPost, VideoPostId),
+        VideoPostTextUpdated(ContentActor, Vec<u8>, VideoPostId, VideoId),
+        VideoPostDeleted(VideoPost, VideoPostId, ContentActor),
+        ReactionToVideoPost(MemberId, VideoId, VideoPostId, ReactionId),
         ReactionToVideo(MemberId, VideoId, ReactionId),
         ReactionToVideo(MemberId, VideoId, ReactionId),
         ModeratorSetUpdated(ChannelId, ModeratorSet),
         ModeratorSetUpdated(ChannelId, ModeratorSet),
 
 

+ 4 - 4
runtime-modules/content/src/permissions/mod.rs

@@ -338,7 +338,7 @@ pub fn ensure_actor_authorized_to_edit_video_post<T: Trait>(
 pub fn ensure_actor_authorized_to_edit_comment<T: Trait>(
 pub fn ensure_actor_authorized_to_edit_comment<T: Trait>(
     sender: &T::AccountId,
     sender: &T::AccountId,
     actor: &ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
     actor: &ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-    post: &Post<T>,
+    post: &VideoPost<T>,
 ) -> DispatchResult {
 ) -> DispatchResult {
     ensure_actor_auth_success::<T>(sender, actor)?;
     ensure_actor_auth_success::<T>(sender, actor)?;
     ensure_actor_is_comment_author::<T>(actor, &post.author)
     ensure_actor_is_comment_author::<T>(actor, &post.author)
@@ -349,13 +349,13 @@ pub fn ensure_actor_authorized_to_remove_comment<T: Trait>(
     sender: &T::AccountId,
     sender: &T::AccountId,
     actor: &ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
     actor: &ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
     channel: &Channel<T>,
     channel: &Channel<T>,
-    post: &Post<T>,
+    post: &VideoPost<T>,
 ) -> Result<CleanupActor, DispatchError> {
 ) -> Result<CleanupActor, DispatchError> {
     ensure_actor_auth_success::<T>(sender, actor)?;
     ensure_actor_auth_success::<T>(sender, actor)?;
     let actor_is_owner = ensure_actor_is_channel_owner::<T>(actor, &channel.owner)
     let actor_is_owner = ensure_actor_is_channel_owner::<T>(actor, &channel.owner)
         .map(|_| CleanupActor::ChannelOwner);
         .map(|_| CleanupActor::ChannelOwner);
-    let actor_is_author =
-        ensure_actor_is_comment_author::<T>(actor, &post.author).map(|_| CleanupActor::PostAuthor);
+    let actor_is_author = ensure_actor_is_comment_author::<T>(actor, &post.author)
+        .map(|_| CleanupActor::VideoPostAuthor);
     let actor_is_moderator =
     let actor_is_moderator =
         ensure_actor_is_moderator::<T>(actor, &channel.moderators).map(|_| CleanupActor::Moderator);
         ensure_actor_is_moderator::<T>(actor, &channel.moderators).map(|_| CleanupActor::Moderator);
 
 

+ 59 - 53
runtime-modules/content/src/tests/fixtures.rs

@@ -697,7 +697,7 @@ impl DeleteChannelFixture {
 pub struct CreatePostFixture {
 pub struct CreatePostFixture {
     sender: AccountId,
     sender: AccountId,
     actor: ContentActor<CuratorGroupId, CuratorId, MemberId>,
     actor: ContentActor<CuratorGroupId, CuratorId, MemberId>,
-    params: PostCreationParameters<Test>,
+    params: VideoPostCreationParameters<Test>,
 }
 }
 
 
 impl CreatePostFixture {
 impl CreatePostFixture {
@@ -705,8 +705,8 @@ impl CreatePostFixture {
         Self {
         Self {
             sender: DEFAULT_MEMBER_ACCOUNT_ID,
             sender: DEFAULT_MEMBER_ACCOUNT_ID,
             actor: ContentActor::Member(DEFAULT_MEMBER_ID),
             actor: ContentActor::Member(DEFAULT_MEMBER_ID),
-            params: PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::VideoPost,
+            params: VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Description,
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             },
             },
         }
         }
@@ -720,21 +720,21 @@ impl CreatePostFixture {
         Self { actor, ..self }
         Self { actor, ..self }
     }
     }
 
 
-    pub fn with_params(self, params: PostCreationParameters<Test>) -> Self {
+    pub fn with_params(self, params: VideoPostCreationParameters<Test>) -> Self {
         Self { params, ..self }
         Self { params, ..self }
     }
     }
 
 
     pub fn call_and_assert(&self, expected_result: DispatchResult) {
     pub fn call_and_assert(&self, expected_result: DispatchResult) {
         let origin = Origin::signed(self.sender.clone());
         let origin = Origin::signed(self.sender.clone());
         let initial_bloat_bond = Content::compute_initial_bloat_bond();
         let initial_bloat_bond = Content::compute_initial_bloat_bond();
-        let post_id = Content::next_post_id();
+        let post_id = Content::next_video_post_id();
         let balance_pre = Balances::<Test>::usable_balance(&self.sender);
         let balance_pre = Balances::<Test>::usable_balance(&self.sender);
         let replies_count_pre = match &self.params.post_type {
         let replies_count_pre = match &self.params.post_type {
-            PostType::<Test>::Comment(parent_id) => {
+            VideoPostType::<Test>::Comment(parent_id) => {
                 Content::ensure_post_exists(self.params.video_reference, parent_id.clone())
                 Content::ensure_post_exists(self.params.video_reference, parent_id.clone())
-                    .map_or(PostId::zero(), |p| p.replies_count)
+                    .map_or(VideoPostId::zero(), |p| p.replies_count)
             }
             }
-            PostType::<Test>::VideoPost => PostId::zero(),
+            VideoPostType::<Test>::Description => VideoPostId::zero(),
         };
         };
         let video_pre = Content::video_by_id(&self.params.video_reference);
         let video_pre = Content::video_by_id(&self.params.video_reference);
 
 
@@ -742,11 +742,11 @@ impl CreatePostFixture {
 
 
         let balance_post = Balances::<Test>::usable_balance(&self.sender);
         let balance_post = Balances::<Test>::usable_balance(&self.sender);
         let replies_count_post = match &self.params.post_type {
         let replies_count_post = match &self.params.post_type {
-            PostType::<Test>::Comment(parent_id) => {
+            VideoPostType::<Test>::Comment(parent_id) => {
                 Content::ensure_post_exists(self.params.video_reference, *parent_id)
                 Content::ensure_post_exists(self.params.video_reference, *parent_id)
-                    .map_or(PostId::zero(), |p| p.replies_count)
+                    .map_or(VideoPostId::zero(), |p| p.replies_count)
             }
             }
-            PostType::<Test>::VideoPost => PostId::zero(),
+            VideoPostType::<Test>::Description => VideoPostId::zero(),
         };
         };
         let video_post = Content::video_by_id(&self.params.video_reference);
         let video_post = Content::video_by_id(&self.params.video_reference);
 
 
@@ -754,12 +754,15 @@ impl CreatePostFixture {
 
 
         if actual_result.is_ok() {
         if actual_result.is_ok() {
             assert_eq!(balance_pre, initial_bloat_bond.saturating_add(balance_post));
             assert_eq!(balance_pre, initial_bloat_bond.saturating_add(balance_post));
-            assert_eq!(post_id.saturating_add(One::one()), Content::next_post_id());
+            assert_eq!(
+                post_id.saturating_add(One::one()),
+                Content::next_video_post_id()
+            );
             match &self.params.post_type {
             match &self.params.post_type {
-                PostType::<Test>::VideoPost => {
+                VideoPostType::<Test>::Description => {
                     assert_eq!(Some(post_id), video_post.video_post_id);
                     assert_eq!(Some(post_id), video_post.video_post_id);
                 }
                 }
-                PostType::<Test>::Comment(_) => {
+                VideoPostType::<Test>::Comment(_) => {
                     assert_eq!(
                     assert_eq!(
                         replies_count_post,
                         replies_count_post,
                         replies_count_pre.saturating_add(One::one())
                         replies_count_pre.saturating_add(One::one())
@@ -769,11 +772,11 @@ impl CreatePostFixture {
 
 
             assert_eq!(
             assert_eq!(
                 System::events().last().unwrap().event,
                 System::events().last().unwrap().event,
-                MetaEvent::content(RawEvent::PostCreated(
-                    Post::<Test> {
+                MetaEvent::content(RawEvent::VideoPostCreated(
+                    VideoPost::<Test> {
                         author: self.actor.clone(),
                         author: self.actor.clone(),
                         bloat_bond: initial_bloat_bond,
                         bloat_bond: initial_bloat_bond,
-                        replies_count: PostId::zero(),
+                        replies_count: VideoPostId::zero(),
                         video_reference: self.params.video_reference,
                         video_reference: self.params.video_reference,
                         post_type: self.params.post_type.clone(),
                         post_type: self.params.post_type.clone(),
                     },
                     },
@@ -782,12 +785,12 @@ impl CreatePostFixture {
             );
             );
         } else {
         } else {
             assert_eq!(balance_pre, balance_post);
             assert_eq!(balance_pre, balance_post);
-            assert_eq!(post_id, Content::next_post_id());
+            assert_eq!(post_id, Content::next_video_post_id());
             match &self.params.post_type {
             match &self.params.post_type {
-                PostType::<Test>::VideoPost => {
+                VideoPostType::<Test>::Description => {
                     assert_eq!(video_pre, video_post);
                     assert_eq!(video_pre, video_post);
                 }
                 }
-                PostType::<Test>::Comment(_) => {
+                VideoPostType::<Test>::Comment(_) => {
                     assert_eq!(replies_count_post, replies_count_pre);
                     assert_eq!(replies_count_post, replies_count_pre);
                 }
                 }
             }
             }
@@ -798,7 +801,7 @@ impl CreatePostFixture {
 pub struct EditPostTextFixture {
 pub struct EditPostTextFixture {
     sender: AccountId,
     sender: AccountId,
     video_id: VideoId,
     video_id: VideoId,
-    post_id: PostId,
+    post_id: VideoPostId,
     actor: ContentActor<CuratorGroupId, CuratorId, MemberId>,
     actor: ContentActor<CuratorGroupId, CuratorId, MemberId>,
     new_text: Vec<u8>,
     new_text: Vec<u8>,
 }
 }
@@ -808,7 +811,7 @@ impl EditPostTextFixture {
         Self {
         Self {
             sender: DEFAULT_MEMBER_ACCOUNT_ID,
             sender: DEFAULT_MEMBER_ACCOUNT_ID,
             video_id: VideoId::one(),
             video_id: VideoId::one(),
-            post_id: PostId::one(),
+            post_id: VideoPostId::one(),
             actor: ContentActor::Member(DEFAULT_MEMBER_ID),
             actor: ContentActor::Member(DEFAULT_MEMBER_ID),
             new_text: b"sample text".to_vec(),
             new_text: b"sample text".to_vec(),
         }
         }
@@ -818,7 +821,7 @@ impl EditPostTextFixture {
         Self { sender, ..self }
         Self { sender, ..self }
     }
     }
 
 
-    pub fn with_post_id(self, post_id: PostId) -> Self {
+    pub fn with_post_id(self, post_id: VideoPostId) -> Self {
         Self { post_id, ..self }
         Self { post_id, ..self }
     }
     }
 
 
@@ -845,7 +848,7 @@ impl EditPostTextFixture {
         if actual_result.is_ok() {
         if actual_result.is_ok() {
             assert_eq!(
             assert_eq!(
                 System::events().last().unwrap().event,
                 System::events().last().unwrap().event,
-                MetaEvent::content(RawEvent::PostTextUpdated(
+                MetaEvent::content(RawEvent::VideoPostTextUpdated(
                     self.actor,
                     self.actor,
                     self.new_text.clone(),
                     self.new_text.clone(),
                     self.post_id,
                     self.post_id,
@@ -858,21 +861,21 @@ impl EditPostTextFixture {
 
 
 pub struct DeletePostFixture {
 pub struct DeletePostFixture {
     sender: AccountId,
     sender: AccountId,
-    post_id: PostId,
+    post_id: VideoPostId,
     video_id: VideoId,
     video_id: VideoId,
     actor: ContentActor<CuratorGroupId, CuratorId, MemberId>,
     actor: ContentActor<CuratorGroupId, CuratorId, MemberId>,
-    params: PostDeletionParameters<Test>,
+    params: VideoPostDeletionParameters<Test>,
 }
 }
 
 
 impl DeletePostFixture {
 impl DeletePostFixture {
     pub fn default() -> Self {
     pub fn default() -> Self {
         Self {
         Self {
             sender: DEFAULT_MEMBER_ACCOUNT_ID,
             sender: DEFAULT_MEMBER_ACCOUNT_ID,
-            post_id: PostId::one(),
+            post_id: VideoPostId::one(),
             video_id: VideoId::one(),
             video_id: VideoId::one(),
             actor: ContentActor::Member(DEFAULT_MEMBER_ID),
             actor: ContentActor::Member(DEFAULT_MEMBER_ID),
-            params: PostDeletionParameters::<Test> {
-                witness: Some(Hashing::hash_of(&PostId::zero())),
+            params: VideoPostDeletionParameters::<Test> {
+                witness: Some(Hashing::hash_of(&VideoPostId::zero())),
                 rationale: Some(b"rationale".to_vec()),
                 rationale: Some(b"rationale".to_vec()),
             },
             },
         }
         }
@@ -882,7 +885,7 @@ impl DeletePostFixture {
         Self { sender, ..self }
         Self { sender, ..self }
     }
     }
 
 
-    pub fn with_post_id(self, post_id: PostId) -> Self {
+    pub fn with_post_id(self, post_id: VideoPostId) -> Self {
         Self { post_id, ..self }
         Self { post_id, ..self }
     }
     }
 
 
@@ -890,7 +893,7 @@ impl DeletePostFixture {
         Self { actor, ..self }
         Self { actor, ..self }
     }
     }
 
 
-    pub fn with_params(self, params: PostDeletionParameters<Test>) -> Self {
+    pub fn with_params(self, params: VideoPostDeletionParameters<Test>) -> Self {
         Self { params, ..self }
         Self { params, ..self }
     }
     }
 
 
@@ -898,14 +901,14 @@ impl DeletePostFixture {
         let origin = Origin::signed(self.sender);
         let origin = Origin::signed(self.sender);
         let balance_pre = Balances::<Test>::usable_balance(&self.sender);
         let balance_pre = Balances::<Test>::usable_balance(&self.sender);
         let initial_bloat_bond = Content::compute_initial_bloat_bond();
         let initial_bloat_bond = Content::compute_initial_bloat_bond();
-        let post = Content::post_by_id(&self.video_id, &self.post_id);
-        let thread_size = PostById::<Test>::iter_prefix(&self.video_id).count();
+        let post = Content::video_post_by_id(&self.video_id, &self.post_id);
+        let thread_size = VideoPostById::<Test>::iter_prefix(&self.video_id).count();
         let replies_count_pre = match &post.post_type {
         let replies_count_pre = match &post.post_type {
-            PostType::<Test>::Comment(parent_id) => {
+            VideoPostType::<Test>::Comment(parent_id) => {
                 Content::ensure_post_exists(self.video_id, *parent_id)
                 Content::ensure_post_exists(self.video_id, *parent_id)
-                    .map_or(PostId::zero(), |p| p.replies_count)
+                    .map_or(VideoPostId::zero(), |p| p.replies_count)
             }
             }
-            PostType::<Test>::VideoPost => PostId::zero(),
+            VideoPostType::<Test>::Description => VideoPostId::zero(),
         };
         };
 
 
         let actual_result = Content::delete_post(
         let actual_result = Content::delete_post(
@@ -929,43 +932,46 @@ impl DeletePostFixture {
                 } else {
                 } else {
                     assert_eq!(balance_post, balance_pre)
                     assert_eq!(balance_post, balance_pre)
                 };
                 };
-                assert!(!PostById::<Test>::contains_key(
+                assert!(!VideoPostById::<Test>::contains_key(
                     &self.video_id,
                     &self.video_id,
                     &self.post_id
                     &self.post_id
                 ));
                 ));
                 match &post.post_type {
                 match &post.post_type {
-                    PostType::<Test>::VideoPost => assert_eq!(
-                        PostById::<Test>::iter_prefix(&self.video_id).count(),
+                    VideoPostType::<Test>::Description => assert_eq!(
+                        VideoPostById::<Test>::iter_prefix(&self.video_id).count(),
                         0usize,
                         0usize,
                     ),
                     ),
-                    PostType::<Test>::Comment(parent_id) => {
+                    VideoPostType::<Test>::Comment(parent_id) => {
                         let replies_count_post =
                         let replies_count_post =
                             Content::ensure_post_exists(self.video_id, *parent_id)
                             Content::ensure_post_exists(self.video_id, *parent_id)
-                                .map_or(PostId::zero(), |p| p.replies_count);
+                                .map_or(VideoPostId::zero(), |p| p.replies_count);
                         assert_eq!(
                         assert_eq!(
                             replies_count_pre,
                             replies_count_pre,
-                            replies_count_post.saturating_add(PostId::one())
+                            replies_count_post.saturating_add(VideoPostId::one())
                         )
                         )
                     }
                     }
                 };
                 };
                 assert_eq!(
                 assert_eq!(
                     System::events().last().unwrap().event,
                     System::events().last().unwrap().event,
-                    MetaEvent::content(RawEvent::PostDeleted(post, self.post_id, self.actor))
+                    MetaEvent::content(RawEvent::VideoPostDeleted(post, self.post_id, self.actor))
                 );
                 );
             }
             }
             Err(err) => {
             Err(err) => {
                 assert_eq!(balance_pre, balance_post);
                 assert_eq!(balance_pre, balance_post);
-                if err != Error::<Test>::PostDoesNotExist.into() {
-                    assert_eq!(Content::post_by_id(&self.video_id, &self.post_id), post);
+                if err != Error::<Test>::VideoPostDoesNotExist.into() {
+                    assert_eq!(
+                        Content::video_post_by_id(&self.video_id, &self.post_id),
+                        post
+                    );
                     match &post.post_type {
                     match &post.post_type {
-                        PostType::<Test>::Comment(parent_id) => {
+                        VideoPostType::<Test>::Comment(parent_id) => {
                             let replies_count_post =
                             let replies_count_post =
                                 Content::ensure_post_exists(self.video_id, *parent_id)
                                 Content::ensure_post_exists(self.video_id, *parent_id)
-                                    .map_or(PostId::zero(), |p| p.replies_count);
+                                    .map_or(VideoPostId::zero(), |p| p.replies_count);
                             assert_eq!(replies_count_pre, replies_count_post);
                             assert_eq!(replies_count_pre, replies_count_post);
                         }
                         }
-                        PostType::<Test>::VideoPost => assert_eq!(
-                            PostById::<Test>::iter_prefix(&self.video_id).count(),
+                        VideoPostType::<Test>::Description => assert_eq!(
+                            VideoPostById::<Test>::iter_prefix(&self.video_id).count(),
                             thread_size,
                             thread_size,
                         ),
                         ),
                     }
                     }
@@ -1503,8 +1509,8 @@ pub fn create_default_curator_owned_channel_with_video_and_post() {
 pub fn create_default_member_owned_channel_with_video_and_comment() {
 pub fn create_default_member_owned_channel_with_video_and_comment() {
     create_default_member_owned_channel_with_video_and_post();
     create_default_member_owned_channel_with_video_and_post();
     CreatePostFixture::default()
     CreatePostFixture::default()
-        .with_params(PostCreationParameters::<Test> {
-            post_type: PostType::<Test>::Comment(PostId::one()),
+        .with_params(VideoPostCreationParameters::<Test> {
+            post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
             video_reference: VideoId::one(),
             video_reference: VideoId::one(),
         })
         })
         .call_and_assert(Ok(()));
         .call_and_assert(Ok(()));
@@ -1519,8 +1525,8 @@ pub fn create_default_curator_owned_channel_with_video_and_comment() {
             default_curator_group_id,
             default_curator_group_id,
             DEFAULT_CURATOR_ID,
             DEFAULT_CURATOR_ID,
         ))
         ))
-        .with_params(PostCreationParameters::<Test> {
-            post_type: PostType::<Test>::Comment(PostId::one()),
+        .with_params(VideoPostCreationParameters::<Test> {
+            post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
             video_reference: VideoId::one(),
             video_reference: VideoId::one(),
         })
         })
         .call_and_assert(Ok(()));
         .call_and_assert(Ok(()));

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

@@ -25,7 +25,7 @@ pub type HashOutput = <Test as frame_system::Trait>::Hash;
 pub type Hashing = <Test as frame_system::Trait>::Hashing;
 pub type Hashing = <Test as frame_system::Trait>::Hashing;
 pub type AccountId = <Test as frame_system::Trait>::AccountId;
 pub type AccountId = <Test as frame_system::Trait>::AccountId;
 pub type VideoId = <Test as Trait>::VideoId;
 pub type VideoId = <Test as Trait>::VideoId;
-pub type PostId = <Test as Trait>::PostId;
+pub type VideoPostId = <Test as Trait>::VideoPostId;
 pub type CuratorId = <Test as ContentActorAuthenticator>::CuratorId;
 pub type CuratorId = <Test as ContentActorAuthenticator>::CuratorId;
 pub type CuratorGroupId = <Test as ContentActorAuthenticator>::CuratorGroupId;
 pub type CuratorGroupId = <Test as ContentActorAuthenticator>::CuratorGroupId;
 pub type MemberId = <Test as MembershipTypes>::MemberId;
 pub type MemberId = <Test as MembershipTypes>::MemberId;
@@ -456,10 +456,10 @@ impl Trait for Test {
     /// The data object used in storage
     /// The data object used in storage
     type DataObjectStorage = storage::Module<Self>;
     type DataObjectStorage = storage::Module<Self>;
 
 
-    /// PostId Type
-    type PostId = u64;
+    /// VideoPostId Type
+    type VideoPostId = u64;
 
 
-    /// Post Reaction Type
+    /// VideoPost Reaction Type
     type ReactionId = u64;
     type ReactionId = u64;
 
 
     /// moderators limit
     /// moderators limit
@@ -496,7 +496,7 @@ pub struct ExtBuilder {
     next_series_id: u64,
     next_series_id: u64,
     next_channel_transfer_request_id: u64,
     next_channel_transfer_request_id: u64,
     next_curator_group_id: u64,
     next_curator_group_id: u64,
-    next_post_id: u64,
+    next_video_post_id: u64,
     video_migration: VideoMigrationConfig<Test>,
     video_migration: VideoMigrationConfig<Test>,
     channel_migration: ChannelMigrationConfig<Test>,
     channel_migration: ChannelMigrationConfig<Test>,
     max_reward_allowed: BalanceOf<Test>,
     max_reward_allowed: BalanceOf<Test>,
@@ -516,7 +516,7 @@ impl Default for ExtBuilder {
             next_series_id: 1,
             next_series_id: 1,
             next_channel_transfer_request_id: 1,
             next_channel_transfer_request_id: 1,
             next_curator_group_id: 1,
             next_curator_group_id: 1,
-            next_post_id: 1,
+            next_video_post_id: 1,
             video_migration: MigrationConfigRecord {
             video_migration: MigrationConfigRecord {
                 current_id: 1,
                 current_id: 1,
                 final_id: 1,
                 final_id: 1,
@@ -548,7 +548,7 @@ impl ExtBuilder {
             next_series_id: self.next_series_id,
             next_series_id: self.next_series_id,
             next_channel_transfer_request_id: self.next_channel_transfer_request_id,
             next_channel_transfer_request_id: self.next_channel_transfer_request_id,
             next_curator_group_id: self.next_curator_group_id,
             next_curator_group_id: self.next_curator_group_id,
-            next_post_id: self.next_post_id,
+            next_video_post_id: self.next_video_post_id,
             video_migration: self.video_migration,
             video_migration: self.video_migration,
             channel_migration: self.channel_migration,
             channel_migration: self.channel_migration,
             max_reward_allowed: self.max_reward_allowed,
             max_reward_allowed: self.max_reward_allowed,

+ 68 - 68
runtime-modules/content/src/tests/posts.rs

@@ -135,8 +135,8 @@ pub fn unsuccessful_post_creation_with_invalid_video_id() {
         create_default_member_owned_channel_with_video();
         create_default_member_owned_channel_with_video();
 
 
         CreatePostFixture::default()
         CreatePostFixture::default()
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::VideoPost,
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Description,
                 video_reference: VideoId::zero(),
                 video_reference: VideoId::zero(),
             })
             })
             .call_and_assert(Err(Error::<Test>::VideoDoesNotExist.into()))
             .call_and_assert(Err(Error::<Test>::VideoDoesNotExist.into()))
@@ -152,11 +152,11 @@ pub fn unsuccessful_comment_creation_with_invalid_parent_id() {
         create_default_member_owned_channel_with_video_and_post();
         create_default_member_owned_channel_with_video_and_post();
 
 
         CreatePostFixture::default()
         CreatePostFixture::default()
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::zero()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::zero()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
-            .call_and_assert(Err(Error::<Test>::PostDoesNotExist.into()))
+            .call_and_assert(Err(Error::<Test>::VideoPostDoesNotExist.into()))
     })
     })
 }
 }
 
 
@@ -207,8 +207,8 @@ pub fn successful_comment_creation_by_member() {
 
 
         println!("POST CREATED");
         println!("POST CREATED");
         CreatePostFixture::default()
         CreatePostFixture::default()
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()))
             .call_and_assert(Ok(()))
@@ -234,8 +234,8 @@ pub fn successful_comment_creation_by_curator() {
                 default_curator_group_id,
                 default_curator_group_id,
                 DEFAULT_CURATOR_ID,
                 DEFAULT_CURATOR_ID,
             ))
             ))
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()))
             .call_and_assert(Ok(()))
@@ -257,8 +257,8 @@ pub fn successful_comment_creation_by_lead() {
         CreatePostFixture::default()
         CreatePostFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()))
             .call_and_assert(Ok(()))
@@ -314,8 +314,8 @@ pub fn unsuccessful_post_update_with_lead_auth_failed() {
         CreatePostFixture::default()
         CreatePostFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()));
             .call_and_assert(Ok(()));
@@ -323,7 +323,7 @@ pub fn unsuccessful_post_update_with_lead_auth_failed() {
         EditPostTextFixture::default()
         EditPostTextFixture::default()
             .with_sender(UNAUTHORIZED_LEAD_ACCOUNT_ID)
             .with_sender(UNAUTHORIZED_LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::LeadAuthFailed.into()))
             .call_and_assert(Err(Error::<Test>::LeadAuthFailed.into()))
     })
     })
 }
 }
@@ -338,8 +338,8 @@ pub fn unsuccessful_post_update_with_invalid_post_id() {
         create_default_member_owned_channel_with_video_and_comment();
         create_default_member_owned_channel_with_video_and_comment();
 
 
         EditPostTextFixture::default()
         EditPostTextFixture::default()
-            .with_post_id(PostId::zero())
-            .call_and_assert(Err(Error::<Test>::PostDoesNotExist.into()))
+            .with_post_id(VideoPostId::zero())
+            .call_and_assert(Err(Error::<Test>::VideoPostDoesNotExist.into()))
     })
     })
 }
 }
 
 
@@ -353,8 +353,8 @@ pub fn unsuccessful_post_update_with_invalid_video_id() {
         create_default_member_owned_channel_with_video_and_comment();
         create_default_member_owned_channel_with_video_and_comment();
 
 
         EditPostTextFixture::default()
         EditPostTextFixture::default()
-            .with_video_id(PostId::zero())
-            .call_and_assert(Err(Error::<Test>::PostDoesNotExist.into()))
+            .with_video_id(VideoPostId::zero())
+            .call_and_assert(Err(Error::<Test>::VideoPostDoesNotExist.into()))
     })
     })
 }
 }
 
 
@@ -407,7 +407,7 @@ pub fn unsuccessful_comment_update_by_member_not_author() {
 
 
         EditPostTextFixture::default()
         EditPostTextFixture::default()
             .with_sender(UNAUTHORIZED_MEMBER_ACCOUNT_ID)
             .with_sender(UNAUTHORIZED_MEMBER_ACCOUNT_ID)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .with_actor(ContentActor::Member(UNAUTHORIZED_MEMBER_ID))
             .with_actor(ContentActor::Member(UNAUTHORIZED_MEMBER_ID))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
     })
     })
@@ -430,7 +430,7 @@ pub fn unsuccessful_comment_update_by_curator_not_author() {
                 unauthorized_curator_group_id,
                 unauthorized_curator_group_id,
                 UNAUTHORIZED_CURATOR_ID,
                 UNAUTHORIZED_CURATOR_ID,
             ))
             ))
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
     })
     })
 }
 }
@@ -448,7 +448,7 @@ pub fn unsuccessful_comment_update_by_lead_not_author() {
         EditPostTextFixture::default()
         EditPostTextFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
     })
     })
 }
 }
@@ -463,7 +463,7 @@ pub fn successful_comment_update_by_member() {
         create_default_member_owned_channel_with_video_and_comment();
         create_default_member_owned_channel_with_video_and_comment();
 
 
         EditPostTextFixture::default()
         EditPostTextFixture::default()
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Ok(()))
             .call_and_assert(Ok(()))
     })
     })
 }
 }
@@ -484,7 +484,7 @@ pub fn successful_comment_update_by_curator() {
                 default_curator_group_id,
                 default_curator_group_id,
                 DEFAULT_CURATOR_ID,
                 DEFAULT_CURATOR_ID,
             ))
             ))
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Ok(()))
             .call_and_assert(Ok(()))
     })
     })
 }
 }
@@ -502,8 +502,8 @@ pub fn successful_comment_update_by_lead() {
         CreatePostFixture::default()
         CreatePostFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()));
             .call_and_assert(Ok(()));
@@ -511,7 +511,7 @@ pub fn successful_comment_update_by_lead() {
         EditPostTextFixture::default()
         EditPostTextFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Ok(()))
             .call_and_assert(Ok(()))
     })
     })
 }
 }
@@ -598,8 +598,8 @@ pub fn unsuccessful_post_deletion_with_lead_auth_failed() {
         CreatePostFixture::default()
         CreatePostFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()));
             .call_and_assert(Ok(()));
@@ -607,7 +607,7 @@ pub fn unsuccessful_post_deletion_with_lead_auth_failed() {
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(UNAUTHORIZED_LEAD_ACCOUNT_ID)
             .with_sender(UNAUTHORIZED_LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::LeadAuthFailed.into()))
             .call_and_assert(Err(Error::<Test>::LeadAuthFailed.into()))
     })
     })
 }
 }
@@ -622,8 +622,8 @@ pub fn unsuccessful_post_deletion_with_invalid_post_id() {
         create_default_member_owned_channel_with_video_and_post();
         create_default_member_owned_channel_with_video_and_post();
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
-            .with_post_id(PostId::zero())
-            .call_and_assert(Err(Error::<Test>::PostDoesNotExist.into()))
+            .with_post_id(VideoPostId::zero())
+            .call_and_assert(Err(Error::<Test>::VideoPostDoesNotExist.into()))
     })
     })
 }
 }
 
 
@@ -637,8 +637,8 @@ pub fn unsuccessful_post_deletion_with_invalid_video_id() {
         create_default_member_owned_channel_with_video_and_post();
         create_default_member_owned_channel_with_video_and_post();
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
-            .with_post_id(PostId::zero())
-            .call_and_assert(Err(Error::<Test>::PostDoesNotExist.into()))
+            .with_post_id(VideoPostId::zero())
+            .call_and_assert(Err(Error::<Test>::VideoPostDoesNotExist.into()))
     })
     })
 }
 }
 
 
@@ -703,7 +703,7 @@ pub fn unsuccessful_post_deletion_with_no_witness() {
         create_default_member_owned_channel_with_video_and_comment();
         create_default_member_owned_channel_with_video_and_comment();
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
-            .with_params(PostDeletionParameters::<Test> {
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: None,
                 witness: None,
                 rationale: None,
                 rationale: None,
             })
             })
@@ -723,7 +723,7 @@ pub fn unsuccessful_comment_update_with_not_authorized_memeber() {
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(UNAUTHORIZED_MEMBER_ACCOUNT_ID)
             .with_sender(UNAUTHORIZED_MEMBER_ACCOUNT_ID)
             .with_actor(ContentActor::Member(UNAUTHORIZED_MEMBER_ID))
             .with_actor(ContentActor::Member(UNAUTHORIZED_MEMBER_ID))
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
     })
     })
 }
 }
@@ -744,7 +744,7 @@ pub fn unsuccessful_comment_deletion_by_not_authorized_curator() {
                 unauthorized_curator_group_id,
                 unauthorized_curator_group_id,
                 UNAUTHORIZED_CURATOR_ID,
                 UNAUTHORIZED_CURATOR_ID,
             ))
             ))
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
     })
     })
 }
 }
@@ -762,7 +762,7 @@ pub fn unsuccessful_comment_deletion_with_lead_not_authorized() {
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
     })
     })
 }
 }
@@ -779,7 +779,7 @@ pub fn unsuccessful_comment_deletion_by_invalid_moderator() {
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(UNAUTHORIZED_MODERATOR_ACCOUNT_ID)
             .with_sender(UNAUTHORIZED_MODERATOR_ACCOUNT_ID)
             .with_actor(ContentActor::Member(UNAUTHORIZED_MODERATOR_ID))
             .with_actor(ContentActor::Member(UNAUTHORIZED_MODERATOR_ID))
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
             .call_and_assert(Err(Error::<Test>::ActorNotAuthorized.into()))
     })
     })
 }
 }
@@ -796,11 +796,11 @@ pub fn unsuccessful_comment_deletion_by_moderator_with_no_rationale() {
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(DEFAULT_MODERATOR_ACCOUNT_ID)
             .with_sender(DEFAULT_MODERATOR_ACCOUNT_ID)
             .with_actor(ContentActor::Member(DEFAULT_MODERATOR_ID))
             .with_actor(ContentActor::Member(DEFAULT_MODERATOR_ID))
-            .with_params(PostDeletionParameters::<Test> {
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: None,
                 witness: None,
                 rationale: None,
                 rationale: None,
             })
             })
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .call_and_assert(Err(Error::<Test>::RationaleNotProvidedByModerator.into()))
             .call_and_assert(Err(Error::<Test>::RationaleNotProvidedByModerator.into()))
     })
     })
 }
 }
@@ -815,9 +815,9 @@ pub fn successful_post_deletion_by_member() {
         create_default_member_owned_channel_with_video_and_comment();
         create_default_member_owned_channel_with_video_and_comment();
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
-            .with_params(PostDeletionParameters::<Test> {
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::one(),
+                    &VideoPostId::one(),
                 )),
                 )),
                 rationale: None,
                 rationale: None,
             })
             })
@@ -841,9 +841,9 @@ pub fn successful_post_deletion_by_curator() {
                 default_curator_group_id,
                 default_curator_group_id,
                 DEFAULT_CURATOR_ID,
                 DEFAULT_CURATOR_ID,
             ))
             ))
-            .with_params(PostDeletionParameters::<Test> {
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::one(),
+                    &VideoPostId::one(),
                 )),
                 )),
                 rationale: None,
                 rationale: None,
             })
             })
@@ -861,10 +861,10 @@ pub fn successful_comment_deletion_by_member_owner() {
         create_default_member_owned_channel_with_video_and_comment();
         create_default_member_owned_channel_with_video_and_comment();
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
-            .with_post_id(PostId::from(2u64))
-            .with_params(PostDeletionParameters::<Test> {
+            .with_post_id(VideoPostId::from(2u64))
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::zero(),
+                    &VideoPostId::zero(),
                 )),
                 )),
                 rationale: None,
                 rationale: None,
             })
             })
@@ -884,14 +884,14 @@ pub fn successful_comment_deletion_by_curator_onwer() {
         let default_curator_group_id = Content::next_curator_group_id() - 1;
         let default_curator_group_id = Content::next_curator_group_id() - 1;
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(DEFAULT_CURATOR_ACCOUNT_ID)
             .with_sender(DEFAULT_CURATOR_ACCOUNT_ID)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .with_actor(ContentActor::Curator(
             .with_actor(ContentActor::Curator(
                 default_curator_group_id,
                 default_curator_group_id,
                 DEFAULT_CURATOR_ID,
                 DEFAULT_CURATOR_ID,
             ))
             ))
-            .with_params(PostDeletionParameters::<Test> {
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::zero(),
+                    &VideoPostId::zero(),
                 )),
                 )),
                 rationale: None,
                 rationale: None,
             })
             })
@@ -910,17 +910,17 @@ pub fn successful_comment_deletion_by_member_author() {
         create_default_curator_owned_channel_with_video_and_post();
         create_default_curator_owned_channel_with_video_and_post();
 
 
         CreatePostFixture::default()
         CreatePostFixture::default()
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()));
             .call_and_assert(Ok(()));
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
-            .with_post_id(PostId::from(2u64))
-            .with_params(PostDeletionParameters::<Test> {
+            .with_post_id(VideoPostId::from(2u64))
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::zero(),
+                    &VideoPostId::zero(),
                 )),
                 )),
                 rationale: None,
                 rationale: None,
             })
             })
@@ -946,22 +946,22 @@ pub fn successful_comment_deletion_by_curator_author() {
                 default_curator_group_id,
                 default_curator_group_id,
                 DEFAULT_CURATOR_ID,
                 DEFAULT_CURATOR_ID,
             ))
             ))
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()));
             .call_and_assert(Ok(()));
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(DEFAULT_CURATOR_ACCOUNT_ID)
             .with_sender(DEFAULT_CURATOR_ACCOUNT_ID)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .with_actor(ContentActor::Curator(
             .with_actor(ContentActor::Curator(
                 default_curator_group_id,
                 default_curator_group_id,
                 DEFAULT_CURATOR_ID,
                 DEFAULT_CURATOR_ID,
             ))
             ))
-            .with_params(PostDeletionParameters::<Test> {
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::zero(),
+                    &VideoPostId::zero(),
                 )),
                 )),
                 rationale: None,
                 rationale: None,
             })
             })
@@ -982,19 +982,19 @@ pub fn successful_comment_deletion_by_lead_author() {
         CreatePostFixture::default()
         CreatePostFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_params(PostCreationParameters::<Test> {
-                post_type: PostType::<Test>::Comment(PostId::one()),
+            .with_params(VideoPostCreationParameters::<Test> {
+                post_type: VideoPostType::<Test>::Comment(VideoPostId::one()),
                 video_reference: VideoId::one(),
                 video_reference: VideoId::one(),
             })
             })
             .call_and_assert(Ok(()));
             .call_and_assert(Ok(()));
 
 
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(LEAD_ACCOUNT_ID)
             .with_sender(LEAD_ACCOUNT_ID)
-            .with_post_id(PostId::from(2u64))
+            .with_post_id(VideoPostId::from(2u64))
             .with_actor(ContentActor::Lead)
             .with_actor(ContentActor::Lead)
-            .with_params(PostDeletionParameters::<Test> {
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::zero(),
+                    &VideoPostId::zero(),
                 )),
                 )),
                 rationale: None,
                 rationale: None,
             })
             })
@@ -1014,10 +1014,10 @@ pub fn successful_comment_deletion_by_moderator() {
         DeletePostFixture::default()
         DeletePostFixture::default()
             .with_sender(DEFAULT_MODERATOR_ACCOUNT_ID)
             .with_sender(DEFAULT_MODERATOR_ACCOUNT_ID)
             .with_actor(ContentActor::Member(DEFAULT_MODERATOR_ID))
             .with_actor(ContentActor::Member(DEFAULT_MODERATOR_ID))
-            .with_post_id(PostId::from(2u64))
-            .with_params(PostDeletionParameters::<Test> {
+            .with_post_id(VideoPostId::from(2u64))
+            .with_params(VideoPostDeletionParameters::<Test> {
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
                 witness: Some(<Test as frame_system::Trait>::Hashing::hash_of(
-                    &PostId::zero(),
+                    &VideoPostId::zero(),
                 )),
                 )),
                 rationale: Some(b"rationale".to_vec()),
                 rationale: Some(b"rationale".to_vec()),
             })
             })

+ 1 - 1
runtime/src/lib.rs

@@ -452,7 +452,7 @@ impl content::Trait for Runtime {
     type ChannelOwnershipTransferRequestId = ChannelOwnershipTransferRequestId;
     type ChannelOwnershipTransferRequestId = ChannelOwnershipTransferRequestId;
     type MaxNumberOfCuratorsPerGroup = MaxNumberOfCuratorsPerGroup;
     type MaxNumberOfCuratorsPerGroup = MaxNumberOfCuratorsPerGroup;
     type DataObjectStorage = Storage;
     type DataObjectStorage = Storage;
-    type PostId = PostId;
+    type VideoPostId = VideoPostId;
     type ReactionId = ReactionId;
     type ReactionId = ReactionId;
     type MaxModerators = MaxModerators;
     type MaxModerators = MaxModerators;
     type PricePerByte = PricePerByte;
     type PricePerByte = PricePerByte;

+ 3 - 0
runtime/src/primitives.rs

@@ -70,6 +70,9 @@ pub type ChannelOwnershipTransferRequestId = u64;
 /// Content Directory Reaction Identifier
 /// Content Directory Reaction Identifier
 pub type ReactionId = u64;
 pub type ReactionId = u64;
 
 
+/// Represent a Video Post in the content module
+pub type VideoPostId = u64;
+
 /// Represents a thread identifier for both Forum and Proposals Discussion
 /// Represents a thread identifier for both Forum and Proposals Discussion
 ///
 ///
 /// Note: Both modules expose type names ThreadId and PostId (which are defined on their Trait) and
 /// Note: Both modules expose type names ThreadId and PostId (which are defined on their Trait) and