diff --git a/pallets/jobs/src/lib.rs b/pallets/jobs/src/lib.rs index 48990697a..5bf4a75a0 100644 --- a/pallets/jobs/src/lib.rs +++ b/pallets/jobs/src/lib.rs @@ -110,6 +110,10 @@ pub mod module { NoRewards, /// Not enough validators to exit NotEnoughValidators, + /// empty result + EmptyResult, + /// empty job + EmptyJob, } #[pallet::event] @@ -308,6 +312,9 @@ pub mod module { ) -> DispatchResult { let _caller = ensure_signed(origin)?; + // sanity check + ensure!(result.is_empty(), Error::::EmptyResult); + // Ensure the job exists let job_info = SubmittedJobs::::get(job_key.clone(), job_id).ok_or(Error::::JobNotFound)?;