From 3eb2ac985d51f0e27b2923c33c6c749116b9cb1f Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 1 Nov 2022 20:46:48 +0300 Subject: [PATCH] [#1972] node: Fix object format unit tests Includes: 1. Unused func removal; 2. Err check of the `Sign` method. Signed-off-by: Pavel Karpy --- CHANGELOG.md | 2 ++ pkg/core/object/fmt_test.go | 14 ++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54abe04f9e..8947990e68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ Changelog for NeoFS Node - Correctly select the shard for applying tree service operations (#1996) - Physical child object removal by GC (#1699) - Increase error counter for write-cache flush errors (#1818) +- Broadcasting helper objects (#1972) +- `neofs-cli lock object`'s `lifetime` flag handling (#1972) ### Removed ### Updated diff --git a/pkg/core/object/fmt_test.go b/pkg/core/object/fmt_test.go index a5df3f3652..cd8ed82b4f 100644 --- a/pkg/core/object/fmt_test.go +++ b/pkg/core/object/fmt_test.go @@ -2,8 +2,6 @@ package object import ( "crypto/ecdsa" - "crypto/rand" - "crypto/sha256" "strconv" "testing" @@ -19,15 +17,6 @@ import ( "github.com/stretchr/testify/require" ) -func testSHA(t *testing.T) [sha256.Size]byte { - cs := [sha256.Size]byte{} - - _, err := rand.Read(cs[:]) - require.NoError(t, err) - - return cs -} - func blankValidObject(key *ecdsa.PrivateKey) *object.Object { var idOwner user.ID user.IDFromKey(&idOwner, key.PublicKey) @@ -89,7 +78,8 @@ func TestFormatValidator_Validate(t *testing.T) { user.IDFromKey(&idOwner, ownerKey.PrivateKey.PublicKey) tok := sessiontest.Object() - tok.Sign(ownerKey.PrivateKey) + err := tok.Sign(ownerKey.PrivateKey) + require.NoError(t, err) obj := object.New() obj.SetContainerID(cidtest.ID())