//! [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
//! [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
+use core::borrow::Borrow;
use bitcoin::constants::ChainHash;
use bitcoin::network::Network;
use bitcoin::secp256k1::{Keypair, PublicKey, Secp256k1, self};
#[cfg(feature = "std")]
use std::time::SystemTime;
+use bitcoin::hex::impl_fmt_traits;
pub(super) const IV_BYTES_WITH_METADATA: &[u8; IV_LEN] = b"LDK Offer ~~~~~~";
pub(super) const IV_BYTES_WITHOUT_METADATA: &[u8; IV_LEN] = b"LDK Offer v2~~~~";
/// An identifier for an [`Offer`] built using [`DerivedMetadata`].
-#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+#[derive(Clone, Copy, Eq, PartialEq)]
pub struct OfferId(pub [u8; 32]);
impl OfferId {
}
}
+impl Borrow<[u8]> for OfferId {
+ fn borrow(&self) -> &[u8] {
+ &self.0[..]
+ }
+}
+
+impl_fmt_traits! {
+ impl fmt_traits for OfferId {
+ const LENGTH: usize = 32;
+ }
+}
+
impl Writeable for OfferId {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
self.0.write(w)