Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierdmello committed Jul 24, 2024
1 parent 964adb7 commit df01883
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions consensus-core/src/consensus_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub fn apply_generic_update(
store.current_max_active_participants =
u64::max(store.current_max_active_participants, committee_bits);

let should_update_optimistic = committee_bits > safety_threshold(&store)
let should_update_optimistic = committee_bits > safety_threshold(store)
&& update.attested_header.slot > store.optimistic_header.slot;

if should_update_optimistic {
Expand Down Expand Up @@ -144,11 +144,11 @@ pub fn apply_generic_update(
let store_period = calc_sync_period(store.finalized_header.slot.into());

if store.next_sync_committee.is_none() {
store.next_sync_committee = update.next_sync_committee.clone();
store.next_sync_committee.clone_from(&update.next_sync_committee);
} else if update_finalized_period == store_period + 1 {
info!(target: "helios::consensus", "sync committee updated");
store.current_sync_committee = store.next_sync_committee.clone().unwrap();
store.next_sync_committee = update.next_sync_committee.clone();
store.next_sync_committee.clone_from(&update.next_sync_committee);
store.previous_max_active_participants = store.current_max_active_participants;
store.current_max_active_participants = 0;
}
Expand Down
10 changes: 5 additions & 5 deletions consensus/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl<R: ConsensusRpc> Inner<R> {
}

pub fn apply_update(&mut self, update: &Update) {
let new_checkpoint = apply_update(&mut self.store, &update);
let new_checkpoint = apply_update(&mut self.store, update);
if new_checkpoint.is_some() {
self.last_checkpoint = new_checkpoint;
}
Expand Down Expand Up @@ -456,11 +456,11 @@ impl<R: ConsensusRpc> Inner<R> {
}

fn apply_finality_update(&mut self, update: &FinalityUpdate) {
let new_checkpoint = apply_finality_update(&mut self.store, &update);
let new_checkpoint = apply_finality_update(&mut self.store, update);
if new_checkpoint.is_some() {
self.last_checkpoint = new_checkpoint;
}
self.log_finality_update(&update);
self.log_finality_update(update);
}

fn log_finality_update(&self, update: &FinalityUpdate) {
Expand All @@ -482,11 +482,11 @@ impl<R: ConsensusRpc> Inner<R> {
}

fn apply_optimistic_update(&mut self, update: &OptimisticUpdate) {
let new_checkpoint = apply_optimistic_update(&mut self.store, &update);
let new_checkpoint = apply_optimistic_update(&mut self.store, update);
if new_checkpoint.is_some() {
self.last_checkpoint = new_checkpoint;
}
self.log_optimistic_update(&update);
self.log_optimistic_update(update);
}

fn log_optimistic_update(&self, update: &OptimisticUpdate) {
Expand Down
4 changes: 2 additions & 2 deletions execution/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub fn verify_proof(proof: &[Bytes], root: &[u8], path: &[u8], value: &[u8]) ->
}
} else {
let nibble = get_nibble(path, path_offset);
expected_hash = node_list[nibble as usize].clone();
expected_hash.clone_from(&node_list[nibble as usize]);

path_offset += 1;
}
Expand Down Expand Up @@ -55,7 +55,7 @@ pub fn verify_proof(proof: &[Bytes], root: &[u8], path: &[u8], value: &[u8]) ->
return false;
}
path_offset += prefix_length;
expected_hash = node_list[1].clone();
expected_hash.clone_from(&node_list[1]);
}
} else {
return false;
Expand Down

0 comments on commit df01883

Please sign in to comment.