Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Update pallets/marketplace/src/lib.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Wehrli <simon@smartnuance.com>
  • Loading branch information
RomarQ and gitsimon authored Apr 6, 2023
1 parent f21240e commit 66bb2c5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pallets/marketplace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,13 @@ pub mod pallet {
let assignment =
<StoredMatches<T>>::get(&who, &job_id).ok_or(Error::<T>::JobNotAssigned)?;

let now = Self::now()?;
ensure!(
registration.schedule.end_time.lt(&now),
Error::<T>::JobCannotBeFinalized
);
let now = Self::now()?.checked_add(T::ReportTolerance::get())
.ok_or(Error::<T>::CalculationOverflow)?;
let (_actual_start, actual_end) = registration
.schedule
.range(assignment.start_delay)
.ok_or(Error::<T>::CalculationOverflow)?;
ensure!(actual_end.lt(&now), Error::<T>::JobCannotBeFinalized);

// update reputation since we don't expect further reports for this job
// (only update for attested devices!)
Expand Down

0 comments on commit 66bb2c5

Please sign in to comment.