File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -771,8 +771,12 @@ pub enum LeafVersion {
771
771
}
772
772
773
773
impl LeafVersion {
774
- /// Obtain LeafVersion from u8, will error when last bit of ver is odd or
775
- /// when ver is 0x50 (ANNEX_TAG)
774
+ /// Obtain LeafVersion from consensus byte representation.
775
+ ///
776
+ /// # Errors
777
+ /// - If the last bit of the `version` is odd.
778
+ /// - If the `version` is 0x50 ([`TAPROOT_ANNEX_PREFIX`]).
779
+ /// - If the `version` is not a valid [`LeafVersion`] byte.
776
780
// Text from BIP341:
777
781
// In order to support some forms of static analysis that rely on
778
782
// being able to identify script spends without access to the output being
@@ -791,7 +795,7 @@ impl LeafVersion {
791
795
}
792
796
}
793
797
794
- /// Get the inner version from LeafVersion
798
+ /// Get consensus representation of the [` LeafVersion`].
795
799
pub fn into_consensus ( self ) -> u8 {
796
800
match self {
797
801
LeafVersion :: TapScript => TAPROOT_LEAF_TAPSCRIPT ,
You can’t perform that action at this time.
0 commit comments