[#1518] Upgrade NeoFS SDK Go with changed subnet package

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-15 11:08:10 +03:00 committed by LeL
parent f602d05b0a
commit 2e4a1cb6df
12 changed files with 32 additions and 90 deletions

View file

@ -141,10 +141,12 @@ It will be stored in sidechain when inner ring will accepts it.`,
placementPolicy, err := parseContainerPolicy(containerPolicy)
common.ExitOnErr(cmd, "", err)
subnetID, err := parseSubnetID(containerSubnet)
var subnetID subnetid.ID
err = subnetID.DecodeString(containerSubnet)
common.ExitOnErr(cmd, "could not parse subnetID: %w", err)
placementPolicy.SetSubnetID(subnetID)
placementPolicy.SetSubnetID(&subnetID)
attributes, err := parseAttributes(containerAttributes)
common.ExitOnErr(cmd, "", err)
@ -596,16 +598,6 @@ func prettyPrintContainerList(cmd *cobra.Command, list []cid.ID) {
}
}
func parseSubnetID(val string) (sub *subnetid.ID, err error) {
sub = &subnetid.ID{}
if val != "" {
err = sub.UnmarshalText([]byte(val))
}
return
}
func parseContainerPolicy(policyString string) (*netmap.PlacementPolicy, error) {
_, err := os.Stat(policyString) // check if `policyString` is a path to file with placement policy
if err == nil {