From 12d57af9987a798299d15c2a8ec25998654cd142 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 29 Sep 2020 15:35:15 +0300 Subject: [PATCH] [#56] Update to latest neofs-api-go changes Signed-off-by: Leonard Lyubich --- go.mod | 2 +- go.sum | Bin 58865 -> 58620 bytes .../object_manager/transformer/fmt.go | 16 ++-------------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 897c8ada1..ec5a47e8d 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 54c7c00ac23a79edaf530d21faff767a65fa66e8..7005c8c7f18565cade5c25c1d2ea55941a6837f4 100644 GIT binary patch delta 119 zcmex(n)%O3<_(Y1oh=QGjLb|7bxn*6QY=l)49tv7lN2%xt*VmKs=_TTjdG0hGm7$j z@`6&#OiV1x^7BIrJ<`+N3krN9gUgcxl8wq7CvVJ>oqQleTm+k0lXEkIC!fpW+Ppv0 Gs0ILpR48Ep delta 216 zcmex!lKJCl<_(Y1olOmmOf5_dbdxO%O_Gz%jM5U*OcXKivu#e-OT(A zwWD18%froc{4yeZT(h-P_5JkIQ*skc{rtT0CmW_qO}5XF62WHHVSabPe?>j4Z1N^(hJsE2;7`^Ul-u XF3WW*O-yq&H$k!p)2z+88T~Z?DOE#= diff --git a/pkg/services/object_manager/transformer/fmt.go b/pkg/services/object_manager/transformer/fmt.go index 5333025ec..411506153 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 -}