Skip to content

Commit

Permalink
Merge rust-bitcoin#3996: Automated nightly rustfmt (2025-02-02)
Browse files Browse the repository at this point in the history
282bc14 2025-02-02 automated rustfmt nightly (Fmt Bot)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK 282bc14; successfully ran local tests
  tcharding:
    ACK 282bc14

Tree-SHA512: 88771b5ed72cd357e1bf0bd12d2bbe12b2bb469e667172c8ab4d7beeab46df2270471a586e9b10d7296ef62fc92f7932e4fa7da5905136a7055d42902d580ee2
  • Loading branch information
apoelstra committed Feb 2, 2025
2 parents 9171499 + 282bc14 commit f81d10b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions bitcoin/src/crypto/sighash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,21 +994,22 @@ impl<R: Borrow<Transaction>> SighashCache<R> {
match sighash {
EcdsaSighashType::All => {
self_.output.consensus_encode(writer)?;
},
}
EcdsaSighashType::Single => {
// sign all outputs up to and including this one, but erase
// all of them except for this one
let count = input_index.min(self_.output.len() - 1);
writer.emit_compact_size(count + 1)?;
for _ in 0..count {
// consensus encoding of the "NULL txout" - max amount, empty script_pubkey
writer.write_all(&[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00])?;
writer
.write_all(&[0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00])?;
}
self_.output[count].consensus_encode(writer)?;
},
}
EcdsaSighashType::None => {
writer.emit_compact_size(0u8)?;
},
}
_ => unreachable!(),
};
self_.lock_time.consensus_encode(writer)?;
Expand Down
1 change: 0 additions & 1 deletion primitives/src/locktime/absolute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ mod tests {
assert!(lock_by_time.is_satisfied_by(height, time_same));
assert!(lock_by_time.is_satisfied_by(height, time_after));
assert!(!lock_by_time.is_satisfied_by(height, time_before));

}

#[test]
Expand Down
1 change: 0 additions & 1 deletion primitives/src/script/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ impl<'a> Arbitrary<'a> for ScriptBuf {
}
}


#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit f81d10b

Please sign in to comment.