Skip to content

Commit

Permalink
chore: remove 'active' from validator status type (#7146)
Browse files Browse the repository at this point in the history
* chore: remove 'active' from validator status type

* Clean up usage
  • Loading branch information
nflaig authored Oct 10, 2024
1 parent 38f54ab commit 0d87c28
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,6 @@ export function getValidatorApi(
const validator = headState.validators.getReadonly(validatorIndex);
const status = getValidatorStatus(validator, currentEpoch);
return (
status === "active" ||
status === "active_exiting" ||
status === "active_ongoing" ||
status === "active_slashed" ||
Expand Down
4 changes: 3 additions & 1 deletion packages/types/src/utils/validatorStatus.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {FAR_FUTURE_EPOCH} from "@lodestar/params";
import {Epoch, phase0} from "../types.js";

/**
* [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
*/
export type ValidatorStatus =
| "active"
| "pending_initialized"
| "pending_queued"
| "active_ongoing"
Expand Down
1 change: 0 additions & 1 deletion packages/validator/src/services/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type SimpleValidatorStatus = "pending" | "active" | "exited" | "withdrawn";

const statusToSimpleStatusMapping = (status: routes.beacon.ValidatorStatus): SimpleValidatorStatus => {
switch (status) {
case "active":
case "active_exiting":
case "active_slashed":
case "active_ongoing":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("AttestationDutiesService", function () {
const defaultValidator: routes.beacon.ValidatorResponse = {
index,
balance: 32e9,
status: "active",
status: "active_ongoing",
validator: ssz.phase0.Validator.defaultValue(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("SyncCommitteeDutiesService", function () {
const defaultValidator: routes.beacon.ValidatorResponse = {
index: indices[0],
balance: 32e9,
status: "active",
status: "active_ongoing",
validator: ssz.phase0.Validator.defaultValue(),
};

Expand Down

0 comments on commit 0d87c28

Please sign in to comment.