Improve docs on associated consts

In #3308 we added associated consts to the `Txid`, `Wtxid`, and
`OutPoint` types. During review and afterwards we realised the docs
could do with improving. Since we now want to move the types we should
do this first.

Close: #3331
This commit is contained in:
Tobin C. Harding 2024-09-10 08:58:34 +10:00
parent 68c9e28165
commit d69c241b5c
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 4 additions and 5 deletions

View File

@ -67,10 +67,9 @@ impl Txid {
impl Wtxid {
/// The `Wtxid` of a coinbase transaction.
///
/// This is used as the wTXID for the coinbase transaction when constructing blocks,
/// since the coinbase transaction contains a commitment to all transactions' wTXIDs
/// but naturally cannot commit to its own. It is not a real wTXID and should not be
/// used in other contexts.
/// This is used as the wTXID for the coinbase transaction when constructing blocks (in the
/// witness commitment tree) since the coinbase transaction contains a commitment to all
/// transactions' wTXIDs but naturally cannot commit to its own.
pub const COINBASE: Self = Self::from_byte_array([0; 32]);
/// The "all zeros" wTXID.
@ -117,7 +116,7 @@ impl OutPoint {
/// The `OutPoint` used in a coinbase prevout.
///
/// This is used as the dummy input for coinbase transactions because they don't have any
/// previous outputs. This is not a real outpoint and should not be used in any other contexts.
/// previous outputs. In other words, does not point to a real transaction.
pub const COINBASE_PREVOUT: Self = Self { txid: Txid::COINBASE_PREVOUT, vout: u32::MAX };
/// Creates a new [`OutPoint`].