[#1389] storagegroup: Upgrade SDK package

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-05-13 12:25:13 +03:00 committed by LeL
parent 0f376a5d83
commit 5e50ddd7f5
7 changed files with 8 additions and 9 deletions

View file

@ -248,7 +248,7 @@ func getSG(cmd *cobra.Command, _ []string) {
_, err = internalclient.GetObject(prm) _, err = internalclient.GetObject(prm)
exitOnErr(cmd, errf("rpc error: %w", err)) exitOnErr(cmd, errf("rpc error: %w", err))
sg := storagegroupAPI.New() var sg storagegroupAPI.StorageGroup
err = sg.Unmarshal(buf.Bytes()) err = sg.Unmarshal(buf.Bytes())
exitOnErr(cmd, errf("could not unmarshal storage group: %w", err)) exitOnErr(cmd, errf("could not unmarshal storage group: %w", err))

2
go.mod
View file

@ -19,7 +19,7 @@ require (
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220321144137-d5a9af5860af // indirect github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220321144137-d5a9af5860af // indirect
github.com/nspcc-dev/neofs-api-go/v2 v2.12.1 github.com/nspcc-dev/neofs-api-go/v2 v2.12.1
github.com/nspcc-dev/neofs-contract v0.14.2 github.com/nspcc-dev/neofs-contract v0.14.2
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220413143225-1186f2f7035d github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220413153333-9b63c07c59eb
github.com/nspcc-dev/tzhash v1.5.2 github.com/nspcc-dev/tzhash v1.5.2
github.com/panjf2000/ants/v2 v2.4.0 github.com/panjf2000/ants/v2 v2.4.0
github.com/paulmach/orb v0.2.2 github.com/paulmach/orb v0.2.2

BIN
go.sum

Binary file not shown.

View file

@ -213,7 +213,7 @@ func (v *FormatValidator) ValidateContent(o *object.Object) error {
return fmt.Errorf("(%T) empty payload in SG", v) return fmt.Errorf("(%T) empty payload in SG", v)
} }
sg := storagegroup.New() var sg storagegroup.StorageGroup
if err := sg.Unmarshal(o.Payload()); err != nil { if err := sg.Unmarshal(o.Payload()); err != nil {
return fmt.Errorf("(%T) could not unmarshal SG content: %w", v, err) return fmt.Errorf("(%T) could not unmarshal SG content: %w", v, err)

View file

@ -154,8 +154,7 @@ func TestFormatValidator_Validate(t *testing.T) {
require.Error(t, v.ValidateContent(obj)) require.Error(t, v.ValidateContent(obj))
content := storagegroup.New() var content storagegroup.StorageGroup
content.SetMembers([]oidSDK.ID{})
data, err := content.Marshal() data, err := content.Marshal()
require.NoError(t, err) require.NoError(t, err)

View file

@ -113,14 +113,14 @@ func (c *ClientCache) getSG(ctx context.Context, addr *addressSDK.Address, nm *n
continue continue
} }
sg := storagegroup.New() var sg storagegroup.StorageGroup
err = sg.Unmarshal(payload) err = sg.Unmarshal(payload)
if err != nil { if err != nil {
return nil, fmt.Errorf("can't parse storage group payload: %w", err) return nil, fmt.Errorf("can't parse storage group payload: %w", err)
} }
return sg, nil return &sg, nil
} }
var errNotFound apistatus.ObjectNotFound var errNotFound apistatus.ObjectNotFound

View file

@ -21,7 +21,7 @@ func CollectMembers(r objutil.HeadReceiver, cnr *cid.ID, members []oidSDK.ID) (*
phyMembers []oidSDK.ID phyMembers []oidSDK.ID
phyHashes [][]byte phyHashes [][]byte
addr = addressSDK.NewAddress() addr = addressSDK.NewAddress()
sg = storagegroup.New() sg storagegroup.StorageGroup
) )
addr.SetContainerID(*cnr) addr.SetContainerID(*cnr)
@ -58,5 +58,5 @@ func CollectMembers(r objutil.HeadReceiver, cnr *cid.ID, members []oidSDK.ID) (*
sg.SetValidationDataSize(sumPhySize) sg.SetValidationDataSize(sumPhySize)
sg.SetValidationDataHash(cs) sg.SetValidationDataHash(cs)
return sg, nil return &sg, nil
} }