Skip to content

Commit 8c86d0a

Browse files
committed
f - derive Debug
1 parent 914ac19 commit 8c86d0a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lightning/src/offers/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use prelude::*;
2525

2626
/// An `offer` TLV stream without any semantic checks, apart from any checks performed when parsing
2727
/// the underlying types.
28+
#[derive(Debug)]
2829
struct OfferTlvStream {
2930
_empty: (),
3031
chains: Option<WithoutLength<Vec<BlockHash>>>,
@@ -62,13 +63,15 @@ impl_writeable_msg!(OfferTlvStream, { _empty }, {
6263
(240, signature, option),
6364
});
6465

66+
#[derive(Debug)]
6567
struct BlindedPath {
6668
blinding: PublicKey,
6769
path: WithLength<Vec<OnionMessagePath>, u8>,
6870
}
6971

7072
impl_writeable!(BlindedPath, { blinding, path });
7173

74+
#[derive(Debug)]
7275
struct OnionMessagePath {
7376
node_id: PublicKey,
7477
encrypted_recipient_data: Vec<u8>,
@@ -77,6 +80,7 @@ struct OnionMessagePath {
7780
impl_writeable!(OnionMessagePath, { node_id, encrypted_recipient_data });
7881

7982
// TODO: Remove once BOLT 12 test vectors are updated.
83+
#[derive(Debug)]
8084
struct Recurrence {
8185
time_unit: u8,
8286
period: HighZeroBytesDroppedVarInt<u32>,

lightning/src/util/ser.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ impl Readable for BigSize {
392392
/// In TLV we occasionally send fields which only consist of, or potentially end with, a
393393
/// variable-length integer which is simply truncated by skipping high zero bytes. This type
394394
/// encapsulates such integers implementing Readable/Writeable for them.
395-
#[cfg_attr(test, derive(PartialEq, Debug))]
395+
#[cfg_attr(test, derive(PartialEq))]
396+
#[derive(Debug)]
396397
pub(crate) struct HighZeroBytesDroppedVarInt<T>(pub T);
397398

398399
macro_rules! impl_writeable_primitive {
@@ -520,7 +521,7 @@ impl_array!(1300); // for OnionPacket.hop_data
520521
/// enclosing TLV record.
521522
///
522523
/// The length is encoded as an unsigned `U` type.
523-
#[derive(Clone)]
524+
#[derive(Clone, Debug)]
524525
pub(crate) struct WithLength<T, U>(pub T, pub core::marker::PhantomData<U>);
525526

526527
impl<T: Writeable> Writeable for WithLength<Vec<T>, u8> {
@@ -547,7 +548,7 @@ impl<T: Readable> Readable for WithLength<Vec<T>, u8> {
547548

548549
/// For variable-length values within TLV record where the length is encoded as part of the record.
549550
/// Used to prevent encoding the length twice.
550-
#[derive(Clone)]
551+
#[derive(Clone, Debug)]
551552
pub(crate) struct WithoutLength<T>(pub T);
552553

553554
impl Writeable for WithoutLength<String> {

0 commit comments

Comments
 (0)