Skip to content

Commit

Permalink
Rename BoltzGeneric error variant
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Apr 15, 2024
1 parent 9616a82 commit 6aa7209
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/ls-sdk-bindings/src/ls_sdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enum PaymentError {
"PersistError",
"InvalidPreimage",
"AlreadyClaimed",
"BoltzGeneric",
"BoltzError",
};

enum Network {
Expand Down
8 changes: 4 additions & 4 deletions lib/ls-sdk-core/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ pub enum PaymentError {
#[error("The specified funds have already been claimed")]
AlreadyClaimed,

#[error("Generic boltz error: {err}")]
BoltzGeneric { err: String },
#[error("Boltz error: {err}")]
BoltzError { err: String },
}

impl From<Error> for PaymentError {
Expand All @@ -116,9 +116,9 @@ impl From<Error> for PaymentError {
return PaymentError::AlreadyClaimed;
}

PaymentError::BoltzGeneric { err: msg }
PaymentError::BoltzError { err: msg }
}
_ => PaymentError::BoltzGeneric {
_ => PaymentError::BoltzError {
err: format!("{err:?}"),
},
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ls-sdk-core/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl Wallet {

// TODO The request should not allow setting both invoice and onchain amounts, so this case shouldn't be possible.
// See example of how it's done in the SDK.
_ => Err(PaymentError::BoltzGeneric {
_ => Err(PaymentError::BoltzError {
err: "Both invoice and onchain amounts were specified".into(),
}),
}?;
Expand Down

0 comments on commit 6aa7209

Please sign in to comment.