forked from TrueCloudLab/frostfs-node
[#1389] storagegroup: Upgrade SDK package
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0f376a5d83
commit
5e50ddd7f5
7 changed files with 10 additions and 11 deletions
|
@ -248,7 +248,7 @@ func getSG(cmd *cobra.Command, _ []string) {
|
|||
_, err = internalclient.GetObject(prm)
|
||||
exitOnErr(cmd, errf("rpc error: %w", err))
|
||||
|
||||
sg := storagegroupAPI.New()
|
||||
var sg storagegroupAPI.StorageGroup
|
||||
|
||||
err = sg.Unmarshal(buf.Bytes())
|
||||
exitOnErr(cmd, errf("could not unmarshal storage group: %w", err))
|
||||
|
|
2
go.mod
2
go.mod
|
@ -19,7 +19,7 @@ require (
|
|||
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-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/panjf2000/ants/v2 v2.4.0
|
||||
github.com/paulmach/orb v0.2.2
|
||||
|
|
4
go.sum
4
go.sum
|
@ -406,8 +406,8 @@ github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnB
|
|||
github.com/nspcc-dev/neofs-crypto v0.3.0/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw=
|
||||
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211201182451-a5b61c4f6477/go.mod h1:dfMtQWmBHYpl9Dez23TGtIUKiFvCIxUZq/CkSIhEpz4=
|
||||
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20220113123743-7f3162110659/go.mod h1:/jay1lr3w7NQd/VDBkEhkJmDmyPNsu4W+QV2obsUV40=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220413143225-1186f2f7035d h1:/rIG/M1WXS8653D4pxXm1fYNTeG1rPTfFLh3D7esgZw=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220413143225-1186f2f7035d/go.mod h1:cQKdlr9Gmp5jxbOJ78S714i1AycfYUzpVddxVUD48WM=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220413153333-9b63c07c59eb h1:tpgXLYlApgL/IkdXGzPpvXH5PzoS8HpU/AjyE5/FMT4=
|
||||
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220413153333-9b63c07c59eb/go.mod h1:cQKdlr9Gmp5jxbOJ78S714i1AycfYUzpVddxVUD48WM=
|
||||
github.com/nspcc-dev/rfc6979 v0.1.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso=
|
||||
github.com/nspcc-dev/rfc6979 v0.2.0 h1:3e1WNxrN60/6N0DW7+UYisLeZJyfqZTNOjeV/toYvOE=
|
||||
github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso=
|
||||
|
|
|
@ -213,7 +213,7 @@ func (v *FormatValidator) ValidateContent(o *object.Object) error {
|
|||
return fmt.Errorf("(%T) empty payload in SG", v)
|
||||
}
|
||||
|
||||
sg := storagegroup.New()
|
||||
var sg storagegroup.StorageGroup
|
||||
|
||||
if err := sg.Unmarshal(o.Payload()); err != nil {
|
||||
return fmt.Errorf("(%T) could not unmarshal SG content: %w", v, err)
|
||||
|
|
|
@ -154,8 +154,7 @@ func TestFormatValidator_Validate(t *testing.T) {
|
|||
|
||||
require.Error(t, v.ValidateContent(obj))
|
||||
|
||||
content := storagegroup.New()
|
||||
content.SetMembers([]oidSDK.ID{})
|
||||
var content storagegroup.StorageGroup
|
||||
|
||||
data, err := content.Marshal()
|
||||
require.NoError(t, err)
|
||||
|
|
|
@ -113,14 +113,14 @@ func (c *ClientCache) getSG(ctx context.Context, addr *addressSDK.Address, nm *n
|
|||
continue
|
||||
}
|
||||
|
||||
sg := storagegroup.New()
|
||||
var sg storagegroup.StorageGroup
|
||||
|
||||
err = sg.Unmarshal(payload)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't parse storage group payload: %w", err)
|
||||
}
|
||||
|
||||
return sg, nil
|
||||
return &sg, nil
|
||||
}
|
||||
|
||||
var errNotFound apistatus.ObjectNotFound
|
||||
|
|
|
@ -21,7 +21,7 @@ func CollectMembers(r objutil.HeadReceiver, cnr *cid.ID, members []oidSDK.ID) (*
|
|||
phyMembers []oidSDK.ID
|
||||
phyHashes [][]byte
|
||||
addr = addressSDK.NewAddress()
|
||||
sg = storagegroup.New()
|
||||
sg storagegroup.StorageGroup
|
||||
)
|
||||
|
||||
addr.SetContainerID(*cnr)
|
||||
|
@ -58,5 +58,5 @@ func CollectMembers(r objutil.HeadReceiver, cnr *cid.ID, members []oidSDK.ID) (*
|
|||
sg.SetValidationDataSize(sumPhySize)
|
||||
sg.SetValidationDataHash(cs)
|
||||
|
||||
return sg, nil
|
||||
return &sg, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue