Skip to content

Commit

Permalink
return error if block status is unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-malachyn committed Oct 9, 2024
1 parent b1f90ad commit 4232276
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion access/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1303,9 +1303,14 @@ func (c *BaseClient) SubscribeBlockDigestsFromStartBlockID(
blockStatus flow.BlockStatus,
opts ...grpc.CallOption,
) (<-chan flow.BlockDigest, <-chan error, error) {
status := convert.BlockStatusToEntity(blockStatus)
if status == entities.BlockStatus_BLOCK_UNKNOWN {
return nil, nil, newRPCError(errors.New("unknown block status"))
}

request := &access.SubscribeBlockDigestsFromStartBlockIDRequest{
StartBlockId: startBlockID.Bytes(),
BlockStatus: convert.BlockStatusToEntity(blockStatus),
BlockStatus: status,
}

subscribeClient, err := c.rpcClient.SubscribeBlockDigestsFromStartBlockID(ctx, request, opts...)
Expand Down

0 comments on commit 4232276

Please sign in to comment.