diff --git a/Sources/BeaconChain/BeaconChain.swift b/Sources/BeaconChain/BeaconChain.swift index 305452a..5e1d294 100644 --- a/Sources/BeaconChain/BeaconChain.swift +++ b/Sources/BeaconChain/BeaconChain.swift @@ -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) diff --git a/Sources/BeaconChain/StateTransition.swift b/Sources/BeaconChain/StateTransition.swift index 16587eb..dd952df 100644 --- a/Sources/BeaconChain/StateTransition.swift +++ b/Sources/BeaconChain/StateTransition.swift @@ -104,7 +104,7 @@ extension StateTransition { ) ) - BeaconChain.slashValidator(state: &state, index: proposerSlashing.proposerIndex) + BeaconChain.slash(&state, validator: proposerSlashing.proposerIndex) } } @@ -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) } } }