impl Borrow<[u8]> for ChannelId

We do this for `Payment*` in `lightning-types` and its needed for
the `hex_conservaitve` `impl_fmt_traits` macro which we'll use in
the next commit.
This commit is contained in:
Matt Corallo 2024-09-09 15:30:09 +00:00
parent eba329cfaf
commit 91a60c8256
2 changed files with 8 additions and 1 deletions

View file

@ -7135,7 +7135,7 @@ where
chan
} else {
let update_actions = peer_state.monitor_update_blocked_actions
.remove(&channel_id).unwrap_or(Vec::new());
.remove(channel_id).unwrap_or(Vec::new());
mem::drop(peer_state_lock);
mem::drop(per_peer_state);
self.handle_monitor_update_completion_actions(update_actions);

View file

@ -30,6 +30,7 @@ use bitcoin::hashes::{
HashEngine as _,
sha256::Hash as Sha256,
};
use core::borrow::Borrow;
use core::fmt;
use core::ops::Deref;
@ -127,6 +128,12 @@ impl fmt::Display for ChannelId {
}
}
impl Borrow<[u8]> for ChannelId {
fn borrow(&self) -> &[u8] {
&self.0[..]
}
}
pub use lightning_types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
#[cfg(test)]