Skip to content

Commit 762bdfb

Browse files
committed
refactor rename apply_initial_deposit to add_validator_to_registry
1 parent b044e6d commit 762bdfb

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/lambda_ethereum_consensus/state_transition/epoch_processing.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ defmodule LambdaEthereumConsensus.StateTransition.EpochProcessing do
593593
{:ok, BeaconState.increase_balance(state, index, deposit.amount)}
594594

595595
!current_validator? && valid_signature? ->
596-
Mutators.apply_initial_deposit(
596+
Mutators.add_validator_to_registry(
597597
state,
598598
deposit.pubkey,
599599
deposit.withdrawal_credentials,

lib/lambda_ethereum_consensus/state_transition/mutators.ex

+8-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ defmodule LambdaEthereumConsensus.StateTransition.Mutators do
139139
if current_validator? do
140140
state
141141
else
142-
{:ok, state} = apply_initial_deposit(state, pubkey, withdrawal_credentials, 0)
142+
{:ok, state} = add_validator_to_registry(state, pubkey, withdrawal_credentials, 0)
143143
state
144144
end
145145

@@ -159,9 +159,14 @@ defmodule LambdaEthereumConsensus.StateTransition.Mutators do
159159
end
160160
end
161161

162-
@spec apply_initial_deposit(BeaconState.t(), Types.bls_pubkey(), Types.bytes32(), Types.gwei()) ::
162+
@spec add_validator_to_registry(
163+
BeaconState.t(),
164+
Types.bls_pubkey(),
165+
Types.bytes32(),
166+
Types.gwei()
167+
) ::
163168
{:ok, BeaconState.t()}
164-
def apply_initial_deposit(%BeaconState{} = state, pubkey, withdrawal_credentials, amount) do
169+
def add_validator_to_registry(%BeaconState{} = state, pubkey, withdrawal_credentials, amount) do
165170
Types.Deposit.get_validator_from_deposit(pubkey, withdrawal_credentials, amount)
166171
|> then(&Aja.Vector.append(state.validators, &1))
167172
|> then(

0 commit comments

Comments
 (0)