Skip to content

Commit 7c28b47

Browse files
committed
LowerHex and UpperHex implementations for FutureLeafVersion
1 parent 8e9f99b commit 7c28b47

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/util/taproot.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ sha256t_hash_newtype!(TapSighashHash, TapSighashTag, MIDSTATE_TAPSIGHASH, 64,
9898
);
9999

100100
impl TapTweakHash {
101-
102101
/// Create a new BIP341 [`TapTweakHash`] from key and tweak
103102
/// Produces H_taptweak(P||R) where P is internal key and R is the merkle root
104103
pub fn from_key_and_tweak(
@@ -791,6 +790,20 @@ impl fmt::Display for FutureLeafVersion {
791790
}
792791
}
793792

793+
impl fmt::LowerHex for FutureLeafVersion {
794+
#[inline]
795+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
796+
fmt::LowerHex::fmt(&self.0, f)
797+
}
798+
}
799+
800+
impl fmt::UpperHex for FutureLeafVersion {
801+
#[inline]
802+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
803+
fmt::UpperHex::fmt(&self.0, f)
804+
}
805+
}
806+
794807
/// The leaf version for tapleafs
795808
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
796809
pub enum LeafVersion {

0 commit comments

Comments
 (0)