Improve documentation of `WitnessVersion`

Attempt to improve the rustdocs for `WitnessVersion` in line with
review comments from a previous patch.
This commit is contained in:
Tobin Harding 2021-11-19 09:35:14 +11:00
parent eb8278fd2e
commit 804a38cb67
1 changed files with 6 additions and 4 deletions

View File

@ -177,11 +177,13 @@ impl FromStr for AddressType {
}
}
/// Version of the witness program: first byte of `scriptPubkey` in transaction output for
/// transactions starting with opcodes ranging from 0 to 16 (inclusive).
/// Version of the witness program.
///
/// Helps to limit possible version of the witness according to the specification; if a plain `u8`
/// type was be used instead it would mean that version may be > 16, which is incorrect.
/// Helps limit possible versions of the witness according to the specification. If a plain `u8`
/// type was used instead it would mean that the version may be > 16, which would be incorrect.
///
/// First byte of `scriptPubkey` in transaction output for transactions starting with opcodes
/// ranging from 0 to 16 (inclusive).
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
#[repr(u8)]
pub enum WitnessVersion {