Пример #1
0
        public async Task get_discussion()
        {
            var args = new GetDiscussionArgs
            {
                Author   = "steepshot",
                Permlink = "let-s-make-steem-great-again-incentives-to-sponsors-announcement-from-steepshot"
            };
            var resp = await Api.GetDiscussionAsync(args, CancellationToken.None).ConfigureAwait(false);

            TestPropetries(resp);
        }
Пример #2
0
        private int GetVoteState(string author, string permlink, UserInfo user)
        {
            var args = new GetDiscussionArgs()
            {
                Author   = author,
                Permlink = permlink
            };
            var resp = Api.GetDiscussion(args, CancellationToken.None);

            Console.WriteLine(resp.Error);
            Assert.IsFalse(resp.IsError);
            var vote = resp.Result.ActiveVotes.FirstOrDefault(i => i.Voter.Equals(user.Login));

            return(vote?.Percent ?? 0);
        }
Пример #3
0
        private async Task <int> GetVoteState(string author, string permlink, UserInfo user)
        {
            var args = new GetDiscussionArgs
            {
                Author   = author,
                Permlink = permlink
            };
            var resp = await Api.GetDiscussionAsync(args, CancellationToken.None).ConfigureAwait(false);

            if (resp.IsError)
            {
                WriteLine(resp);
                Assert.IsFalse(resp.IsError);
            }
            var vote = resp.Result.ActiveVotes.FirstOrDefault(i => i.Voter.Equals(user.Login));

            return(vote?.Percent ?? 0);
        }
Пример #4
0
        public void get_discussion()
        {
            var args = new GetDiscussionArgs()
            {
                Author   = "steepshot",
                Permlink = "let-s-make-steem-great-again-incentives-to-sponsors-announcement-from-steepshot",
            };
            var resp = Api.GetDiscussion(args, CancellationToken.None);

            WriteLine(resp);
            Assert.IsFalse(resp.IsError);

            var obj = Api.CustomGetRequest <JObject>(KnownApiNames.TagsApi, "get_discussion", args, CancellationToken.None);

            TestPropetries(resp.Result.GetType(), obj.Result);
            WriteLine("----------------------------------------------------------------------------");
            WriteLine(obj);
        }
Пример #5
0
 /// <summary>
 /// API name: get_discussion
 ///
 /// </summary>
 /// <param name="args">API type: get_discussion_args</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <returns>API type: get_discussion_return</returns>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <GetDiscussionReturn> > GetDiscussion(GetDiscussionArgs args, CancellationToken token)
 {
     return(CustomGetRequest <GetDiscussionReturn>(KnownApiNames.TagsApi, "get_discussion", args, token));
 }