LCOV - code coverage report
Current view: top level - shared_model/backend/protobuf/queries/impl - proto_get_transactions.cpp (source / functions) Hit Total Coverage
Test: coverage_cleared.info Lines: 9 10 90.0 %
Date: 2018-12-05 17:11:35 Functions: 8 25 32.0 %

          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/queries/proto_get_transactions.hpp"
       7             : #include <boost/range/numeric.hpp>
       8             : 
       9             : namespace shared_model {
      10             :   namespace proto {
      11             : 
      12             :     template <typename QueryType>
      13             :     GetTransactions::GetTransactions(QueryType &&query)
      14          75 :         : CopyableProto(std::forward<QueryType>(query)),
      15          76 :           get_transactions_{proto_->payload().get_transactions()},
      16             :           transaction_hashes_{[this] {
      17          70 :             return boost::accumulate(get_transactions_.tx_hashes(),
      18          69 :                                      TransactionHashesType{},
      19             :                                      [](auto &&acc, const auto &hash) {
      20          70 :                                        acc.emplace_back(hash);
      21          70 :                                        return std::forward<decltype(acc)>(acc);
      22             :                                      });
      23          76 :           }} {}
      24             : 
      25             :     template GetTransactions::GetTransactions(
      26             :         GetTransactions::TransportType &);
      27             :     template GetTransactions::GetTransactions(
      28             :         const GetTransactions::TransportType &);
      29             :     template GetTransactions::GetTransactions(
      30             :         GetTransactions::TransportType &&);
      31             : 
      32             :     GetTransactions::GetTransactions(const GetTransactions &o)
      33           0 :         : GetTransactions(o.proto_) {}
      34             : 
      35             :     GetTransactions::GetTransactions(GetTransactions &&o) noexcept
      36          76 :         : GetTransactions(std::move(o.proto_)) {}
      37             : 
      38             :     const GetTransactions::TransactionHashesType &
      39             :     GetTransactions::transactionHashes() const {
      40         172 :       return *transaction_hashes_;
      41             :     }
      42             : 
      43             :   }  // namespace proto
      44             : }  // namespace shared_model

Generated by: LCOV version 1.13