From e6f04f7785eb2d7c3d42d8f5cda7ca1ade0c397b Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 20 Oct 2020 13:50:35 +0300 Subject: [PATCH] [#104] Update neofs-api-go with new protobuf API Also update contains JSON converters for neofs-cli and fixes bug in container.set-acl command of SDK. Signed-off-by: Alex Vanin --- cmd/neofs-cli/modules/container.go | 3 ++- go.mod | 5 +++-- go.sum | Bin 58620 -> 58865 bytes .../processors/netmap/process_peers.go | 3 ++- .../client/container/wrapper/container.go | 3 ++- pkg/morph/client/container/wrapper/eacl.go | 3 ++- pkg/morph/client/netmap/wrapper/netmap.go | 3 ++- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cmd/neofs-cli/modules/container.go b/cmd/neofs-cli/modules/container.go index 404acdb50..e0401f02b 100644 --- a/cmd/neofs-cli/modules/container.go +++ b/cmd/neofs-cli/modules/container.go @@ -22,6 +22,7 @@ import ( grpccontainer "github.com/nspcc-dev/neofs-api-go/v2/container/grpc" "github.com/nspcc-dev/neofs-node/pkg/policy" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) const ( @@ -265,7 +266,7 @@ var getContainerInfoCmd = &cobra.Command{ // todo: make more user friendly way to parse raw data msg := new(grpccontainer.Container) - if msg.Unmarshal(data) != nil { + if proto.Unmarshal(data, msg) != nil { return errors.New("can't unmarshal container") } diff --git a/go.mod b/go.mod index d8eb9b4d9..d2a348731 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.14 require ( bou.ke/monkey v1.0.2 github.com/alecthomas/participle v0.6.0 - github.com/golang/protobuf v1.4.2 + github.com/golang/protobuf v1.4.3 github.com/google/uuid v1.1.1 github.com/mitchellh/go-homedir v1.1.0 github.com/mr-tron/base58 v1.1.3 @@ -13,7 +13,7 @@ require ( github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2 github.com/multiformats/go-multihash v0.0.13 // indirect github.com/nspcc-dev/neo-go v0.91.1-pre.0.20200827184617-7560aa345a78 - github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201015080537-4e6350f6d438 + github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201020123541-2aa40b0dd3a5 github.com/nspcc-dev/neofs-crypto v0.3.0 github.com/nspcc-dev/tzhash v1.4.0 github.com/panjf2000/ants/v2 v2.3.0 @@ -33,6 +33,7 @@ require ( golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect golang.org/x/tools v0.0.0-20200123022218-593de606220b // indirect google.golang.org/grpc v1.29.1 + google.golang.org/protobuf v1.23.0 ) // Used for debug reasons diff --git a/go.sum b/go.sum index e66ff403272aee6e0a03ced36ec20eb474392170..8b0ffe112f7d76335f485ab7d81f6426ecdba8fc 100644 GIT binary patch delta 392 zcmbWxOHPA8007XKoK(7`CVwQ{Yfd zFgu&Ddxb80v|%I~K)_(g^kWtv93Yw*0N8p_eN1^%-7TNo^&zylY<(j2La-bUdAP7v zrlGHq=<^E4pJ94)9%k3tpBR;vcX>%#bHb7Op@lhDI zaa&rF`favB8esjpn ziD5=%=H*@y29pB~l^BgSmm24oxEPumSQwZZo9mjSni-oKq?x6d7+ZkM3o19xuyo3c zta8tEDT#_Oj|@oCH}`XPE2+$O)ea~Oi7?L%^06!^^eZ!%yfI65@_`I7Z>)ytr|0YC z=BI$nbSrjCF|0C)tjc#y56H