LCOV - code coverage report
Current view: top level - shared_model/backend/protobuf/query_responses/impl - proto_transaction_page_response.cpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 13 14 92.9 %
Date: 2019-03-07 14:46:43 Functions: 10 22 45.5 %

          Line data    Source code
       1             : /**
       2             :  * Copyright Soramitsu Co., Ltd. All Rights Reserved.
       3             :  * SPDX-License-Identifier: Apache-2.0
       4             :  */
       5             : 
       6             : #include "backend/protobuf/query_responses/proto_transactions_page_response.hpp"
       7             : #include "common/byteutils.hpp"
       8             : 
       9             : namespace shared_model {
      10             :   namespace proto {
      11             : 
      12             :     template <typename QueryResponseType>
      13             :     TransactionsPageResponse::TransactionsPageResponse(
      14             :         QueryResponseType &&queryResponse)
      15          41 :         : CopyableProto(std::forward<QueryResponseType>(queryResponse)),
      16          41 :           transactionPageResponse_{proto_->transactions_page_response()},
      17          41 :           transactions_{transactionPageResponse_.transactions().begin(),
      18          41 :                         transactionPageResponse_.transactions().end()},
      19             :           next_hash_{[this]() -> boost::optional<interface::types::HashType> {
      20          41 :             switch (transactionPageResponse_.next_page_tag_case()) {
      21             :               case iroha::protocol::TransactionsPageResponse::kNextTxHash:
      22           3 :                 return crypto::Hash::fromHexString(
      23           3 :                     transactionPageResponse_.next_tx_hash());
      24             :               default:
      25          38 :                 return boost::none;
      26             :             }
      27          41 :           }()} {}
      28             : 
      29             :     template TransactionsPageResponse::TransactionsPageResponse(
      30             :         TransactionsPageResponse::TransportType &);
      31             :     template TransactionsPageResponse::TransactionsPageResponse(
      32             :         const TransactionsPageResponse::TransportType &);
      33             :     template TransactionsPageResponse::TransactionsPageResponse(
      34             :         TransactionsPageResponse::TransportType &&);
      35             : 
      36             :     TransactionsPageResponse::TransactionsPageResponse(
      37             :         const TransactionsPageResponse &o)
      38           0 :         : TransactionsPageResponse(o.proto_) {}
      39             : 
      40             :     TransactionsPageResponse::TransactionsPageResponse(
      41             :         TransactionsPageResponse &&o)
      42          41 :         : TransactionsPageResponse(std::move(o.proto_)) {}
      43             : 
      44             :     interface::types::TransactionsCollectionType
      45             :     TransactionsPageResponse::transactions() const {
      46          73 :       return transactions_;
      47             :     }
      48             : 
      49             :     boost::optional<interface::types::HashType>
      50             :     TransactionsPageResponse::nextTxHash() const {
      51          19 :       return next_hash_;
      52             :     }
      53             : 
      54             :     interface::types::TransactionsNumberType
      55             :     TransactionsPageResponse::allTransactionsSize() const {
      56          10 :       return transactionPageResponse_.all_transactions_size();
      57             :     }
      58             : 
      59             :   }  // namespace proto
      60             : }  // namespace shared_model

Generated by: LCOV version 1.13