[#28] Client: Apply code optimizations
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
766f61a5f7
commit
749000a090
57 changed files with 845 additions and 1116 deletions
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue