Skip to content

Commit

Permalink
RPC: Proper status code for error (#8519)
Browse files Browse the repository at this point in the history
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
terencechain and prylabs-bulldozer[bot] authored Feb 25, 2021
1 parent b400098 commit 658cbf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions beacon-chain/rpc/beacon/slashings.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (bs *Server) SubmitProposerSlashing(
}
if !featureconfig.Get().DisableBroadcastSlashings {
if err := bs.Broadcaster.Broadcast(ctx, req); err != nil {
return nil, err
return nil, status.Errorf(codes.Internal, "Could not broadcast slashing object: %v", err)
}
}

Expand All @@ -52,7 +52,7 @@ func (bs *Server) SubmitAttesterSlashing(
}
if !featureconfig.Get().DisableBroadcastSlashings {
if err := bs.Broadcaster.Broadcast(ctx, req); err != nil {
return nil, err
return nil, status.Errorf(codes.Internal, "Could not broadcast slashing object: %v", err)
}
}
indices := sliceutil.IntersectionUint64(req.Attestation_1.AttestingIndices, req.Attestation_2.AttestingIndices)
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/beaconv1/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (bs *Server) SubmitAttesterSlashing(ctx context.Context, req *ethpb.Atteste
}
if !featureconfig.Get().DisableBroadcastSlashings {
if err := bs.Broadcaster.Broadcast(ctx, req); err != nil {
return nil, err
return nil, status.Errorf(codes.Internal, "Could not broadcast slashing object: %v", err)
}
}

Expand Down

0 comments on commit 658cbf5

Please sign in to comment.