Check fuzz workspace formatting in CI
What changed, and why it matters
This commit only adds a code-formatting check for the fuzz testing workspace in the project's continuous integration (CI). It also reformats a few lines in one fuzz test file to satisfy the new check. There is no functional code change and no security impact.
No security action needed. This is a routine code-style/CI hygiene change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change extends the existing rustfmt CI job to run cargo fmt --check inside the fuzz/ workspace. The only code edits in fuzz/src/chanmon_consistency.rs are whitespace/line-break adjustments that make the file conform to rustfmt rules. No logic, API, or behavior was altered.
Changed components
.github/workflows/build.ymlfuzz/src/chanmon_consistency.rsInspect captured patch +9 / −7
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d6a5ded..1c34d8b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -305,6 +305,8 @@ jobs:
run: cargo fmt --check
- name: Run rustfmt checks on lightning-tests
run: cd lightning-tests && cargo fmt --check
+ - name: Run rustfmt checks on fuzz
+ run: cd fuzz && cargo fmt --check
tor-connect:
runs-on: ubuntu-latest
env:
diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs
index 655fb76..d678d97 100644
--- a/fuzz/src/chanmon_consistency.rs
+++ b/fuzz/src/chanmon_consistency.rs
@@ -208,9 +208,7 @@ impl ChainState {
fn is_outpoint_spent(&self, outpoint: &bitcoin::OutPoint) -> bool {
self.blocks.iter().any(|(_, txs)| {
- txs.iter().any(|tx| {
- tx.input.iter().any(|input| input.previous_output == *outpoint)
- })
+ txs.iter().any(|tx| tx.input.iter().any(|input| input.previous_output == *outpoint))
})
}
@@ -1027,7 +1025,8 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
}
let network = Network::Bitcoin;
let best_block_timestamp = genesis_block(network).header.time;
- let params = ChainParameters { network, best_block: BlockLocator::from_network(network) };
+ let params =
+ ChainParameters { network, best_block: BlockLocator::from_network(network) };
(
ChannelManager::new(
$fee_estimator.clone(),
@@ -1142,8 +1141,8 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
channel_monitors: monitor_refs,
};
- let manager =
- <(BlockLocator, ChanMan)>::read(&mut &ser[..], read_args).expect("Failed to read manager");
+ let manager = <(BlockLocator, ChanMan)>::read(&mut &ser[..], read_args)
+ .expect("Failed to read manager");
let res = (manager.1, chain_monitor.clone());
for (channel_id, mon) in monitors.drain() {
assert_eq!(
@@ -2106,7 +2105,8 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
},
events::Event::SpliceFailed { .. } => {},
events::Event::DiscardFunding {
- funding_info: events::FundingInfo::Contribution { .. }
+ funding_info:
+ events::FundingInfo::Contribution { .. }
| events::FundingInfo::Tx { .. },
..
} => {},
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.