Beispiel #1
0
        public async Task get_block_header()
        {
            var args = new GetBlockHeaderArgs
            {
                BlockNum = 1
            };
            var resp = await Api.GetBlockHeaderAsync(args, CancellationToken.None).ConfigureAwait(false);

            TestPropetries(resp);
        }
Beispiel #2
0
        public void get_block_header()
        {
            var args = new GetBlockHeaderArgs()
            {
                BlockNum = 1
            };
            var resp = Api.GetBlockHeader(args, CancellationToken.None);

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

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

            TestPropetries(resp.Result.GetType(), obj.Result);
            WriteLine("----------------------------------------------------------------------------");
            WriteLine(obj);
        }
Beispiel #3
0
        /////////////////////////////
        // Blocks and transactions //
        /////////////////////////////

        /// <summary>
        /// API name: get_block_header
        /// Retrieve a block header
        ///
        ///
        /// </summary>
        /// <param name="args">API type: get_block_header_args</param>
        /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
        /// <returns>API type: get_block_header_return header of the referenced block, or null if no matching block was found</returns>
        /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
        public Task <JsonRpcResponse <GetBlockHeaderReturn> > GetBlockHeader(GetBlockHeaderArgs args, CancellationToken token)
        {
            return(CustomGetRequest <GetBlockHeaderReturn>(KnownApiNames.BlockApi, "get_block_header", args, token));
        }