mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Implement Gloas withdrawals and refactor (#8692)
Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
This commit is contained in:
@@ -32,7 +32,7 @@ pub fn get_next_withdrawals<T: BeaconChainTypes>(
|
||||
}
|
||||
|
||||
match get_expected_withdrawals(&state, &chain.spec) {
|
||||
Ok((withdrawals, _)) => Ok(withdrawals),
|
||||
Ok(expected_withdrawals) => Ok(expected_withdrawals.into()),
|
||||
Err(e) => Err(warp_utils::reject::custom_server_error(format!(
|
||||
"failed to get expected withdrawal: {:?}",
|
||||
e
|
||||
|
||||
@@ -634,7 +634,7 @@ pub async fn proposer_boost_re_org_test(
|
||||
assert_eq!(state_b.slot(), slot_b);
|
||||
let pre_advance_withdrawals = get_expected_withdrawals(&state_b, &harness.chain.spec)
|
||||
.unwrap()
|
||||
.0
|
||||
.withdrawals()
|
||||
.to_vec();
|
||||
complete_state_advance(&mut state_b, None, slot_c, &harness.chain.spec).unwrap();
|
||||
|
||||
@@ -724,7 +724,7 @@ pub async fn proposer_boost_re_org_test(
|
||||
get_expected_withdrawals(&state_b, &harness.chain.spec)
|
||||
}
|
||||
.unwrap()
|
||||
.0
|
||||
.withdrawals()
|
||||
.to_vec();
|
||||
let payload_attribs_withdrawals = payload_attribs.withdrawals().unwrap();
|
||||
assert_eq!(expected_withdrawals, *payload_attribs_withdrawals);
|
||||
|
||||
@@ -6660,7 +6660,8 @@ impl ApiTester {
|
||||
}
|
||||
let expected_withdrawals = get_expected_withdrawals(&state, &self.chain.spec)
|
||||
.unwrap()
|
||||
.0;
|
||||
.withdrawals()
|
||||
.to_vec();
|
||||
|
||||
// fetch expected withdrawals from the client
|
||||
let result = self.client.get_expected_withdrawals(&state_id).await;
|
||||
@@ -6668,7 +6669,7 @@ impl ApiTester {
|
||||
Ok(withdrawal_response) => {
|
||||
assert_eq!(withdrawal_response.execution_optimistic, Some(false));
|
||||
assert_eq!(withdrawal_response.finalized, Some(false));
|
||||
assert_eq!(withdrawal_response.data, expected_withdrawals.to_vec());
|
||||
assert_eq!(withdrawal_response.data, expected_withdrawals);
|
||||
}
|
||||
Err(_) => {
|
||||
panic!("query failed incorrectly");
|
||||
|
||||
Reference in New Issue
Block a user