Skip to content
Snippets Groups Projects
Unverified Commit 67bc8018 authored by bgallois's avatar bgallois
Browse files

refactor errors pallet-distance

parent e6a7cc02
No related branches found
No related tags found
No related merge requests found
......@@ -187,10 +187,10 @@ pub mod pallet {
pub enum Error<T> {
/// Distance is already under evaluation.
AlreadyInEvaluation,
/// Author requests too many evaluations.
ManyEvaluationsByAuthor,
/// Too many evaluations requested by author.
TooManyEvaluationsByAuthor,
/// Too many evaluations for this block.
ManyEvaluationsInBlock,
TooManyEvaluationsInBlock,
/// No author for this block.
NoAuthor,
/// Caller has no identity.
......@@ -252,7 +252,7 @@ pub mod pallet {
ensure_none(origin)?;
ensure!(
!DidUpdate::<T>::exists(),
Error::<T>::ManyEvaluationsInBlock,
Error::<T>::TooManyEvaluationsInBlock,
);
let author = pallet_authorship::Pallet::<T>::author().ok_or(Error::<T>::NoAuthor)?;
......@@ -297,7 +297,7 @@ pub mod pallet {
move |identities| {
identities
.try_push(identity)
.map_err(|_| Error::<T>::ManyEvaluationsInBlock)
.map_err(|_| Error::<T>::TooManyEvaluationsInBlock)
},
)?;
Self::deposit_event(Event::EvaluationStatusForced {
......@@ -323,7 +323,7 @@ pub mod pallet {
move |identities| {
identities
.try_push(identity)
.map_err(|_| Error::<T>::ManyEvaluationsInBlock.into())
.map_err(|_| Error::<T>::TooManyEvaluationsInBlock.into())
},
)
}
......@@ -453,7 +453,7 @@ pub mod pallet {
Self::deposit_event(Event::EvaluationUpdated { evaluator });
Ok(())
} else {
Err(Error::<T>::ManyEvaluationsByAuthor.into())
Err(Error::<T>::TooManyEvaluationsByAuthor.into())
}
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment