diff --git a/task/src/lib.rs b/task/src/lib.rs index 68ea268..a8fd485 100644 --- a/task/src/lib.rs +++ b/task/src/lib.rs @@ -36,7 +36,7 @@ //! //! When Tasks are created, there is some associated metadata that shall be defined. //! This includes the following: -//! - Task Requirements (Defining the Task Requirements) +//! - Task Description (Defining the Task description) //! - Task Budget (The cost of completion for the Task) //! - Task Deadline (The specified time until which the task should be completed) //! @@ -97,10 +97,10 @@ pub mod pallet { #[scale_info(skip_type_params(T))] pub struct Task { pub title: Vec, + pub description: Vec, pub initiator: AccountOf, pub volunteer: AccountOf, pub current_owner: AccountOf, - pub requirements: Vec, pub status: TaskStatus, pub budget: BalanceOf, pub deadline: u32, @@ -191,15 +191,15 @@ pub mod pallet { // Dispatchable functions must be annotated with a weight and must return a DispatchResult. #[pallet::call] impl Pallet { - /// Function call that creates tasks. [ origin, requirements, budget, deadline] + /// Function call that creates tasks. [ origin, description, budget, deadline] #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] - pub fn create_task(origin: OriginFor, title: Vec, requirements: Vec, budget: BalanceOf, deadline: u32) -> DispatchResultWithPostInfo { + pub fn create_task(origin: OriginFor, title: Vec, description: Vec, budget: BalanceOf, deadline: u32) -> DispatchResultWithPostInfo { // Check that the extrinsic was signed and get the signer. let signer = ensure_signed(origin)?; // Update storage. - let task_id = Self::new_task(&signer, &title, &requirements, &budget, &deadline)?; + let task_id = Self::new_task(&signer, &title, &description, &budget, &deadline)?; // TODO: Check if user has balance to create task // T::Currency::reserve(&signer, budget).map_err(|_| "locker can't afford to lock the amount requested")?; @@ -263,7 +263,7 @@ pub mod pallet { // *** Helper functions *** // impl Pallet { - pub fn new_task(from_initiator: &T::AccountId, title: &[u8], requirements: &[u8], budget: &BalanceOf, deadline: &u32) -> Result> { + pub fn new_task(from_initiator: &T::AccountId, title: &[u8], description: &[u8], budget: &BalanceOf, deadline: &u32) -> Result> { // Ensure user has a profile before creating a task ensure!(pallet_profile::Pallet::::has_profile(from_initiator).unwrap(), >::NoProfile); @@ -271,9 +271,9 @@ pub mod pallet { // Init Task Object let task = Task:: { title: title.to_owned(), + description: description.to_owned(), initiator: from_initiator.clone(), volunteer: from_initiator.clone(), - requirements: requirements.to_owned(), status: Created, budget: *budget, current_owner: from_initiator.clone(),