Skip to content

Commit

Permalink
feat: return error for lnd bolt12
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Oct 30, 2024
1 parent 2ad9b1a commit fe810db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
3 changes: 3 additions & 0 deletions crates/cdk-lnd/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ pub enum Error {
/// Payment failed
#[error("LND payment failed")]
PaymentFailed,
/// Unsupported method
#[error("Unsupported method")]
UnsupportedMethod,
/// Wrong invoice type
#[error("Wrong invoice type")]
WrongRequestType,
Expand Down
6 changes: 3 additions & 3 deletions crates/cdk-lnd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl MintLightning for Lnd {
&self,
_melt_quote_request: &MeltQuoteBolt12Request,
) -> Result<Bolt12PaymentQuoteResponse, Self::Err> {
todo!()
Err(Error::UnsupportedMethod.into())
}

/// Pay a bolt12 offer
Expand All @@ -413,7 +413,7 @@ impl MintLightning for Lnd {
_amount: Option<Amount>,
_max_fee_amount: Option<Amount>,
) -> Result<PayInvoiceResponse, Self::Err> {
todo!()
Err(Error::UnsupportedMethod.into())
}

/// Create bolt12 offer
Expand All @@ -425,6 +425,6 @@ impl MintLightning for Lnd {
_unix_expiry: u64,
_single_use: bool,
) -> Result<CreateOfferResponse, Self::Err> {
todo!()
Err(Error::UnsupportedMethod.into())
}
}

0 comments on commit fe810db

Please sign in to comment.