pub enum ValidationErrorKind {
InvalidSigner,
LowValue(HoprBalance),
LowWinProb(WinningProbability),
ChannelClosed(ChannelId),
EpochMismatch(u32),
IndexTooLow(u64),
WrongCounterparty(Address),
InsufficientFunds(ChannelId, HoprBalance),
}Expand description
Contains all possible validation errors that can occur during ticket validation.
Variants§
InvalidSigner
Ticket signer does not match the sender.
LowValue(HoprBalance)
Ticket amount is lower than the given minimum value.
LowWinProb(WinningProbability)
Ticket winning probability is lower than the given minimum value.
ChannelClosed(ChannelId)
The given channel is closed or pending to close.
EpochMismatch(u32)
Ticket epoch does not match the given channel epoch.
IndexTooLow(u64)
Ticket index is lower than the given channel ticket index.
WrongCounterparty(Address)
Ticket counterparty does not match the channel destination.
InsufficientFunds(ChannelId, HoprBalance)
Not enough funds in the given channel to pay for the ticket.
Implementations§
Source§impl ValidationErrorKind
impl ValidationErrorKind
Sourcepub const fn as_metric_label(&self) -> &'static str
pub const fn as_metric_label(&self) -> &'static str
Stable metric label of each variant, used as the value of the type label of the
hopr_packet_ticket_validation_errors metric.
This is the single source of truth for these names; adding a variant does not compile until its label has been decided here.
Trait Implementations§
Source§impl Clone for ValidationErrorKind
impl Clone for ValidationErrorKind
Source§fn clone(&self) -> ValidationErrorKind
fn clone(&self) -> ValidationErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ValidationErrorKind
Source§impl Debug for ValidationErrorKind
impl Debug for ValidationErrorKind
Source§impl Display for ValidationErrorKind
impl Display for ValidationErrorKind
Source§impl Error for ValidationErrorKind
impl Error for ValidationErrorKind
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ValidationErrorKind
impl RefUnwindSafe for ValidationErrorKind
impl Send for ValidationErrorKind
impl Sync for ValidationErrorKind
impl Unpin for ValidationErrorKind
impl UnsafeUnpin for ValidationErrorKind
impl UnwindSafe for ValidationErrorKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more