Example #1
0
        public override Task <BlocksResponse> GetBlocks(BlockRequest request, ServerCallContext context)
        {
            var blocks = Blockchain.GetBlocks(request.PageNumber, request.ResultPerPage);

            BlocksResponse response = new BlocksResponse();

            foreach (Block block in blocks)
            {
                BlockModel mdl = ConvertBlock(block);
                response.Blocks.Add(mdl);
            }
            return(Task.FromResult(response));
        }
        public override Task <BlocksResponse> GetBlocks(BlockRequest request, ServerCallContext context)
        {
            var blocks = this.blockChain.GetBlocks(request.PageNumber, request.ResultPerPage);

            var response = new BlocksResponse();

            foreach (var block in blocks)
            {
                response.Blocks.Add(ConvertBlockToBlockModel(block));
            }

            return(Task.FromResult(response));
        }