Skip to content

Commit

Permalink
apply staking period department-funding
Browse files Browse the repository at this point in the history
  • Loading branch information
amiyatulu committed Nov 24, 2023
1 parent 03e957d commit 1bd9105
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pallets/department-funding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub mod pallet {
account: T::AccountId,
department_required_fund_id: DepartmentRequiredFundId,
},
StakinPeriodStarted {
StakingPeriodStarted {
department_required_fund_id: DepartmentRequiredFundId,
block_number: BlockNumberOf<T>,
},
Expand Down Expand Up @@ -228,6 +228,7 @@ pub mod pallet {
origin: OriginFor<T>,
department_required_fund_id: DepartmentRequiredFundId,
) -> DispatchResult {
let who = ensure_signed(origin)?;
Self::ensure_validation_to_do(department_required_fund_id)?;
let department_id = Self::get_department_id_from_department_required_fund_id(
department_required_fund_id,
Expand All @@ -237,6 +238,23 @@ pub mod pallet {
department_id,
department_funding_status,
);
let now = <frame_system::Pallet<T>>::block_number();
let key = SumTreeName::DepartmentRequiredFund {
department_required_fund_id,
block_number: now.clone(),
};
ValidationDepartmentRequiredFundsBlock::<T>::insert(
department_required_fund_id,
now.clone(),
);
T::SchellingGameSharedSource::set_to_staking_period_pe_link(key.clone(), now.clone())?;
T::SchellingGameSharedSource::create_tree_helper_link(key, 3)?;

Self::deposit_event(Event::StakingPeriodStarted {
department_required_fund_id,
block_number: now,
});

Ok(())
}

Expand Down

0 comments on commit 1bd9105

Please sign in to comment.