public async Task AnnounceTrust(ulong epoch, List <Trust> trusts, CallOptions options = null, CancellationToken context = default) { var opts = DefaultCallOptions.ApplyCustomOptions(options); CheckOptions(opts); if (trusts is null) { throw new ArgumentNullException(nameof(trusts)); } var req = new AnnounceLocalTrustRequest { Body = new AnnounceLocalTrustRequest.Types.Body { Epoch = epoch, } }; req.Body.Trusts.AddRange(trusts); req.MetaHeader = opts.GetRequestMetaHeader(); opts.Key.Sign(req); var resp = await ReputationClient.AnnounceLocalTrustAsync(req, cancellationToken : context); if (!resp.Verify()) { throw new FormatException("invalid announce trust response"); } CheckStatus(resp); }
public async Task AnnounceTrust(AnnounceLocalTrustRequest request, DateTime?deadline = null, CancellationToken context = default) { var resp = await ReputationClient.AnnounceLocalTrustAsync(request, deadline : deadline, cancellationToken : context); if (!resp.Verify()) { throw new FormatException("invalid announce trust response"); } CheckStatus(resp); }