Use blockdata exports

We now export `blockdata` submodules at the crate root level. Use the
new exports for all rustdoc tests/examples.
This commit is contained in:
Tobin C. Harding 2022-08-08 14:45:17 +10:00
parent 4a119e5624
commit 6095a4de9b
5 changed files with 7 additions and 9 deletions

View File

@ -81,7 +81,7 @@ impl BlockHeader {
/// [`Uint256`]: ../../util/uint/struct.Uint256.html
///
/// ```
/// use bitcoin::blockdata::block::BlockHeader;
/// use bitcoin::block::BlockHeader;
///
/// assert_eq!(0x1d00ffff,
/// BlockHeader::compact_target_from_u256(

View File

@ -293,7 +293,7 @@ impl LockTime {
///
/// # Examples
/// ```no_run
/// # use bitcoin::blockdata::locktime::{LockTime, Height, Time};
/// # use bitcoin::locktime::{LockTime, Height, Time};
/// // Can be implemented if block chain data is available.
/// fn get_height() -> Height { todo!("return the current block height") }
/// fn get_time() -> Time { todo!("return the current block time") }
@ -420,7 +420,7 @@ impl Height {
///
/// # Examples
/// ```rust
/// use bitcoin::blockdata::locktime::Height;
/// use bitcoin::locktime::Height;
///
/// let h: u32 = 741521;
/// let height = Height::from_consensus(h).expect("invalid height value");
@ -503,7 +503,7 @@ impl Time {
///
/// # Examples
/// ```rust
/// use bitcoin::blockdata::locktime::Time;
/// use bitcoin::locktime::Time;
///
/// let t: u32 = 1653195600; // May 22nd, 5am UTC.
/// let time = Time::from_consensus(t).expect("invalid time value");

View File

@ -72,7 +72,7 @@ impl OutPoint {
/// # Examples
///
/// ```rust
/// use bitcoin::blockdata::constants::genesis_block;
/// use bitcoin::constants::genesis_block;
/// use bitcoin::network::constants::Network;
///
/// let block = genesis_block(Network::Bitcoin);

View File

@ -78,8 +78,8 @@ impl<R: DerefMut<Target = Transaction>> SigHashCache<R> {
/// panics if `input_index` is out of bounds with respect of the number of inputs
///
/// ```
/// use bitcoin::util::bip143::SigHashCache;
/// use bitcoin::{EcdsaSighashType, Script, Transaction, PackedLockTime};
/// use bitcoin::util::bip143::SigHashCache;
///
/// let mut tx_to_sign = Transaction { version: 2, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: Vec::new() };
/// let input_count = tx_to_sign.input.len();

View File

@ -1035,9 +1035,7 @@ impl<R: DerefMut<Target=Transaction>> SighashCache<R> {
///
/// This allows in-line signing such as
/// ```
/// use bitcoin::blockdata::transaction::Transaction;
/// use bitcoin::util::sighash::{EcdsaSighashType, SighashCache};
/// use bitcoin::{PackedLockTime, Script};
/// use bitcoin::{EcdsaSighashType, PackedLockTime, Script, SighashCache, Transaction};
///
/// let mut tx_to_sign = Transaction { version: 2, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: Vec::new() };
/// let input_count = tx_to_sign.input.len();