fedimint_gateway_server/
types.rs
1use std::fmt::Display;
4
5use fedimint_lightning::InterceptPaymentRequest;
6use hex::ToHex;
7
8pub struct PrettyInterceptPaymentRequest<'a>(pub &'a InterceptPaymentRequest);
10
11impl Display for PrettyInterceptPaymentRequest<'_> {
12 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13 let PrettyInterceptPaymentRequest(payment_request) = self;
14 write!(
15 f,
16 "InterceptPaymentRequest {{ payment_hash: {}, amount_msat: {:?}, expiry: {:?}, short_channel_id: {:?}, incoming_chan_id: {:?}, htlc_id: {:?} }}",
17 payment_request.payment_hash.encode_hex::<String>(),
18 payment_request.amount_msat,
19 payment_request.expiry,
20 payment_request.short_channel_id,
21 payment_request.incoming_chan_id,
22 payment_request.htlc_id,
23 )
24 }
25}