Skip to content

Commit

Permalink
add client implementation for the peerblockpool rpc call
Browse files Browse the repository at this point in the history
Signed-off-by: Rewant Soni <[email protected]>
  • Loading branch information
rewantsoni committed Mar 4, 2024
1 parent 0680e18 commit 1cdd83e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions services/provider/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,20 @@ func (cc *OCSProviderClient) ReportStatus(ctx context.Context, consumerUUID stri

return cc.Client.ReportStatus(apiCtx, req)
}

func (cc *OCSProviderClient) PeerBlockPool(ctx context.Context, secretName string, pool, token []byte) (*pb.PeerBlockPoolResponse, error) {
if cc.Client == nil || cc.clientConn == nil {
return nil, fmt.Errorf("OCS client is closed")
}

req := &pb.PeerBlockPoolRequest{
SecretName: secretName,
Pool: pool,
Token: token,
}

apiCtx, cancel := context.WithTimeout(ctx, cc.timeout)
defer cancel()

return cc.Client.PeerBlockPool(apiCtx, req)
}

0 comments on commit 1cdd83e

Please sign in to comment.