mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-07 08:04:27 +01:00
Derive Debug for relevant structs (#45)
This commit is contained in:
@@ -84,9 +84,9 @@ pub(crate) fn handle_command(
|
||||
.iter()
|
||||
.map(|tx| {
|
||||
format!(
|
||||
"Id: {} | Type: {} | Amount: {} sat | Timestamp: {}",
|
||||
"Id: {} | Type: {:?} | Amount: {} sat | Timestamp: {}",
|
||||
tx.id.clone().unwrap_or("None".to_string()),
|
||||
tx.payment_type.to_string(),
|
||||
tx.payment_type,
|
||||
tx.amount_sat,
|
||||
match tx.timestamp {
|
||||
Some(t) => t.to_string(),
|
||||
|
||||
@@ -40,17 +40,6 @@ pub enum SwapStatus {
|
||||
Completed,
|
||||
}
|
||||
|
||||
impl ToString for SwapStatus {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
SwapStatus::Mempool => "transaction.mempool",
|
||||
SwapStatus::Completed => "transaction.mempool",
|
||||
SwapStatus::Created => "swap.created",
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ReceivePaymentRequest {
|
||||
pub invoice_amount_sat: Option<u64>,
|
||||
pub onchain_amount_sat: Option<u64>,
|
||||
@@ -103,6 +92,7 @@ impl From<S5Error> for SwapError {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct WalletInfo {
|
||||
pub balance_sat: u64,
|
||||
pub pubkey: String,
|
||||
@@ -128,23 +118,14 @@ pub struct OngoingSendSwap {
|
||||
// pub onchain_amount_sat: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum PaymentType {
|
||||
Sent,
|
||||
Received,
|
||||
PendingReceive,
|
||||
}
|
||||
|
||||
impl ToString for PaymentType {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
PaymentType::Sent => "Sent",
|
||||
PaymentType::Received => "Received",
|
||||
PaymentType::PendingReceive => "Pending Receive",
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Payment {
|
||||
pub id: Option<String>,
|
||||
pub timestamp: Option<u32>,
|
||||
|
||||
Reference in New Issue
Block a user