2025-02-02 automated rustfmt nightly

This commit is contained in:
Fmt Bot 2025-02-02 01:18:01 +00:00 committed by github-actions[bot]
parent 5ac27b91a1
commit 282bc14d6e
3 changed files with 5 additions and 6 deletions

View File

@ -994,7 +994,7 @@ impl<R: Borrow<Transaction>> SighashCache<R> {
match sighash { match sighash {
EcdsaSighashType::All => { EcdsaSighashType::All => {
self_.output.consensus_encode(writer)?; self_.output.consensus_encode(writer)?;
}, }
EcdsaSighashType::Single => { EcdsaSighashType::Single => {
// sign all outputs up to and including this one, but erase // sign all outputs up to and including this one, but erase
// all of them except for this one // all of them except for this one
@ -1002,13 +1002,14 @@ impl<R: Borrow<Transaction>> SighashCache<R> {
writer.emit_compact_size(count + 1)?; writer.emit_compact_size(count + 1)?;
for _ in 0..count { for _ in 0..count {
// consensus encoding of the "NULL txout" - max amount, empty script_pubkey // 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)?; self_.output[count].consensus_encode(writer)?;
}, }
EcdsaSighashType::None => { EcdsaSighashType::None => {
writer.emit_compact_size(0u8)?; writer.emit_compact_size(0u8)?;
}, }
_ => unreachable!(), _ => unreachable!(),
}; };
self_.lock_time.consensus_encode(writer)?; self_.lock_time.consensus_encode(writer)?;

View File

@ -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_same));
assert!(lock_by_time.is_satisfied_by(height, time_after)); assert!(lock_by_time.is_satisfied_by(height, time_after));
assert!(!lock_by_time.is_satisfied_by(height, time_before)); assert!(!lock_by_time.is_satisfied_by(height, time_before));
} }
#[test] #[test]

View File

@ -95,7 +95,6 @@ impl<'a> Arbitrary<'a> for ScriptBuf {
} }
} }
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;