[#28] Clients: Make immutable parameters
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
749000a090
commit
9bb7b5eff8
62 changed files with 2742 additions and 963 deletions
|
@ -16,10 +16,8 @@ internal sealed class ApeManagerServiceProvider : ContextAccessor
|
|||
_apeManagerServiceClient = apeManagerServiceClient;
|
||||
}
|
||||
|
||||
internal async Task<ReadOnlyMemory<byte>> AddChainAsync(PrmApeChainAdd args)
|
||||
internal async Task<ReadOnlyMemory<byte>> AddChainAsync(PrmApeChainAdd args, CallContext ctx)
|
||||
{
|
||||
var ctx = args.Context!;
|
||||
|
||||
AddChainRequest request = new()
|
||||
{
|
||||
Body = new()
|
||||
|
@ -32,17 +30,15 @@ internal sealed class ApeManagerServiceProvider : ContextAccessor
|
|||
request.AddMetaHeader(args.XHeaders);
|
||||
request.Sign(ClientContext.Key.ECDsaKey);
|
||||
|
||||
var response = await _apeManagerServiceClient!.AddChainAsync(request, null, ctx.Deadline, ctx.CancellationToken);
|
||||
var response = await _apeManagerServiceClient!.AddChainAsync(request, null, ctx.GetDeadline(), ctx.CancellationToken);
|
||||
|
||||
Verifier.CheckResponse(response);
|
||||
|
||||
return response.Body.ChainId.Memory;
|
||||
}
|
||||
|
||||
internal async Task RemoveChainAsync(PrmApeChainRemove args)
|
||||
internal async Task RemoveChainAsync(PrmApeChainRemove args, CallContext ctx)
|
||||
{
|
||||
var ctx = args.Context!;
|
||||
|
||||
RemoveChainRequest request = new()
|
||||
{
|
||||
Body = new()
|
||||
|
@ -55,15 +51,13 @@ internal sealed class ApeManagerServiceProvider : ContextAccessor
|
|||
request.AddMetaHeader(args.XHeaders);
|
||||
request.Sign(ClientContext.Key.ECDsaKey);
|
||||
|
||||
var response = await _apeManagerServiceClient!.RemoveChainAsync(request, null, ctx.Deadline, ctx.CancellationToken);
|
||||
var response = await _apeManagerServiceClient!.RemoveChainAsync(request, null, ctx.GetDeadline(), ctx.CancellationToken);
|
||||
|
||||
Verifier.CheckResponse(response);
|
||||
}
|
||||
|
||||
internal async Task<Chain[]> ListChainAsync(PrmApeChainList args)
|
||||
internal async Task<Chain[]> ListChainAsync(PrmApeChainList args, CallContext ctx)
|
||||
{
|
||||
var ctx = args.Context!;
|
||||
|
||||
ListChainsRequest request = new()
|
||||
{
|
||||
Body = new()
|
||||
|
@ -75,7 +69,7 @@ internal sealed class ApeManagerServiceProvider : ContextAccessor
|
|||
request.AddMetaHeader(args.XHeaders);
|
||||
request.Sign(ClientContext.Key.ECDsaKey);
|
||||
|
||||
var response = await _apeManagerServiceClient!.ListChainsAsync(request, null, ctx.Deadline, ctx.CancellationToken);
|
||||
var response = await _apeManagerServiceClient!.ListChainsAsync(request, null, ctx.GetDeadline(), ctx.CancellationToken);
|
||||
|
||||
Verifier.CheckResponse(response);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue