From b9fb0d60502aba0cf28fc6571757a80cda411e51 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 219d7fcb3..9dfded801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ Changelog for NeoFS Node - Correctly select the shard for applying tree service operations (#1996) - Do not panic with bad inputs for `GET_RANGE` (#2007) - Physical child object removal by GC (#1699) +- 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 a5df3f365..cd8ed82b4 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())