[#1687] go.mod: Update neofs-sdk-go

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-08-22 14:04:00 +03:00 committed by Pavel Karpy
parent d40ed00438
commit 0720d96c9d
7 changed files with 20 additions and 43 deletions

View file

@ -30,7 +30,7 @@ type BalanceOfRes struct {
}
// Balance returns the current balance.
func (x BalanceOfRes) Balance() *accounting.Decimal {
func (x BalanceOfRes) Balance() accounting.Decimal {
return x.cliRes.Amount()
}
@ -95,12 +95,7 @@ func (x PutContainerRes) ID() cid.ID {
func PutContainer(prm PutContainerPrm) (res PutContainerRes, err error) {
cliRes, err := prm.cli.ContainerPut(context.Background(), prm.PrmContainerPut)
if err == nil {
cnr := cliRes.ID()
if cnr == nil {
err = errors.New("missing container ID in response")
} else {
res.cnr = *cnr
}
res.cnr = cliRes.ID()
}
return
@ -171,7 +166,7 @@ type EACLRes struct {
}
// EACL returns requested eACL table.
func (x EACLRes) EACL() *eacl.Table {
func (x EACLRes) EACL() eacl.Table {
return x.cliRes.Table()
}
@ -219,7 +214,7 @@ type NetworkInfoRes struct {
}
// NetworkInfo returns structured information about the NeoFS network.
func (x NetworkInfoRes) NetworkInfo() *netmap.NetworkInfo {
func (x NetworkInfoRes) NetworkInfo() netmap.NetworkInfo {
return x.cliRes.Info()
}
@ -245,11 +240,11 @@ type NodeInfoRes struct {
// NodeInfo returns information about the node from netmap.
func (x NodeInfoRes) NodeInfo() netmap.NodeInfo {
return *x.cliRes.NodeInfo()
return x.cliRes.NodeInfo()
}
// LatestVersion returns the latest NeoFS API version in use.
func (x NodeInfoRes) LatestVersion() *version.Version {
func (x NodeInfoRes) LatestVersion() version.Version {
return x.cliRes.LatestVersion()
}
@ -406,13 +401,9 @@ func PutObject(prm PutObjectPrm) (*PutObjectRes, error) {
return nil, fmt.Errorf("client failure: %w", err)
}
var res PutObjectRes
if !cliRes.ReadStoredObjectID(&res.id) {
return nil, errors.New("missing ID of the stored object")
}
return &res, nil
return &PutObjectRes{
id: cliRes.StoredObjectID(),
}, nil
}
// DeleteObjectPrm groups parameters of DeleteObject operation.
@ -454,14 +445,8 @@ func DeleteObject(prm DeleteObjectPrm) (*DeleteObjectRes, error) {
return nil, fmt.Errorf("remove object via client: %w", err)
}
var id oid.ID
if !cliRes.ReadTombstoneID(&id) {
return nil, errors.New("object removed but tombstone ID is missing")
}
return &DeleteObjectRes{
tomb: id,
tomb: cliRes.Tombstone(),
}, nil
}

View file

@ -58,11 +58,7 @@ func initAccountingBalanceCmd() {
ff.String(ownerFlag, "", "owner of balance account (omit to use owner from private key)")
}
func prettyPrintDecimal(cmd *cobra.Command, decimal *accounting.Decimal) {
if decimal == nil {
return
}
func prettyPrintDecimal(cmd *cobra.Command, decimal accounting.Decimal) {
if viper.GetBool(commonflags.Verbose) {
cmd.Println("value:", decimal.Value())
cmd.Println("precision:", decimal.Precision())

View file

@ -30,7 +30,7 @@ var getExtendedACLCmd = &cobra.Command{
if containerPathTo == "" {
cmd.Println("eACL: ")
common.PrettyPrintJSON(cmd, eaclTable, "eACL")
common.PrettyPrintJSON(cmd, &eaclTable, "eACL")
return
}

View file

@ -63,7 +63,8 @@ Container ID in EACL table will be substituted with ID from the CLI.`,
res, err := internalclient.EACL(getEACLPrm)
if err == nil {
// compare binary values because EACL could have been set already
got, err := res.EACL().Marshal()
table := res.EACL()
got, err := table.Marshal()
if err != nil {
continue
}

2
go.mod
View file

@ -19,7 +19,7 @@ require (
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220727202624-6c7a401f776a // indirect
github.com/nspcc-dev/neofs-api-go/v2 v2.13.2-0.20220818094951-98db3fa28419
github.com/nspcc-dev/neofs-contract v0.15.3
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220801165707-7a99cc916c8e
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220822101910-7578b54fac3f
github.com/nspcc-dev/tzhash v1.6.1
github.com/panjf2000/ants/v2 v2.4.0
github.com/paulmach/orb v0.2.2

5
go.sum
View file

@ -450,7 +450,6 @@ github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220727202624-6c7a401f776a h1:ND
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220727202624-6c7a401f776a/go.mod h1:QBE0I30F2kOAISNpT5oks82yF4wkkUq3SCfI3Hqgx/Y=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=
github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs=
github.com/nspcc-dev/neofs-api-go/v2 v2.13.1/go.mod h1:73j09Xa7I2zQbM3HCvAHnDHPYiiWnEHa1d6Z6RDMBLU=
github.com/nspcc-dev/neofs-api-go/v2 v2.13.2-0.20220818094951-98db3fa28419 h1:NFj8D0UYfHzvC+gIhK7yIUOyEcZi21caQsuYVbJGrVU=
github.com/nspcc-dev/neofs-api-go/v2 v2.13.2-0.20220818094951-98db3fa28419/go.mod h1:NAaDfOnFWIbAFkTj7pNQ+cknVue0JbdeRT9QQaeBCEY=
github.com/nspcc-dev/neofs-contract v0.15.3 h1:7+NwyTtxFAnIevz0hR/XxQf6R2Ej2scjVR2bnnJnhBM=
@ -462,8 +461,8 @@ github.com/nspcc-dev/neofs-crypto v0.4.0 h1:5LlrUAM5O0k1+sH/sktBtrgfWtq1pgpDs09f
github.com/nspcc-dev/neofs-crypto v0.4.0/go.mod h1:6XJ8kbXgOfevbI2WMruOtI+qUJXNwSGM/E9eClXxPHs=
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.6.0.20220801165707-7a99cc916c8e h1:aLRQD3kNibSM49t51KwSgr4n6K1X/yGcV/3J3w1adow=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220801165707-7a99cc916c8e/go.mod h1:Wiw/FcQVxtvuOO70TidxFcQzFcyh8FFwqyCHscmf2rY=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220822101910-7578b54fac3f h1:Xz796coGgZJefQBn7cghk9qYKY3MUvR4zPpcwwa6Uvs=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20220822101910-7578b54fac3f/go.mod h1:BQPxy2sOURSegZJVnrwYDagPtKI3H1Ctc7e0yS0xHvk=
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=

View file

@ -408,13 +408,9 @@ func PutObject(prm PutObjectPrm) (*PutObjectRes, error) {
return nil, fmt.Errorf("write object via client: %w", err)
}
var res PutObjectRes
if !cliRes.ReadStoredObjectID(&res.id) {
return nil, errors.New("missing identifier in the response")
}
return &res, nil
return &PutObjectRes{
id: cliRes.StoredObjectID(),
}, nil
}
// SearchObjectsPrm groups parameters of SearchObjects operation.