[#28] Client: Apply code optimizations
All checks were successful
DCO / DCO (pull_request) Successful in 33s
lint-build / dotnet8.0 (pull_request) Successful in 1m4s
lint-build / dotnet8.0 (push) Successful in 49s

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-11-18 16:57:20 +03:00
parent 766f61a5f7
commit 749000a090
57 changed files with 845 additions and 1116 deletions

View file

@ -5,7 +5,6 @@ using FrostFS.Object;
using FrostFS.SDK.Client;
using FrostFS.SDK.Client.Mappers.GRPC;
using FrostFS.SDK.Cryptography;
using FrostFS.Session;
using Google.Protobuf;
@ -41,7 +40,7 @@ public class ObjectMocker(string key) : ObjectServiceBase(key)
public GetRangeHashRequest? GetRangeHashRequest { get; set; }
public Collection<ByteString> RangeHashResponses { get; } = [];
public Collection<ByteString> RangeHashResponses { get; } = [];
public override Mock<ObjectService.ObjectServiceClient> GetMock()
{
@ -94,7 +93,7 @@ public class ObjectMocker(string key) : ObjectServiceBase(key)
headResponse.Body.Header.Signature = new Refs.Signature
{
Key = ByteString.CopyFrom(Key.PublicKey()),
Sign = ByteString.CopyFrom(Key.SignData(headResponse.Body.Header.ToByteArray())),
Sign = Key.SignData(headResponse.Body.Header.ToByteArray()),
};
headResponse.VerifyHeader = GetResponseVerificationHeader(headResponse);
@ -259,7 +258,7 @@ public class ObjectMocker(string key) : ObjectServiceBase(key)
response.Body.HashList.Add(hash);
}
}
response.VerifyHeader = GetResponseVerificationHeader(response);
return new AsyncUnaryCall<GetRangeHashResponse>(
@ -281,7 +280,7 @@ public class ObjectMocker(string key) : ObjectServiceBase(key)
{
Body = new PatchResponse.Types.Body
{
ObjectId = new Refs.ObjectID { Value = ByteString.CopyFrom(SHA256.HashData([1,2,3])) },
ObjectId = new Refs.ObjectID { Value = ByteString.CopyFrom(SHA256.HashData([1, 2, 3])) },
},
MetaHeader = ResponseMetaHeader
};