From 51d443c6fc5c284bdd4b55bbb980717708a0990f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 24 Mar 2021 11:12:25 +0300 Subject: [PATCH] [#265] v2/rpc: Add SendLocalTrust RPC Signed-off-by: Leonard Lyubich --- v2/rpc/reputation.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 v2/rpc/reputation.go diff --git a/v2/rpc/reputation.go b/v2/rpc/reputation.go new file mode 100644 index 00000000..6cef7068 --- /dev/null +++ b/v2/rpc/reputation.go @@ -0,0 +1,29 @@ +package rpc + +import ( + "github.com/nspcc-dev/neofs-api-go/rpc/client" + "github.com/nspcc-dev/neofs-api-go/rpc/common" + "github.com/nspcc-dev/neofs-api-go/v2/reputation" +) + +const serviceReputation = serviceNamePrefix + "reputation.ReputationService" + +const ( + rpcReputationSendLocalTrust = "SendLocalTrust" +) + +// SendLocalTrust executes ReputationService.SendLocalTrust RPC. +func SendLocalTrust( + cli *client.Client, + req *reputation.SendLocalTrustRequest, + opts ...client.CallOption, +) (*reputation.SendLocalTrustResponse, error) { + resp := new(reputation.SendLocalTrustResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceReputation, rpcReputationSendLocalTrust), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +}