Skip to content

Commit

Permalink
Updated lnurl-w to return ()
Browse files Browse the repository at this point in the history
  • Loading branch information
i5hi committed Oct 5, 2024
1 parent 869d9e4 commit 348a881
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/util/lnurl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn create_withdraw_response(voucher: &str) -> Result<WithdrawalResponse, Err
}
}

pub fn process_withdrawal(withdraw: &WithdrawalResponse, invoice: &str) -> Result<String, Error> {
pub fn process_withdrawal(withdraw: &WithdrawalResponse, invoice: &str) -> Result<(), Error> {
let client = Builder::default()
.build_blocking()
.map_err(|e| Error::Generic(e.to_string()))?;
Expand All @@ -82,7 +82,7 @@ pub fn process_withdrawal(withdraw: &WithdrawalResponse, invoice: &str) -> Resul
.do_withdrawal(withdraw, invoice)
.map_err(|e| Error::HTTP(e.to_string()))?;

Ok("Withdrawal successful".to_string())
Ok(())
}

#[cfg(test)]
Expand Down Expand Up @@ -153,7 +153,6 @@ mod tests {
let result = process_withdrawal(&withdraw_response, invoice);

assert!(result.is_ok(), "Withdrawal failed: {:?}", result.err());
assert_eq!(result.unwrap(), "Withdrawal successful");

println!("Withdrawal test passed successfully");
}
Expand Down

0 comments on commit 348a881

Please sign in to comment.