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:
parent
4a119e5624
commit
6095a4de9b
|
@ -81,7 +81,7 @@ impl BlockHeader {
|
||||||
/// [`Uint256`]: ../../util/uint/struct.Uint256.html
|
/// [`Uint256`]: ../../util/uint/struct.Uint256.html
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use bitcoin::blockdata::block::BlockHeader;
|
/// use bitcoin::block::BlockHeader;
|
||||||
///
|
///
|
||||||
/// assert_eq!(0x1d00ffff,
|
/// assert_eq!(0x1d00ffff,
|
||||||
/// BlockHeader::compact_target_from_u256(
|
/// BlockHeader::compact_target_from_u256(
|
||||||
|
|
|
@ -293,7 +293,7 @@ impl LockTime {
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # use bitcoin::blockdata::locktime::{LockTime, Height, Time};
|
/// # use bitcoin::locktime::{LockTime, Height, Time};
|
||||||
/// // Can be implemented if block chain data is available.
|
/// // Can be implemented if block chain data is available.
|
||||||
/// fn get_height() -> Height { todo!("return the current block height") }
|
/// fn get_height() -> Height { todo!("return the current block height") }
|
||||||
/// fn get_time() -> Time { todo!("return the current block time") }
|
/// fn get_time() -> Time { todo!("return the current block time") }
|
||||||
|
@ -420,7 +420,7 @@ impl Height {
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use bitcoin::blockdata::locktime::Height;
|
/// use bitcoin::locktime::Height;
|
||||||
///
|
///
|
||||||
/// let h: u32 = 741521;
|
/// let h: u32 = 741521;
|
||||||
/// let height = Height::from_consensus(h).expect("invalid height value");
|
/// let height = Height::from_consensus(h).expect("invalid height value");
|
||||||
|
@ -503,7 +503,7 @@ impl Time {
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use bitcoin::blockdata::locktime::Time;
|
/// use bitcoin::locktime::Time;
|
||||||
///
|
///
|
||||||
/// let t: u32 = 1653195600; // May 22nd, 5am UTC.
|
/// let t: u32 = 1653195600; // May 22nd, 5am UTC.
|
||||||
/// let time = Time::from_consensus(t).expect("invalid time value");
|
/// let time = Time::from_consensus(t).expect("invalid time value");
|
||||||
|
|
|
@ -72,7 +72,7 @@ impl OutPoint {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use bitcoin::blockdata::constants::genesis_block;
|
/// use bitcoin::constants::genesis_block;
|
||||||
/// use bitcoin::network::constants::Network;
|
/// use bitcoin::network::constants::Network;
|
||||||
///
|
///
|
||||||
/// let block = genesis_block(Network::Bitcoin);
|
/// let block = genesis_block(Network::Bitcoin);
|
||||||
|
|
|
@ -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
|
/// 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::{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 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();
|
/// let input_count = tx_to_sign.input.len();
|
||||||
|
|
|
@ -1035,9 +1035,7 @@ impl<R: DerefMut<Target=Transaction>> SighashCache<R> {
|
||||||
///
|
///
|
||||||
/// This allows in-line signing such as
|
/// This allows in-line signing such as
|
||||||
/// ```
|
/// ```
|
||||||
/// use bitcoin::blockdata::transaction::Transaction;
|
/// use bitcoin::{EcdsaSighashType, PackedLockTime, Script, SighashCache, Transaction};
|
||||||
/// use bitcoin::util::sighash::{EcdsaSighashType, SighashCache};
|
|
||||||
/// use bitcoin::{PackedLockTime, Script};
|
|
||||||
///
|
///
|
||||||
/// let mut tx_to_sign = Transaction { version: 2, lock_time: PackedLockTime::ZERO, input: Vec::new(), output: Vec::new() };
|
/// 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();
|
/// let input_count = tx_to_sign.input.len();
|
||||||
|
|
Loading…
Reference in New Issue