Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove 'active' from validator status type #7146

Merged
merged 3 commits into from
Oct 10, 2024
Merged
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
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
Loading