Add more rustdocs to WitnessProgram
Add rustdocs to `WitnessProgram` commenting on why we carry the witness version number around with the witness program. This is mainly a dev comment but it helps document the invariants so make it a rustdoc comment.
This commit is contained in:
parent
89303c1464
commit
552f19abe3
|
@ -14,9 +14,13 @@ use crate::blockdata::script::witness_version::WitnessVersion;
|
||||||
use crate::blockdata::script::{PushBytes, PushBytesBuf, PushBytesErrorReport};
|
use crate::blockdata::script::{PushBytes, PushBytesBuf, PushBytesErrorReport};
|
||||||
|
|
||||||
/// The segregated witness program.
|
/// The segregated witness program.
|
||||||
|
///
|
||||||
|
/// The segregated witness program is technically only the program bytes _excluding_ the witness
|
||||||
|
/// version, however we maintain length invariants on the `program` that are governed by the version
|
||||||
|
/// number, therefore we carry the version number around along with the program bytes.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct WitnessProgram {
|
pub struct WitnessProgram {
|
||||||
/// The witness program version number.
|
/// The segwit version associated with this witness program.
|
||||||
version: WitnessVersion,
|
version: WitnessVersion,
|
||||||
/// The witness program (between 2 and 40 bytes).
|
/// The witness program (between 2 and 40 bytes).
|
||||||
program: PushBytesBuf,
|
program: PushBytesBuf,
|
||||||
|
|
Loading…
Reference in New Issue