[#56] Update to latest neofs-api-go changes

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-29 15:35:15 +03:00 committed by Alex Vanin
parent fc74e9b40c
commit 12d57af998
3 changed files with 3 additions and 15 deletions

2
go.mod
View file

@ -13,7 +13,7 @@ require (
github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2 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/multiformats/go-multihash v0.0.13 // indirect
github.com/nspcc-dev/neo-go v0.91.1-pre.0.20200827184617-7560aa345a78 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/neofs-crypto v0.3.0
github.com/nspcc-dev/tzhash v1.4.0 github.com/nspcc-dev/tzhash v1.4.0
github.com/panjf2000/ants/v2 v2.3.0 github.com/panjf2000/ants/v2 v2.3.0

BIN
go.sum

Binary file not shown.

View file

@ -58,7 +58,7 @@ func (f *formatter) Close() (*AccessIdentifiers, error) {
if par := f.obj.GetParent(); par != nil && par.ToV2().GetHeader() != nil { if par := f.obj.GetParent(); par != nil && par.ToV2().GetHeader() != nil {
rawPar := objectSDK.NewRawFromV2(par.ToV2()) 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") 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()) 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") return nil, errors.Wrap(err, "could not finalize object")
} }
@ -83,15 +83,3 @@ func (f *formatter) Close() (*AccessIdentifiers, error) {
WithSelfID(f.obj.GetID()). WithSelfID(f.obj.GetID()).
WithParentID(parID), nil 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
}