Derive a PartialEq and Eq for PaymentError

This lets users compare error types more easily without needing a match
statement.
This commit is contained in:
benthecarman 2023-05-23 16:18:39 -05:00
parent 498f233145
commit 3003f7d719
No known key found for this signature in database
GPG key ID: D7CC770B81FD22A8
2 changed files with 2 additions and 2 deletions

View file

@ -169,7 +169,7 @@ fn expiry_time_from_unix_epoch(invoice: &Invoice) -> Duration {
}
/// An error that may occur when making a payment.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum PaymentError {
/// An error resulting from the provided [`Invoice`] or payment hash.
Invoice(&'static str),

View file

@ -312,7 +312,7 @@ impl<T: Time> Display for PaymentAttemptsUsingTime<T> {
/// [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
/// [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
/// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum RetryableSendFailure {
/// The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
/// that this error is *not* caused by [`Retry::Timeout`].