HashEngine as _,
sha256::Hash as Sha256,
};
+use bitcoin::hex::display::impl_fmt_traits;
use core::borrow::Borrow;
-use core::fmt;
use core::ops::Deref;
/// A unique 32-byte identifier for a channel.
/// A _temporary_ ID is generated randomly.
/// (Later revocation-point-based _v2_ is a possibility.)
/// The variety (context) is not stored, it is relevant only at creation.
-#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+#[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ChannelId(pub [u8; 32]);
impl ChannelId {
}
}
-impl fmt::Display for ChannelId {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- crate::util::logger::DebugBytes(&self.0).fmt(f)
- }
-}
-
impl Borrow<[u8]> for ChannelId {
fn borrow(&self) -> &[u8] {
&self.0[..]
}
}
+impl_fmt_traits! {
+ impl fmt_traits for ChannelId {
+ const LENGTH: usize = 32;
+ }
+}
+
pub use lightning_types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
#[cfg(test)]