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 8 additions and 9 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
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
|
@ -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