-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Probably part of #14
PaymentStatus is defined in ldk-server-protos/src/types.rs:
/// Represents the current status of a payment.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PaymentStatus {
/// The payment is still pending.
Pending = 0,
/// The payment succeeded.
Succeeded = 1,
/// The payment failed.
Failed = 2,
}and we print this struct serialized with serde_json::to_string_pretty in ldk-server-cli/src/main.rs
fn handle_response_result<Rs, Js>(response: Result<Rs, LdkServerError>)
where
Rs: Into<Js>,
Js: Serialize + std::fmt::Debug,
{
match response {
Ok(response) => {
let json_response: Js = response.into();
match serde_json::to_string_pretty(&json_response) {
Ok(json) => println!("{json}"),
Err(e) => {
eprintln!("Error serializing response ({json_response:?}) to JSON: {e}");
std::process::exit(1);
},
}
},
Err(e) => {
handle_error(e);
},
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status