// Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] use core::hash::Hash; use core::ops::AddAssign; use codec::{Codec, Decode, Encode}; use frame_support::storage::IterableStorageMap; use frame_support::{ decl_event, decl_module, decl_storage, dispatch::{DispatchError, DispatchResult}, ensure, traits::Get, Parameter, }; #[cfg(feature = "std")] pub use serde::{Deserialize, Serialize}; use sp_arithmetic::traits::{BaseArithmetic, One, Zero}; use sp_runtime::traits::{MaybeSerializeDeserialize, Member}; use sp_std::borrow::ToOwned; use sp_std::collections::{btree_map::BTreeMap, btree_set::BTreeSet}; use sp_std::vec; use sp_std::vec::Vec; use system::ensure_signed; /// Module configuration trait for this Substrate module. pub trait Trait: system::Trait + ActorAuthenticator + Clone { /// The overarching event type. type Event: From> + Into<::Event>; /// Type of identifier for Videos type VideoId: Parameter + Member + BaseArithmetic + Codec + Default + Copy + Clone + Hash + MaybeSerializeDeserialize + Eq + PartialEq + Ord; /// Type of identifier for Channels type ChannelId: Parameter + Member + BaseArithmetic + Codec + Default + Copy + Clone + Hash + MaybeSerializeDeserialize + Eq + PartialEq + Ord; // Security/configuration constraints /// The maximum number of curators per group constraint type MaxNumberOfCuratorsPerGroup: Get; } decl_storage! { trait Store for Module as Content { } } decl_module! { pub struct Module for enum Call where origin: T::Origin { /// Predefined errors type Error = Error; /// Initializing events fn deposit_event() = default; } } impl Module { } decl_event!( pub enum Event where CuratorGroupId = ::CuratorGroupId, CuratorId = ::CuratorId, { } ); decl_error! { /// Content directory errors pub enum Error for Module { } }