diff --git a/go.mod b/go.mod index 897c8ada19..ec5a47e8d6 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2 github.com/multiformats/go-multihash v0.0.13 // indirect github.com/nspcc-dev/neo-go v0.91.1-pre.0.20200827184617-7560aa345a78 - github.com/nspcc-dev/neofs-api-go v1.3.1-0.20200925143744-2cc58e36f8d7 + github.com/nspcc-dev/neofs-api-go v1.3.1-0.20200929122641-420d9560625b github.com/nspcc-dev/neofs-crypto v0.3.0 github.com/nspcc-dev/tzhash v1.4.0 github.com/panjf2000/ants/v2 v2.3.0 diff --git a/go.sum b/go.sum index 54c7c00ac2..7005c8c7f1 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/services/object_manager/transformer/fmt.go b/pkg/services/object_manager/transformer/fmt.go index 5333025ec9..4115061536 100644 --- a/pkg/services/object_manager/transformer/fmt.go +++ b/pkg/services/object_manager/transformer/fmt.go @@ -58,7 +58,7 @@ func (f *formatter) Close() (*AccessIdentifiers, error) { if par := f.obj.GetParent(); par != nil && par.ToV2().GetHeader() != nil { rawPar := objectSDK.NewRawFromV2(par.ToV2()) - if err := setIDAndSignature(f.key, rawPar); err != nil { + if err := objectSDK.SetIDWithSignature(f.key, rawPar); err != nil { return nil, errors.Wrap(err, "could not finalize parent object") } @@ -67,7 +67,7 @@ func (f *formatter) Close() (*AccessIdentifiers, error) { f.obj.SetParent(rawPar.Object()) } - if err := setIDAndSignature(f.key, f.obj.SDK()); err != nil { + if err := objectSDK.SetIDWithSignature(f.key, f.obj.SDK()); err != nil { return nil, errors.Wrap(err, "could not finalize object") } @@ -83,15 +83,3 @@ func (f *formatter) Close() (*AccessIdentifiers, error) { WithSelfID(f.obj.GetID()). WithParentID(parID), nil } - -func setIDAndSignature(key *ecdsa.PrivateKey, obj *objectSDK.RawObject) error { - if err := objectSDK.CalculateAndSetID(obj); err != nil { - return errors.Wrap(err, "could not set identifier") - } - - if err := objectSDK.CalculateAndSetSignature(key, obj); err != nil { - return errors.Wrap(err, "could not set signature") - } - - return nil -}