Rename Functions to More Closely Match Spec (#5591)

* Rename Functions to More Closely Match Spec
This commit is contained in:
ethDreamer
2024-04-16 14:03:08 -05:00
committed by GitHub
parent f68989815c
commit cda926ce1b
6 changed files with 11 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ pub fn initiate_validator_exit<E: EthSpec>(
.map_or(delayed_epoch, |epoch| max(epoch, delayed_epoch));
let exit_queue_churn = state.exit_cache().get_churn_at(exit_queue_epoch)?;
if exit_queue_churn >= state.get_churn_limit(spec)? {
if exit_queue_churn >= state.get_validator_churn_limit(spec)? {
exit_queue_epoch.safe_add_assign(1)?;
}

View File

@@ -1,5 +1,5 @@
use super::per_block_processing::{
errors::BlockProcessingError, process_operations::process_deposit,
errors::BlockProcessingError, process_operations::apply_deposit,
};
use crate::common::DepositDataTree;
use crate::upgrade::{
@@ -37,7 +37,7 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
.push_leaf(deposit.data.tree_hash_root())
.map_err(BlockProcessingError::MerkleTreeError)?;
state.eth1_data_mut().deposit_root = deposit_tree.root();
process_deposit(&mut state, deposit, spec, true)?;
apply_deposit(&mut state, deposit, spec, true)?;
}
process_activations(&mut state, spec)?;

View File

@@ -371,14 +371,14 @@ pub fn process_deposits<E: EthSpec>(
// Update the state in series.
for deposit in deposits {
process_deposit(state, deposit, spec, false)?;
apply_deposit(state, deposit, spec, false)?;
}
Ok(())
}
/// Process a single deposit, optionally verifying its merkle proof.
pub fn process_deposit<E: EthSpec>(
pub fn apply_deposit<E: EthSpec>(
state: &mut BeaconState<E>,
deposit: &Deposit,
spec: &ChainSpec,

View File

@@ -120,7 +120,7 @@ pub fn process_epoch_single_pass<E: EthSpec>(
let next_epoch = state.next_epoch()?;
let is_in_inactivity_leak = state.is_in_inactivity_leak(previous_epoch, spec)?;
let total_active_balance = state.get_total_active_balance()?;
let churn_limit = state.get_churn_limit(spec)?;
let churn_limit = state.get_validator_churn_limit(spec)?;
let activation_churn_limit = state.get_activation_churn_limit(spec)?;
let finalized_checkpoint = state.finalized_checkpoint();
let fork_name = state.fork_name_unchecked();