1
1
/* eslint-disable @typescript-eslint/naming-convention */
2
2
import { ContainerType , ValueOf } from "@chainsafe/ssz" ;
3
- import { phase0 , CommitteeIndex , Slot , Epoch , ssz , RootHex } from "@lodestar/types" ;
3
+ import { phase0 , CommitteeIndex , Slot , Epoch , ssz , RootHex , StringType } from "@lodestar/types" ;
4
4
import { Endpoint , RequestCodec , RouteDefinitions , Schema } from "../../../utils/index.js" ;
5
5
import { ArrayOf , ExecutionOptimisticCodec , ExecutionOptimisticMeta } from "../../../utils/codecs.js" ;
6
6
import { RootResponse , RootResponseType } from "./block.js" ;
@@ -10,18 +10,17 @@ import {RootResponse, RootResponseType} from "./block.js";
10
10
export type StateId = RootHex | Slot | "head" | "genesis" | "finalized" | "justified" ;
11
11
export type ValidatorId = string | number ;
12
12
13
- export enum ValidatorStatus {
14
- "active" ,
15
- "pending_initialized" ,
16
- "pending_queued" ,
17
- "active_ongoing" ,
18
- "active_exiting" ,
19
- "active_slashed" ,
20
- "exited_unslashed" ,
21
- "exited_slashed" ,
22
- "withdrawal_possible" ,
23
- "withdrawal_done" ,
24
- }
13
+ export type ValidatorStatus =
14
+ | "active"
15
+ | "pending_initialized"
16
+ | "pending_queued"
17
+ | "active_ongoing"
18
+ | "active_exiting"
19
+ | "active_slashed"
20
+ | "exited_unslashed"
21
+ | "exited_slashed"
22
+ | "withdrawal_possible"
23
+ | "withdrawal_done" ;
25
24
26
25
export const RandaoResponseType = new ContainerType ( {
27
26
randao : ssz . Root ,
@@ -34,7 +33,7 @@ export const FinalityCheckpointsType = new ContainerType({
34
33
export const ValidatorResponseType = new ContainerType ( {
35
34
index : ssz . ValidatorIndex ,
36
35
balance : ssz . UintNum64 ,
37
- status : ssz . Uint8 ,
36
+ status : new StringType < ValidatorStatus > ( ) ,
38
37
validator : ssz . phase0 . Validator ,
39
38
} ) ;
40
39
export const EpochCommitteeResponseType = new ContainerType ( {
0 commit comments