Function: optOutValidator()
This allows validator to opt out.
Branches and code coverage
Intended branches
Assure that there is at least one validator left. Currently not performed.
Pop the validator from the
validatorAddresses
array. Performed inremoveValidatorRewardList
.Assure that the validator has not already opted out.
Assure that the validator has not already begun the opt-out process.
Set the
optOutTime
of the validator to the current time plus one day.Reset the
currentStake
of the validator to zero.Transfer the validator's stake back to them.
Remove the validator from the
validatorRewardList
.
Negative behavior
Should not allow anyone other than a validator to call this function.