use crate::util::ser::{BigSize, FixedLengthReader, LengthRead, LengthReadable, LengthReadableArgs, Readable, ReadableArgs, Writeable, Writer};
use core::cmp;
+use core::fmt;
use crate::io::{self, Read};
use crate::prelude::*;
pub(super) const BIG_PACKET_HOP_DATA_LEN: usize = 32768;
/// Packet of hop data for next peer
-#[derive(Clone, Debug, Hash, PartialEq, Eq)]
+#[derive(Clone, Hash, PartialEq, Eq)]
pub struct Packet {
/// Bolt 04 version number
pub version: u8,
}
}
+impl fmt::Debug for Packet {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.write_fmt(format_args!("Onion message packet version {} with hmac {:?}", self.version, &self.hmac[..]))
+ }
+}
+
impl Writeable for Packet {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
self.version.write(w)?;