removed verify_exit_time_independent_only function (#2509)
## Issue Addressed Closes #1676 ## Proposed Changes Removed unneeded functions `verify_exit_parametric` and `verify_exit_time_independent_only`
This commit is contained in:
parent
bc14d1d73d
commit
6b65b6f3bd
@ -20,7 +20,7 @@ pub use verify_attestation::{
|
||||
pub use verify_deposit::{
|
||||
get_existing_validator_index, verify_deposit_merkle_proof, verify_deposit_signature,
|
||||
};
|
||||
pub use verify_exit::{verify_exit, verify_exit_time_independent_only};
|
||||
pub use verify_exit::verify_exit;
|
||||
|
||||
pub mod altair;
|
||||
pub mod block_signature_verifier;
|
||||
|
@ -19,35 +19,10 @@ fn error(reason: ExitInvalid) -> BlockOperationError<ExitInvalid> {
|
||||
///
|
||||
/// Spec v0.12.1
|
||||
pub fn verify_exit<T: EthSpec>(
|
||||
state: &BeaconState<T>,
|
||||
exit: &SignedVoluntaryExit,
|
||||
verify_signatures: VerifySignatures,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<()> {
|
||||
verify_exit_parametric(state, exit, verify_signatures, spec, false)
|
||||
}
|
||||
|
||||
/// Like `verify_exit` but doesn't run checks which may become true in future states.
|
||||
///
|
||||
/// Spec v0.12.1
|
||||
pub fn verify_exit_time_independent_only<T: EthSpec>(
|
||||
state: &BeaconState<T>,
|
||||
exit: &SignedVoluntaryExit,
|
||||
verify_signatures: VerifySignatures,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<()> {
|
||||
verify_exit_parametric(state, exit, verify_signatures, spec, true)
|
||||
}
|
||||
|
||||
/// Parametric version of `verify_exit` that skips some checks if `time_independent_only` is true.
|
||||
///
|
||||
/// Spec v0.12.1
|
||||
fn verify_exit_parametric<T: EthSpec>(
|
||||
state: &BeaconState<T>,
|
||||
signed_exit: &SignedVoluntaryExit,
|
||||
verify_signatures: VerifySignatures,
|
||||
spec: &ChainSpec,
|
||||
time_independent_only: bool,
|
||||
) -> Result<()> {
|
||||
let exit = &signed_exit.message;
|
||||
|
||||
@ -70,7 +45,7 @@ fn verify_exit_parametric<T: EthSpec>(
|
||||
|
||||
// Exits must specify an epoch when they become valid; they are not valid before then.
|
||||
verify!(
|
||||
time_independent_only || state.current_epoch() >= exit.epoch,
|
||||
state.current_epoch() >= exit.epoch,
|
||||
ExitInvalid::FutureEpoch {
|
||||
state: state.current_epoch(),
|
||||
exit: exit.epoch
|
||||
|
Loading…
Reference in New Issue
Block a user