diff --git a/api/api.go b/api/api.go index 120c4cb..4cc1a82 100644 --- a/api/api.go +++ b/api/api.go @@ -510,6 +510,7 @@ func (m *ApiService) handleMemoryValidators(w http.ResponseWriter, req *http.Req validatorsResp := make([]httpOkValidatorInfo, 0) for _, v := range validators { validatorsResp = append(validatorsResp, httpOkValidatorInfo{ + // TODO: BeaconValidatorStatus: beaconState.Status.String(), ValidatorStatus: v.ValidatorStatus.String(), AccumulatedRewardsWei: v.AccumulatedRewardsWei.String(), PendingRewardsWei: v.PendingRewardsWei.String(), @@ -590,6 +591,7 @@ func (m *ApiService) handleMemoryValidatorsByIndex(w http.ResponseWriter, req *h if validator, found := m.oracle.State().Validators[index]; found { // Convert ValidatorInfo to httpOkValidatorInfo. This is done to return strings instead of bigInts foundValidator := httpOkValidatorInfo{ + // TODO: BeaconValidatorStatus: beaconState.Status.String(), ValidatorStatus: validator.ValidatorStatus.String(), AccumulatedRewardsWei: validator.AccumulatedRewardsWei.String(), PendingRewardsWei: validator.PendingRewardsWei.String(), @@ -658,9 +660,9 @@ func (m *ApiService) handleMemoryValidatorsByWithdrawal(w http.ResponseWriter, r } // Skip validators that cannot be subscribed - if !oracle.CanValidatorSubscribeToPool(validator) { - continue - } + //if !oracle.CanValidatorSubscribeToPool(validator) { + // continue + //} requestedValidators[uint64(valIndex)] = &oracle.ValidatorInfo{ ValidatorStatus: oracle.Untracked, @@ -736,8 +738,13 @@ func (m *ApiService) handleMemoryValidatorsByWithdrawal(w http.ResponseWriter, r validatorsResp := make([]httpOkValidatorInfo, 0) for _, v := range values { + beaconState, found := m.Onchain.Validators()[phase0.ValidatorIndex(v.ValidatorIndex)] + // TODO: Do something if not found + _ = found validatorsResp = append(validatorsResp, httpOkValidatorInfo{ + // TODO: BeaconValidatorStatus: beaconState.Status.String(), ValidatorStatus: v.ValidatorStatus.String(), + BeaconValidatorStatus: beaconState.Status.String(), AccumulatedRewardsWei: v.AccumulatedRewardsWei.String(), PendingRewardsWei: v.PendingRewardsWei.String(), CollateralWei: v.CollateralWei.String(), diff --git a/api/types.go b/api/types.go index 4518c35..3daa800 100644 --- a/api/types.go +++ b/api/types.go @@ -131,6 +131,7 @@ type httpOkBlock struct { type httpOkValidatorInfo struct { ValidatorStatus string `json:"status"` + BeaconValidatorStatus string `json:"beacon_status"` AccumulatedRewardsWei string `json:"accumulated_rewards_wei"` PendingRewardsWei string `json:"pending_rewards_wei"` CollateralWei string `json:"collateral_wei"`