Skip to content

Commit

Permalink
Format fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmygchen committed Feb 5, 2024
1 parent c3f4b6b commit 42db70a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 4 additions & 2 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,8 @@ pub fn serve<T: BeaconChainTypes>(
let epoch = query.epoch.unwrap_or(current_epoch);
Ok((
state
.get_built_sync_committee(epoch, &chain.spec).cloned()
.get_built_sync_committee(epoch, &chain.spec)
.cloned()
.map_err(|e| match e {
BeaconStateError::SyncCommitteeNotKnown { .. } => {
warp_utils::reject::custom_bad_request(format!(
Expand Down Expand Up @@ -2856,7 +2857,8 @@ pub fn serve<T: BeaconChainTypes>(
"0x{}",
hex::encode(
meta_data
.syncnets().cloned()
.syncnets()
.cloned()
.unwrap_or_default()
.into_bytes()
)
Expand Down
6 changes: 4 additions & 2 deletions beacon_node/network/src/subnet_service/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ mod attestation_service {
&attestation_service.beacon_chain.spec,
)
.unwrap();
let expected = [SubnetServiceMessage::Subscribe(Subnet::Attestation(subnet_id)),
SubnetServiceMessage::Unsubscribe(Subnet::Attestation(subnet_id))];
let expected = [
SubnetServiceMessage::Subscribe(Subnet::Attestation(subnet_id)),
SubnetServiceMessage::Unsubscribe(Subnet::Attestation(subnet_id)),
];

// Wait for 1 slot duration to get the unsubscription event
let events = get_events(
Expand Down
3 changes: 2 additions & 1 deletion beacon_node/store/src/hot_cold_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,8 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
) -> Result<Hash256, HotColdDBError> {
high_restore_point
.get_block_root(slot)
.or_else(|_| high_restore_point.get_oldest_block_root()).copied()
.or_else(|_| high_restore_point.get_oldest_block_root())
.copied()
.map_err(HotColdDBError::RestorePointBlockHashError)
}

Expand Down
4 changes: 1 addition & 3 deletions consensus/cached_tree_hash/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ pub fn hash256_iter(
values.iter().copied().map(Hash256::to_fixed_bytes)
}

pub fn u64_iter(
values: &[u64],
) -> impl ExactSizeIterator<Item = [u8; BYTES_PER_CHUNK]> + '_ {
pub fn u64_iter(values: &[u64]) -> impl ExactSizeIterator<Item = [u8; BYTES_PER_CHUNK]> + '_ {
let type_size = size_of::<u64>();
let vals_per_chunk = BYTES_PER_CHUNK / type_size;
values.chunks(vals_per_chunk).map(move |xs| {
Expand Down

0 comments on commit 42db70a

Please sign in to comment.