From cde8332699b439fc0a0e95b03382a9a1cb890087 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Sat, 28 Dec 2024 19:24:25 +0300 Subject: [PATCH] node/object/replicate_test: fix replication signature test An omission from ae6e37d72e1d6b32352e79a5383d30da21edc4d2: check all 3 signatures and slice them correctly. Signed-off-by: Pavel Karpy --- pkg/network/transport/object/grpc/replication_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/network/transport/object/grpc/replication_test.go b/pkg/network/transport/object/grpc/replication_test.go index 39baa0d687..847a026c73 100644 --- a/pkg/network/transport/object/grpc/replication_test.go +++ b/pkg/network/transport/object/grpc/replication_test.go @@ -8,6 +8,7 @@ import ( "crypto/rand" "encoding/binary" "errors" + "fmt" "testing" objectV2 "github.com/nspcc-dev/neofs-api-go/v2/object" @@ -398,7 +399,7 @@ func TestServer_Replicate(t *testing.T) { sigsRaw := resp.GetObjectSignature() - for i := range 1 { + for i := range 3 { var sigV2 refsv2.Signature l := binary.LittleEndian.Uint32(sigsRaw) @@ -410,9 +411,9 @@ func TestServer_Replicate(t *testing.T) { require.Equal(t, signer.PublicKeyBytes, sig.PublicKeyBytes()) require.True(t, sig.Verify(objectcore.EncodeReplicationMetaInfo( o.GetContainerID(), o.GetID(), o.GetFirstID(), o.GetPreviousID(), o.PayloadSize(), o.Type(), nil, nil, - uint64((123+1+i)*240), mNumber))) + uint64((123+1+i)*240), mNumber)), fmt.Sprintf("wrong %d signature", i+1)) - sigsRaw = sigsRaw[:4+l] + sigsRaw = sigsRaw[4+l:] } }) })