Skip to content

Commit 92ba7cb

Browse files
nflaigphilknows
authored andcommitted
chore: remove 'active' from validator status type (#7146)
* chore: remove 'active' from validator status type * Clean up usage
1 parent 68e1dd2 commit 92ba7cb

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/beacon-node/src/api/impl/validator/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,6 @@ export function getValidatorApi(
13631363
const validator = headState.validators.getReadonly(validatorIndex);
13641364
const status = getValidatorStatus(validator, currentEpoch);
13651365
return (
1366-
status === "active" ||
13671366
status === "active_exiting" ||
13681367
status === "active_ongoing" ||
13691368
status === "active_slashed" ||

packages/types/src/utils/validatorStatus.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import {FAR_FUTURE_EPOCH} from "@lodestar/params";
22
import {Epoch, phase0} from "../types.js";
33

4+
/**
5+
* [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
6+
*/
47
export type ValidatorStatus =
5-
| "active"
68
| "pending_initialized"
79
| "pending_queued"
810
| "active_ongoing"

packages/validator/src/services/indices.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ type SimpleValidatorStatus = "pending" | "active" | "exited" | "withdrawn";
2020

2121
const statusToSimpleStatusMapping = (status: routes.beacon.ValidatorStatus): SimpleValidatorStatus => {
2222
switch (status) {
23-
case "active":
2423
case "active_exiting":
2524
case "active_slashed":
2625
case "active_ongoing":

packages/validator/test/unit/services/attestationDuties.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("AttestationDutiesService", function () {
3333
const defaultValidator: routes.beacon.ValidatorResponse = {
3434
index,
3535
balance: 32e9,
36-
status: "active",
36+
status: "active_ongoing",
3737
validator: ssz.phase0.Validator.defaultValue(),
3838
};
3939

packages/validator/test/unit/services/syncCommitteDuties.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("SyncCommitteeDutiesService", function () {
3636
const defaultValidator: routes.beacon.ValidatorResponse = {
3737
index: indices[0],
3838
balance: 32e9,
39-
status: "active",
39+
status: "active_ongoing",
4040
validator: ssz.phase0.Validator.defaultValue(),
4141
};
4242

0 commit comments

Comments
 (0)