Skip to content

Commit bb18578

Browse files
committed
chore: make formatter happy
1 parent 31ab1d3 commit bb18578

File tree

3 files changed

+40
-27
lines changed

3 files changed

+40
-27
lines changed

beacon_node/http_api/src/lib.rs

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,23 +1141,32 @@ pub fn serve<T: BeaconChainTypes>(
11411141
|state, execution_optimistic, finalized| {
11421142
if !state.fork_name_unchecked().electra_enabled() {
11431143
return Err(warp_utils::reject::pre_electra_not_supported(
1144-
format!("state at epoch {} is not activated for Electra", state.current_epoch())
1144+
format!(
1145+
"state at epoch {} is not activated for Electra",
1146+
state.current_epoch()
1147+
),
11451148
));
11461149
}
11471150

11481151
let Ok(deposits) = state.pending_deposits() else {
1149-
return Err(warp_utils::reject::custom_bad_request("Pending deposits not found".to_string()));
1152+
return Err(warp_utils::reject::custom_bad_request(
1153+
"Pending deposits not found".to_string(),
1154+
));
11501155
};
11511156

1152-
Ok((deposits.iter().cloned().collect::<Vec<_>>(), execution_optimistic, finalized))
1153-
}
1157+
Ok((
1158+
deposits.iter().cloned().collect::<Vec<_>>(),
1159+
execution_optimistic,
1160+
finalized,
1161+
))
1162+
},
11541163
)?;
11551164

1156-
Ok(api_types::ExecutionOptimisticFinalizedResponse {
1157-
data,
1158-
execution_optimistic: Some(execution_optimistic),
1159-
finalized: Some(finalized),
1160-
})
1165+
Ok(api_types::ExecutionOptimisticFinalizedResponse {
1166+
data,
1167+
execution_optimistic: Some(execution_optimistic),
1168+
finalized: Some(finalized),
1169+
})
11611170
})
11621171
},
11631172
);
@@ -1178,28 +1187,36 @@ pub fn serve<T: BeaconChainTypes>(
11781187
|state, execution_optimistic, finalized| {
11791188
if !state.fork_name_unchecked().electra_enabled() {
11801189
return Err(warp_utils::reject::pre_electra_not_supported(
1181-
format!("state at epoch {} is not activated for Electra", state.current_epoch())
1190+
format!(
1191+
"state at epoch {} is not activated for Electra",
1192+
state.current_epoch()
1193+
),
11821194
));
11831195
}
11841196

11851197
let Ok(withdrawals) = state.pending_partial_withdrawals() else {
1186-
return Err(warp_utils::reject::custom_bad_request("Pending withdrawals not found".to_string()));
1198+
return Err(warp_utils::reject::custom_bad_request(
1199+
"Pending withdrawals not found".to_string(),
1200+
));
11871201
};
11881202

1189-
Ok((withdrawals.iter().cloned().collect::<Vec<_>>(), execution_optimistic, finalized))
1190-
}
1203+
Ok((
1204+
withdrawals.iter().cloned().collect::<Vec<_>>(),
1205+
execution_optimistic,
1206+
finalized,
1207+
))
1208+
},
11911209
)?;
11921210

1193-
Ok(api_types::ExecutionOptimisticFinalizedResponse {
1194-
data,
1195-
execution_optimistic: Some(execution_optimistic),
1196-
finalized: Some(finalized),
1197-
})
1211+
Ok(api_types::ExecutionOptimisticFinalizedResponse {
1212+
data,
1213+
execution_optimistic: Some(execution_optimistic),
1214+
finalized: Some(finalized),
1215+
})
11981216
})
11991217
},
12001218
);
12011219

1202-
12031220
// GET beacon/headers
12041221
//
12051222
// Note: this endpoint only returns information about blocks in the canonical chain. Given that

beacon_node/http_api/tests/tests.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,9 +1211,7 @@ impl ApiTester {
12111211
}
12121212

12131213
let state = state_opt.as_mut().expect("result should be none");
1214-
let expected = state
1215-
.pending_deposits()
1216-
.unwrap();
1214+
let expected = state.pending_deposits().unwrap();
12171215

12181216
assert_eq!(result.unwrap(), expected.to_vec());
12191217
}
@@ -1240,9 +1238,7 @@ impl ApiTester {
12401238
}
12411239

12421240
let state = state_opt.as_mut().expect("result should be none");
1243-
let expected = state
1244-
.pending_partial_withdrawals()
1245-
.unwrap();
1241+
let expected = state.pending_partial_withdrawals().unwrap();
12461242

12471243
assert_eq!(result.unwrap(), expected.to_vec());
12481244
}
@@ -6390,7 +6386,6 @@ async fn beacon_get_state_info_electra() {
63906386
.await;
63916387
}
63926388

6393-
63946389
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
63956390
async fn beacon_get_blocks() {
63966391
ApiTester::new()

common/eth2/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,8 @@ impl BeaconNodeHttpClient {
807807
pub async fn get_beacon_states_pending_partial_withdrawals(
808808
&self,
809809
state_id: StateId,
810-
) -> Result<Option<ExecutionOptimisticFinalizedResponse<Vec<PendingPartialWithdrawal>>>, Error> {
810+
) -> Result<Option<ExecutionOptimisticFinalizedResponse<Vec<PendingPartialWithdrawal>>>, Error>
811+
{
811812
let mut path = self.eth_path(V1)?;
812813

813814
path.path_segments_mut()

0 commit comments

Comments
 (0)