diff --git a/pallets/department-funding/src/extras.rs b/pallets/department-funding/src/extras.rs index c57cbf7..b1016c9 100644 --- a/pallets/department-funding/src/extras.rs +++ b/pallets/department-funding/src/extras.rs @@ -49,11 +49,11 @@ impl Pallet { pub fn ensure_can_stake_using_status( department_id: DepartmentId, ) -> Result, FundingStatus>, DispatchError> { - let department_status_option = - DepartmentFundingStatusForDepartmentId::::get(department_id); let now = >::block_number(); let department_funding_status = DepartmentFundingStatus { block_number: now, status: FundingStatus::Processing }; + let department_status_option = + DepartmentFundingStatusForDepartmentId::::get(department_id); match department_status_option { Some(department_status) => { let funding_status = department_status.status; @@ -64,8 +64,7 @@ impl Pallet { let status_failed_time = TIME_FOR_STAKING_FUNDING_STATUS_FAILED; let status_failed_time_block = Self::u64_to_block_saturated(status_failed_time); let funding_status_block = department_status.block_number; - let time = - now.checked_sub(&funding_status_block).expect("Overflow"); + let time = now.checked_sub(&funding_status_block).expect("Overflow"); if time >= status_failed_time_block { Ok(department_funding_status) } else { @@ -76,8 +75,7 @@ impl Pallet { let status_success_time_block = Self::u64_to_block_saturated(status_success_time); let funding_status_block = department_status.block_number; - let time = - now.checked_sub(&funding_status_block).expect("Overflow"); + let time = now.checked_sub(&funding_status_block).expect("Overflow"); if time >= status_success_time_block { Ok(department_funding_status) } else { diff --git a/pallets/department-funding/src/lib.rs b/pallets/department-funding/src/lib.rs index cea90c0..2753aa8 100644 --- a/pallets/department-funding/src/lib.rs +++ b/pallets/department-funding/src/lib.rs @@ -144,7 +144,7 @@ pub mod pallet { /// Event documentation should end with an array that provides descriptive names for event /// parameters. [something, who] SomethingStored { something: u32, who: T::AccountId }, - ProjectCreated { + DepartmentFundCreated { account: T::AccountId, department_required_fund_id: DepartmentRequiredFundId, }, @@ -214,7 +214,7 @@ pub mod pallet { *n += 1; }); - Self::deposit_event(Event::ProjectCreated { + Self::deposit_event(Event::DepartmentFundCreated { account: who, department_required_fund_id: new_department_fund_id, });