Skip to content

Fix web-client validity check #15657

Fix web-client validity check

Fix web-client validity check #15657

Triggered via pull request April 23, 2026 05:46
Status Success
Total duration 26m 5s
Artifacts 1

build+test.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

21 warnings
called `unwrap` on `args.password` after checking its variant with `is_some`: pow-migration/src/main.rs#L118
warning: called `unwrap` on `args.password` after checking its variant with `is_some` --> pow-migration/src/main.rs:118:67 | 117 | let pow_client = if args.username.is_some() && args.password.is_some() { | ----------------------- the check is happening here 118 | Client::new_with_credentials(url, args.username.unwrap(), args.password.unwrap()) | ^^^^^^^^^^^^^^^^^^^^^^ | = help: try using `if let` or `match` = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap
called `unwrap` on `args.username` after checking its variant with `is_some`: pow-migration/src/main.rs#L118
warning: called `unwrap` on `args.username` after checking its variant with `is_some` --> pow-migration/src/main.rs:118:43 | 117 | let pow_client = if args.username.is_some() && args.password.is_some() { | ----------------------- the check is happening here 118 | Client::new_with_credentials(url, args.username.unwrap(), args.password.unwrap()) | ^^^^^^^^^^^^^^^^^^^^^^ | = help: try using `if let` or `match` = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
this `if` can be collapsed into the outer `match`: mempool/mempool-task/src/lib.rs#L160
warning: this `if` can be collapsed into the outer `match` --> mempool/mempool-task/src/lib.rs:160:17 | 160 | / if self.consensus.is_ready_for_validation() { 161 | | self.mempool.update(new_chain, old_chain); 162 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match help: collapse nested if block | 158 ~ BlockchainEvent::Rebranched(old_chain, new_chain) 159 | // Mempool updates are only done once we are synced. 160 ~ if self.consensus.is_ready_for_validation() => { 161 | self.mempool.update(new_chain, old_chain); 162 ~ } |
this `if` can be collapsed into the outer `match`: mempool/mempool-task/src/lib.rs#L147
warning: this `if` can be collapsed into the outer `match` --> mempool/mempool-task/src/lib.rs:147:17 | 147 | / if self.consensus.is_ready_for_validation() { 148 | | let block = self 149 | | .consensus 150 | | .blockchain ... | 155 | | self.mempool.update(&[(hash.clone(), block)], [].as_ref()); 156 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match help: collapse nested if block | 145 ~ BlockchainEvent::Extended(hash) 146 | // Mempool updates are only done once we are synced. 147 ~ if self.consensus.is_ready_for_validation() => { 148 | let block = self ... 155 | self.mempool.update(&[(hash.clone(), block)], [].as_ref()); 156 ~ } |
this `if` can be collapsed into the outer `match`: mempool/mempool-task/src/lib.rs#L140
warning: this `if` can be collapsed into the outer `match` --> mempool/mempool-task/src/lib.rs:140:17 | 140 | / if self.consensus.is_ready_for_validation() { 141 | | self.mempool.cleanup(); 142 | | debug!("Performed a mempool clean up because new history was adopted"); 143 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match = note: `#[warn(clippy::collapsible_match)]` on by default help: collapse nested if block | 138 ~ BlockchainEvent::HistoryAdopted(_) 139 | // Mempool updates are only done once we are synced. 140 ~ if self.consensus.is_ready_for_validation() => { 141 | self.mempool.cleanup(); 142 | debug!("Performed a mempool clean up because new history was adopted"); 143 ~ } |
called `unwrap` on `self.validity_requests` after checking its variant with `is_some`: consensus/src/sync/light/validity_window.rs#L158
warning: called `unwrap` on `self.validity_requests` after checking its variant with `is_some` --> consensus/src/sync/light/validity_window.rs:158:33 | 156 | if self.validity_requests.is_some() { | ----------------------------------- help: try: `if let Some(<item>) = &self.validity_requests` 157 | // We already have a synchoronization in progress, so we just add the peer 158 | let current_chunk = self.validity_requests.as_ref().unwrap().chunk_index; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
this `if` can be collapsed into the outer `match`: consensus/src/consensus/mod.rs#L529
warning: this `if` can be collapsed into the outer `match` --> consensus/src/consensus/mod.rs:529:17 | 529 | / if self.zkp_proxy.get_zkp_state().latest_block.block_number() 530 | | < Policy::election_block_before( 531 | | self.blockchain.read().election_head().block_number(), ... | 535 | | .request_zkp_from_peers(self.sync.peers(), false); 536 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match = note: `#[warn(clippy::collapsible_match)]` on by default help: collapse nested if block | 526 ~ SyncerProxy::History(_) 527 | // Only request a proof when we are too far from the last election head. ... 532 | ) 533 ~ => { 534 | self.zkp_proxy 535 | .request_zkp_from_peers(self.sync.peers(), false); 536 ~ } |
called `unwrap` on `self.pre_genesis` after checking its variant with `is_some`: blockchain/src/history/merged_history_store.rs#L392
warning: called `unwrap` on `self.pre_genesis` after checking its variant with `is_some` --> blockchain/src/history/merged_history_store.rs:392:13 | 389 | if epoch_number == 0 && self.pre_genesis.is_some() { | -------------------------- the check is happening here ... 392 | / self.pre_genesis 393 | | .as_ref() 394 | | .unwrap() | |_________________________^ | = help: try using `if let` or `match` = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap
called `unwrap` on `self.pre_genesis` after checking its variant with `is_some`: blockchain/src/history/merged_history_store.rs#L80
warning: called `unwrap` on `self.pre_genesis` after checking its variant with `is_some` --> blockchain/src/history/merged_history_store.rs:80:13 | 77 | if Policy::epoch_at(block_number) == 0 && self.pre_genesis.is_some() { | -------------------------- the check is happening here ... 80 | / self.pre_genesis 81 | | .as_ref() 82 | | .unwrap() | |_________________________^ | = help: try using `if let` or `match` = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
unused import: `MacroHeader`: light-blockchain/src/push.rs#L3
warning: unused import: `MacroHeader` --> light-blockchain/src/push.rs:3:37 | 3 | use nimiq_block::{Block, ForkProof, MacroHeader, MicroBlock}; | ^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
the variable `idx` is used as a loop counter: zkp-circuits/src/gadgets/compressed_vk.rs#L156
warning: the variable `idx` is used as a loop counter --> zkp-circuits/src/gadgets/compressed_vk.rs:156:13 | 156 | for elem in gamma_abc_g1.iter() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (idx, elem) in (4..).zip(gamma_abc_g1.iter())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#explicit_counter_loop
the variable `idx` is used as a loop counter: zkp-circuits/src/gadgets/compressed_vk.rs#L82
warning: the variable `idx` is used as a loop counter --> zkp-circuits/src/gadgets/compressed_vk.rs:82:13 | 82 | for elem in gamma_abc_g1.iter() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (idx, elem) in (4..).zip(gamma_abc_g1.iter())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#explicit_counter_loop = note: `#[warn(clippy::explicit_counter_loop)]` on by default
iterating on a map's values: network-libp2p/src/discovery/peer_contacts.rs#L530
warning: iterating on a map's values --> network-libp2p/src/discovery/peer_contacts.rs:530:9 | 530 | / self.peer_contacts.iter().filter_map(move |(_, contact)| { 531 | | if contact.matches(services) { 532 | | Some(Arc::clone(contact)) 533 | | } else { ... | 536 | | }) | |__________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#iter_kv_map = note: `#[warn(clippy::iter_kv_map)]` on by default help: try | 530 ~ self.peer_contacts.values().filter_map(|contact| { 531 + if contact.matches(services) { 532 + Some(Arc::clone(contact)) 533 + } else { 534 + None 535 + } 536 + }) |
this `if` can be collapsed into the outer `match`: network-libp2p/src/discovery/behaviour.rs#L257
warning: this `if` can be collapsed into the outer `match` --> network-libp2p/src/discovery/behaviour.rs:257:17 | 257 | / if other_established == 0 { 258 | | // This is the first connection to this peer 259 | | self.connected_peers.insert(peer_id); 260 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match help: collapse nested if block | 256 ~ }) 257 ~ if other_established == 0 => { 258 | // This is the first connection to this peer 259 | self.connected_peers.insert(peer_id); 260 ~ } |
this `if` can be collapsed into the outer `match`: network-libp2p/src/discovery/behaviour.rs#L247
warning: this `if` can be collapsed into the outer `match` --> network-libp2p/src/discovery/behaviour.rs:247:17 | 247 | / if remaining_established == 0 { 248 | | // There are no more remaining connections to this peer 249 | | self.connected_peers.remove(&peer_id); 250 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#collapsible_match = note: `#[warn(clippy::collapsible_match)]` on by default help: collapse nested if block | 246 ~ }) 247 ~ if remaining_established == 0 => { 248 | // There are no more remaining connections to this peer 249 | self.connected_peers.remove(&peer_id); 250 ~ } |
iterating on a map's keys: primitives/account/src/account/staking_contract/mod.rs#L255
warning: iterating on a map's keys --> primitives/account/src/account/staking_contract/mod.rs:255:47 | 255 | let unsupporting_validators: Vec<_> = self | _______________________________________________^ 256 | | .active_validators 257 | | .iter() 258 | | .filter_map(|(validator_address, _stake)| { ... | 267 | | }) | |______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#iter_kv_map = note: `#[warn(clippy::iter_kv_map)]` on by default help: try | 255 ~ let unsupporting_validators: Vec<_> = self 256 + .active_validators.keys().filter_map(|validator_address| { 257 + let validator = store 258 + .get_validator(validator_address) 259 + .expect("Active Validators must be present in the Staking Contract."); 260 + if !support_check(validator.signal_data) { 261 + Some((validator.address, Address::from(&validator.signing_key))) 262 + } else { 263 + None 264 + } 265 + }) |
iterating on a map's keys: primitives/account/src/account/staking_contract/mod.rs#L255
warning: iterating on a map's keys --> primitives/account/src/account/staking_contract/mod.rs:255:47 | 255 | let unsupporting_validators: Vec<_> = self | _______________________________________________^ 256 | | .active_validators 257 | | .iter() 258 | | .filter_map(|(validator_address, _stake)| { ... | 267 | | }) | |______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#iter_kv_map = note: `#[warn(clippy::iter_kv_map)]` on by default help: try | 255 ~ let unsupporting_validators: Vec<_> = self 256 + .active_validators.keys().filter_map(|validator_address| { 257 + let validator = store 258 + .get_validator(validator_address) 259 + .expect("Active Validators must be present in the Staking Contract."); 260 + if !support_check(validator.signal_data) { 261 + Some((validator.address, Address::from(&validator.signing_key))) 262 + } else { 263 + None 264 + } 265 + }) |
called `unwrap` on `signature_proof.webauthn_fields` after checking its variant with `is_some`: primitives/transaction/src/lib.rs#L733
warning: called `unwrap` on `signature_proof.webauthn_fields` after checking its variant with `is_some` --> primitives/transaction/src/lib.rs:733:29 | 730 | if signature_proof.webauthn_fields.is_some() { | -------------------------------------------- help: try: `if let Some(<item>) = &signature_proof.webauthn_fields` ... 733 | signature_proof.webauthn_fields.as_ref().unwrap(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap
called `unwrap` on `self.webauthn_fields` after checking its variant with `is_some`: primitives/transaction/src/signature_proof.rs#L452
warning: called `unwrap` on `self.webauthn_fields` after checking its variant with `is_some` --> primitives/transaction/src/signature_proof.rs:452:50 | 451 | if self.webauthn_fields.is_some() { | --------------------------------- help: try: `if let Some(<item>) = &self.webauthn_fields` 452 | state.serialize_field(FIELDS[4], self.webauthn_fields.as_ref().unwrap())?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
called `unwrap` on `self.webauthn_fields` after checking its variant with `is_some`: primitives/transaction/src/signature_proof.rs#L452
warning: called `unwrap` on `self.webauthn_fields` after checking its variant with `is_some` --> primitives/transaction/src/signature_proof.rs:452:50 | 451 | if self.webauthn_fields.is_some() { | --------------------------------- help: try: `if let Some(<item>) = &self.webauthn_fields` 452 | state.serialize_field(FIELDS[4], self.webauthn_fields.as_ref().unwrap())?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
clippy
Node.js 20 actions are deprecated. The following actions are running on Node.js 20 and may not work as expected: actions-rs/clippy-check@v1. Actions will be forced to run with Node.js 24 by default starting June 2nd, 2026. Node.js 20 will be removed from the runner on September 16th, 2026. Please check if updated versions of these actions are available that support Node.js 24. To opt into Node.js 24 now, set the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable on the runner or in your workflow file. Once Node.js 24 becomes the default, you can temporarily opt out by setting ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/

Artifacts

Produced during runtime
Name Size Digest
reconnect-test-logs
283 KB
sha256:8c4d68ddc91c86d997caa4b8f1169fb6a4e66decd951849bc27612c5d08f3572