@@ -96,22 +96,37 @@ pub(crate) fn channel_config_to_proto(
9696}
9797
9898pub ( crate ) fn payment_to_proto ( payment : PaymentDetails ) -> Payment {
99- Payment {
100- id : payment. id . 0 . to_lower_hex_string ( ) ,
101- kind : Some ( payment_kind_to_proto ( payment. kind ) ) ,
102- amount_msat : payment. amount_msat ,
103- direction : match payment. direction {
104- PaymentDirection :: Inbound => ldk_server_protos:: types:: PaymentDirection :: Inbound . into ( ) ,
105- PaymentDirection :: Outbound => {
106- ldk_server_protos:: types:: PaymentDirection :: Outbound . into ( )
99+ match payment {
100+ PaymentDetails {
101+ id,
102+ kind,
103+ amount_msat,
104+ fee_paid_msat,
105+ direction,
106+ status,
107+ latest_update_timestamp,
108+ } => Payment {
109+ id : id. to_string ( ) ,
110+ kind : Some ( payment_kind_to_proto ( kind) ) ,
111+ amount_msat,
112+ fee_paid_msat,
113+ direction : match direction {
114+ PaymentDirection :: Inbound => {
115+ ldk_server_protos:: types:: PaymentDirection :: Inbound . into ( )
116+ } ,
117+ PaymentDirection :: Outbound => {
118+ ldk_server_protos:: types:: PaymentDirection :: Outbound . into ( )
119+ } ,
107120 } ,
121+ status : match status {
122+ PaymentStatus :: Pending => ldk_server_protos:: types:: PaymentStatus :: Pending . into ( ) ,
123+ PaymentStatus :: Succeeded => {
124+ ldk_server_protos:: types:: PaymentStatus :: Succeeded . into ( )
125+ } ,
126+ PaymentStatus :: Failed => ldk_server_protos:: types:: PaymentStatus :: Failed . into ( ) ,
127+ } ,
128+ latest_update_timestamp,
108129 } ,
109- status : match payment. status {
110- PaymentStatus :: Pending => ldk_server_protos:: types:: PaymentStatus :: Pending . into ( ) ,
111- PaymentStatus :: Succeeded => ldk_server_protos:: types:: PaymentStatus :: Succeeded . into ( ) ,
112- PaymentStatus :: Failed => ldk_server_protos:: types:: PaymentStatus :: Failed . into ( ) ,
113- } ,
114- latest_update_timestamp : payment. latest_update_timestamp ,
115130 }
116131}
117132
0 commit comments