From f6cec034395dd815f89630943d5ba307a3d79cc6 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Tue, 7 Nov 2023 21:38:18 +0000 Subject: [PATCH] more fixes --- pallets/jobs/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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)?;