Skip to content

Commit

Permalink
GetDuties: Refactor assignment status to deduplicate status computati…
Browse files Browse the repository at this point in the history
…on (#8313)
  • Loading branch information
prestonvanloon committed Jan 21, 2021
1 parent 2586be2 commit 33e2663
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions beacon-chain/rpc/validator/assignments.go
Expand Up @@ -155,13 +155,15 @@ func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.
}
idx, ok := s.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey))
if ok {
status := assignmentStatus(s, idx)

assignment.ValidatorIndex = idx
assignment.Status = assignmentStatus(s, idx)
assignment.Status = status
assignment.ProposerSlots = proposerIndexToSlots[idx]

// The next epoch has no lookup for proposer indexes.
nextAssignment.ValidatorIndex = idx
nextAssignment.Status = assignmentStatus(s, idx)
nextAssignment.Status = status

ca, ok := committeeAssignments[idx]
if ok {
Expand Down

0 comments on commit 33e2663

Please sign in to comment.