Skip to content

Commit

Permalink
node/object/replicate_test: fix replication signature test
Browse files Browse the repository at this point in the history
An omission from ae6e37d: check all 3
signatures and slice them correctly.

Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
carpawell committed Dec 28, 2024
1 parent e500041 commit cde8332
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/network/transport/object/grpc/replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"crypto/rand"
"encoding/binary"
"errors"
"fmt"
"testing"

objectV2 "github.com/nspcc-dev/neofs-api-go/v2/object"
Expand Down Expand Up @@ -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)

Expand All @@ -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:]
}
})
})
Expand Down

0 comments on commit cde8332

Please sign in to comment.