From d49bd4b94a3fa2824afaa076756d217935df4fc0 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 7 May 2021 14:13:11 +0300 Subject: [PATCH] Update neofs-api-go to v1.26.0 Signed-off-by: Alex Vanin --- cmd/neofs-node/reputation.go | 16 ++++++++-------- .../reputation/intermediate/remote.go | 6 +++--- cmd/neofs-node/reputation/local/remote.go | 4 ++-- go.mod | 2 +- go.sum | Bin 59798 -> 59738 bytes .../processors/reputation/handlers.go | 2 +- .../processors/reputation/process_put.go | 2 +- pkg/morph/client/reputation/wrapper/get.go | 2 +- pkg/morph/client/reputation/wrapper/put.go | 2 +- .../transport/reputation/grpc/service.go | 16 ++++++++-------- pkg/services/reputation/rpc/response.go | 12 ++++++------ pkg/services/reputation/rpc/server.go | 4 ++-- pkg/services/reputation/rpc/sign.go | 12 ++++++------ 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/cmd/neofs-node/reputation.go b/cmd/neofs-node/reputation.go index 880fc0d57..4119802c5 100644 --- a/cmd/neofs-node/reputation.go +++ b/cmd/neofs-node/reputation.go @@ -259,7 +259,7 @@ type reputationServer struct { routeBuilder reputationrouter.Builder } -func (s *reputationServer) SendLocalTrust(ctx context.Context, req *v2reputation.SendLocalTrustRequest) (*v2reputation.SendLocalTrustResponse, error) { +func (s *reputationServer) AnnounceLocalTrust(ctx context.Context, req *v2reputation.AnnounceLocalTrustRequest) (*v2reputation.AnnounceLocalTrustResponse, error) { passedRoute := reverseRoute(req.GetVerificationHeader()) passedRoute = append(passedRoute, s) @@ -282,13 +282,13 @@ func (s *reputationServer) SendLocalTrust(ctx context.Context, req *v2reputation } } - resp := new(v2reputation.SendLocalTrustResponse) - resp.SetBody(new(v2reputation.SendLocalTrustResponseBody)) + resp := new(v2reputation.AnnounceLocalTrustResponse) + resp.SetBody(new(v2reputation.AnnounceLocalTrustResponseBody)) return resp, nil } -func (s *reputationServer) SendIntermediateResult(ctx context.Context, req *v2reputation.SendIntermediateResultRequest) (*v2reputation.SendIntermediateResultResponse, error) { +func (s *reputationServer) AnnounceIntermediateResult(ctx context.Context, req *v2reputation.AnnounceIntermediateResultRequest) (*v2reputation.AnnounceIntermediateResultResponse, error) { passedRoute := reverseRoute(req.GetVerificationHeader()) passedRoute = append(passedRoute, s) @@ -303,15 +303,15 @@ func (s *reputationServer) SendIntermediateResult(ctx context.Context, req *v2re v2Trust := body.GetTrust() - trust := apiToLocalTrust(v2Trust.GetTrust(), v2Trust.GetTrustingPeer().GetValue()) + trust := apiToLocalTrust(v2Trust.GetTrust(), v2Trust.GetTrustingPeer().GetPublicKey()) err = w.Write(trust) if err != nil { return nil, errors.Wrap(err, "could not write intermediate trust") } - resp := new(v2reputation.SendIntermediateResultResponse) - resp.SetBody(new(v2reputation.SendIntermediateResultResponseBody)) + resp := new(v2reputation.AnnounceIntermediateResultResponse) + resp.SetBody(new(v2reputation.AnnounceIntermediateResultResponseBody)) return resp, nil } @@ -331,7 +331,7 @@ func apiToLocalTrust(t *v2reputation.Trust, trustingPeer []byte) reputation.Trus localTrust := reputation.Trust{} localTrust.SetValue(reputation.TrustValueFromFloat64(t.GetValue())) - localTrust.SetPeer(reputation.PeerIDFromBytes(t.GetPeer().GetValue())) + localTrust.SetPeer(reputation.PeerIDFromBytes(t.GetPeer().GetPublicKey())) localTrust.SetTrustingPeer(reputation.PeerIDFromBytes(trustingPeer)) return localTrust diff --git a/cmd/neofs-node/reputation/intermediate/remote.go b/cmd/neofs-node/reputation/intermediate/remote.go index c353738ce..ca8283d01 100644 --- a/cmd/neofs-node/reputation/intermediate/remote.go +++ b/cmd/neofs-node/reputation/intermediate/remote.go @@ -73,7 +73,7 @@ type RemoteTrustWriter struct { client apiClient.Client key *ecdsa.PrivateKey - buf []*apiClient.SendIntermediateTrustPrm + buf []*apiClient.AnnounceIntermediateTrustPrm } // Write check if passed context contains required @@ -94,7 +94,7 @@ func (rtp *RemoteTrustWriter) Write(t reputation.Trust) error { apiPeerToPeerTrust.SetTrustingPeer(apiTrustingPeer) apiPeerToPeerTrust.SetTrust(apiTrust) - p := &apiClient.SendIntermediateTrustPrm{} + p := &apiClient.AnnounceIntermediateTrustPrm{} p.SetEpoch(rtp.eiCtx.Epoch()) p.SetIteration(rtp.eiCtx.I()) p.SetTrust(apiPeerToPeerTrust) @@ -108,7 +108,7 @@ func (rtp *RemoteTrustWriter) Write(t reputation.Trust) error { // If error occurs, returns in immediately and stops iteration. func (rtp *RemoteTrustWriter) Close() (err error) { for _, prm := range rtp.buf { - _, err = rtp.client.SendIntermediateTrust( + _, err = rtp.client.AnnounceIntermediateTrust( rtp.eiCtx, *prm, apiClient.WithKey(rtp.key), diff --git a/cmd/neofs-node/reputation/local/remote.go b/cmd/neofs-node/reputation/local/remote.go index 3b63c988f..6d5df183a 100644 --- a/cmd/neofs-node/reputation/local/remote.go +++ b/cmd/neofs-node/reputation/local/remote.go @@ -84,12 +84,12 @@ func (rtp *RemoteTrustWriter) Write(t reputation.Trust) error { } func (rtp *RemoteTrustWriter) Close() error { - prm := apiClient.SendLocalTrustPrm{} + prm := apiClient.AnnounceLocalTrustPrm{} prm.SetEpoch(rtp.ctx.Epoch()) prm.SetTrusts(rtp.buf) - _, err := rtp.client.SendLocalTrust( + _, err := rtp.client.AnnounceLocalTrust( rtp.ctx, prm, apiClient.WithKey(rtp.key), diff --git a/go.mod b/go.mod index abfb423c2..106a1f43d 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/multiformats/go-multihash v0.0.13 // indirect github.com/nspcc-dev/hrw v1.0.9 github.com/nspcc-dev/neo-go v0.94.1 - github.com/nspcc-dev/neofs-api-go v1.25.1-0.20210427074637-bb217067f442 + github.com/nspcc-dev/neofs-api-go v1.26.0 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 diff --git a/go.sum b/go.sum index b0903f62f7af55f02c5ed931307b62d71ec28a46..f601bfccc0a3072dbf4bdbc95cc151c7390dcc20 100644 GIT binary patch delta 83 zcmbPsnfcZw<_*zVMrL{j3K@o0*@=PW&cy{urrBl{NfjPWiLQki+6JMf{-J&bmHFk~ n0s4W-0YQOT&PfK76H>(|du0hSnoa(l89F&3hih|Swrd>#-d-J& delta 145 zcmcb0iFw*(<_*zV0j7F}x(0ei21bSkCPwB4<|byw=DJBqMuz4FX69)oCPoSwhE@^T z?yf