Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

refactor/slash-validator #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/BeaconChain/BeaconChain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ extension BeaconChain {

extension BeaconChain {

static func slashValidator(state: inout BeaconState, index: ValidatorIndex) {
static func slash(_ state: inout BeaconState, validator index: ValidatorIndex) {
assert(state.slot < state.validatorRegistry[Int(index)].withdrawableEpoch.startSlot())
state.validatorRegistry[Int(index)].exit(state: state)

Expand Down
4 changes: 2 additions & 2 deletions Sources/BeaconChain/StateTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extension StateTransition {
)
)

BeaconChain.slashValidator(state: &state, index: proposerSlashing.proposerIndex)
BeaconChain.slash(&state, validator: proposerSlashing.proposerIndex)
}
}

Expand Down Expand Up @@ -132,7 +132,7 @@ extension StateTransition {
assert(slashableIndices.count >= 1)

for i in slashableIndices {
BeaconChain.slashValidator(state: &state, index: i)
BeaconChain.slash(&state, validator: i)
}
}
}
Expand Down