Skip to content

Commit

Permalink
Fix incorrect HRP docs
Browse files Browse the repository at this point in the history
Fix cut'n'pasta error, this is the `hrp` struct not an hrpstring.
  • Loading branch information
tcharding committed Jan 12, 2024
1 parent 9f7c21a commit 521d963
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/primitives/hrp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl Hrp {
#[allow(clippy::len_without_is_empty)] // HRP is never empty.
pub fn len(&self) -> usize { self.size }

/// Returns `true` if this [`Hrp`] is valid according to the bips.
/// Returns `true` if this HRP is valid according to the bips.
///
/// [BIP-173] states that the HRP must be either "bc" or "tb".
///
Expand All @@ -201,19 +201,19 @@ impl Hrp {
self.is_valid_on_mainnet() || self.is_valid_on_testnet()
}

/// Returns `true` if this hrpstring is valid on the Bitcoin network i.e., HRP is "bc".
/// Returns `true` if this HRP is valid on the Bitcoin network i.e., HRP is "bc".
#[inline]
pub fn is_valid_on_mainnet(&self) -> bool { *self == self::BC }

/// Returns `true` if this hrpstring is valid on the Bitcoin testnet network i.e., HRP is "tb".
/// Returns `true` if this HRP is valid on the Bitcoin testnet network i.e., HRP is "tb".
#[inline]
pub fn is_valid_on_testnet(&self) -> bool { *self == self::TB }

/// Returns `true` if this hrpstring is valid on the Bitcoin signet network i.e., HRP is "tb".
/// Returns `true` if this HRP is valid on the Bitcoin signet network i.e., HRP is "tb".
#[inline]
pub fn is_valid_on_signet(&self) -> bool { *self == self::TB }

/// Returns `true` if this hrpstring is valid on the Bitcoin regtest network i.e., HRP is "bcrt".
/// Returns `true` if this HRP is valid on the Bitcoin regtest network i.e., HRP is "bcrt".
#[inline]
pub fn is_valid_on_regtest(&self) -> bool { *self == self::BCRT }
}
Expand Down

0 comments on commit 521d963

Please sign in to comment.