Merge rust-bitcoin/rust-bitcoin#1810: Spelling and typo fixes

20b812dc66 Spelling and typo fixes (yancy)

Pull request description:

  Fix some types in Transaction.rs and encode.rs

ACKs for top commit:
  apoelstra:
    ACK 20b812dc66
  Kixunil:
    ACK 20b812dc66
  tcharding:
    ACK 20b812dc66

Tree-SHA512: d613189932ecb760be385c4095723501222cc8cec8b25525b58f76f9486d33fe46ab241bd2c098ea141f0fd12bb52abc677eba4a0cf3fe5b40b515bd75c7237c
This commit is contained in:
Andrew Poelstra 2023-04-26 00:25:38 +00:00
commit 967b58dc2a
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
2 changed files with 7 additions and 7 deletions

View File

@ -183,7 +183,7 @@ impl core::str::FromStr for OutPoint {
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(crate = "actual_serde"))] #[cfg_attr(feature = "serde", serde(crate = "actual_serde"))]
pub struct TxIn { pub struct TxIn {
/// The reference to the previous output that is being used an an input. /// The reference to the previous output that is being used as an input.
pub previous_output: OutPoint, pub previous_output: OutPoint,
/// The script which pushes values on the stack which will cause /// The script which pushes values on the stack which will cause
/// the referenced output's script to be accepted. /// the referenced output's script to be accepted.
@ -191,7 +191,7 @@ pub struct TxIn {
/// The sequence number, which suggests to miners which of two /// The sequence number, which suggests to miners which of two
/// conflicting transactions should be preferred, or 0xFFFFFFFF /// conflicting transactions should be preferred, or 0xFFFFFFFF
/// to ignore this feature. This is generally never used since /// to ignore this feature. This is generally never used since
/// the miner behaviour cannot be enforced. /// the miner behavior cannot be enforced.
pub sequence: Sequence, pub sequence: Sequence,
/// Witness data: an array of byte-arrays. /// Witness data: an array of byte-arrays.
/// Note that this field is *not* (de)serialized with the rest of the TxIn in /// Note that this field is *not* (de)serialized with the rest of the TxIn in
@ -230,7 +230,7 @@ impl TxIn {
(36 + VarInt(script_sig_size as u64).len() + script_sig_size + 4) * 4 (36 + VarInt(script_sig_size as u64).len() + script_sig_size + 4) * 4
} }
/// The weight of the TxIn when it's included in a segwit transaction (i.e., a transcation /// The weight of the TxIn when it's included in a segwit transaction (i.e., a transaction
/// having at least one segwit input). /// having at least one segwit input).
/// ///
/// This always takes into account the witness, even when empty, in which /// This always takes into account the witness, even when empty, in which
@ -261,7 +261,7 @@ impl Default for TxIn {
/// - Indicating whether absolute lock-time (specified in `lock_time` field of [`Transaction`]) /// - Indicating whether absolute lock-time (specified in `lock_time` field of [`Transaction`])
/// is enabled. /// is enabled.
/// - Indicating and encoding [BIP-68] relative lock-times. /// - Indicating and encoding [BIP-68] relative lock-times.
/// - Indicating whether a transcation opts-in to [BIP-125] replace-by-fee. /// - Indicating whether a transaction opts-in to [BIP-125] replace-by-fee.
/// ///
/// Note that transactions spending an output with `OP_CHECKLOCKTIMEVERIFY`MUST NOT use /// Note that transactions spending an output with `OP_CHECKLOCKTIMEVERIFY`MUST NOT use
/// `Sequence::MAX` for the corresponding input. [BIP-65] /// `Sequence::MAX` for the corresponding input. [BIP-65]
@ -353,7 +353,7 @@ impl Sequence {
self.is_relative_lock_time() & (self.0 & Sequence::LOCK_TYPE_MASK == 0) self.is_relative_lock_time() & (self.0 & Sequence::LOCK_TYPE_MASK == 0)
} }
/// Returns `true` if the sequene number encodes a time interval based relative lock-time. /// Returns `true` if the sequence number encodes a time interval based relative lock-time.
#[inline] #[inline]
pub fn is_time_locked(&self) -> bool { pub fn is_time_locked(&self) -> bool {
self.is_relative_lock_time() & (self.0 & Sequence::LOCK_TYPE_MASK > 0) self.is_relative_lock_time() & (self.0 & Sequence::LOCK_TYPE_MASK > 0)

View File

@ -276,7 +276,7 @@ pub trait Decodable: Sized {
/// Like `consensus_decode` but relies on the reader being limited in the amount of data it /// Like `consensus_decode` but relies on the reader being limited in the amount of data it
/// returns, e.g. by being wrapped in [`std::io::Take`]. /// returns, e.g. by being wrapped in [`std::io::Take`].
/// ///
/// Failling to obide to this requirement might lead to memory exhaustion caused by malicious /// Failing to abide to this requirement might lead to memory exhaustion caused by malicious
/// inputs. /// inputs.
/// ///
/// Users should default to `consensus_decode`, but when data to be decoded is already in a byte /// Users should default to `consensus_decode`, but when data to be decoded is already in a byte
@ -572,7 +572,7 @@ macro_rules! impl_vec {
r: &mut R, r: &mut R,
) -> Result<Self, Error> { ) -> Result<Self, Error> {
let len = VarInt::consensus_decode_from_finite_reader(r)?.0; let len = VarInt::consensus_decode_from_finite_reader(r)?.0;
// Do not allocate upfront more items than if the sequnce of type // Do not allocate upfront more items than if the sequence of type
// occupied roughly quarter a block. This should never be the case // occupied roughly quarter a block. This should never be the case
// for normal data, but even if that's not true - `push` will just // for normal data, but even if that's not true - `push` will just
// reallocate. // reallocate.