2021-03-24 08:12:25 +00:00
|
|
|
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 (
|
2021-05-07 09:34:24 +00:00
|
|
|
rpcReputationAnnounceLocalTrust = "AnnounceLocalTrust"
|
|
|
|
rpcReputationAnnounceIntermediateResult = "AnnounceIntermediateResult"
|
2021-03-24 08:12:25 +00:00
|
|
|
)
|
|
|
|
|
2021-05-07 09:34:24 +00:00
|
|
|
// AnnounceLocalTrust executes ReputationService.AnnounceLocalTrust RPC.
|
|
|
|
func AnnounceLocalTrust(
|
2021-03-24 08:12:25 +00:00
|
|
|
cli *client.Client,
|
2021-05-07 09:34:24 +00:00
|
|
|
req *reputation.AnnounceLocalTrustRequest,
|
2021-03-24 08:12:25 +00:00
|
|
|
opts ...client.CallOption,
|
2021-05-07 09:34:24 +00:00
|
|
|
) (*reputation.AnnounceLocalTrustResponse, error) {
|
|
|
|
resp := new(reputation.AnnounceLocalTrustResponse)
|
2021-03-24 08:12:25 +00:00
|
|
|
|
2021-05-07 09:34:24 +00:00
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceReputation, rpcReputationAnnounceLocalTrust), req, resp, opts...)
|
2021-03-24 08:12:25 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return resp, nil
|
|
|
|
}
|
2021-04-01 15:11:14 +00:00
|
|
|
|
2021-05-07 09:34:24 +00:00
|
|
|
// AnnounceIntermediateResult executes ReputationService.AnnounceIntermediateResult RPC.
|
|
|
|
func AnnounceIntermediateResult(
|
2021-04-01 15:11:14 +00:00
|
|
|
cli *client.Client,
|
2021-05-07 09:34:24 +00:00
|
|
|
req *reputation.AnnounceIntermediateResultRequest,
|
2021-04-01 15:11:14 +00:00
|
|
|
opts ...client.CallOption,
|
2021-09-27 11:31:38 +00:00
|
|
|
) (*reputation.AnnounceIntermediateResultResponse, error) {
|
|
|
|
resp := new(reputation.AnnounceIntermediateResultResponse)
|
2021-04-01 15:11:14 +00:00
|
|
|
|
2021-05-07 09:34:24 +00:00
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceReputation, rpcReputationAnnounceIntermediateResult), req, resp, opts...)
|
2021-04-01 15:11:14 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return resp, nil
|
|
|
|
}
|