LCOV - code coverage report
Current view: top level - shared_model/backend/protobuf/queries/impl - proto_get_transactions.cpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 10 11 90.9 %
Date: 2019-03-07 14:46:43 Functions: 8 20 40.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          74 :         : CopyableProto(std::forward<QueryType>(query)),
      15          74 :           get_transactions_{proto_->payload().get_transactions()},
      16          75 :           transaction_hashes_{
      17          74 :              boost::accumulate(get_transactions_.tx_hashes(),
      18          74 :                                      TransactionHashesType{},
      19             :                                      [](auto &&acc, const auto &hash) {
      20          74 :                                        acc.push_back(crypto::Hash::fromHexString(hash));
      21          74 :                                        return std::forward<decltype(acc)>(acc);
      22          75 :                                      })} {}
      23             : 
      24             :     template GetTransactions::GetTransactions(GetTransactions::TransportType &);
      25             :     template GetTransactions::GetTransactions(
      26             :         const GetTransactions::TransportType &);
      27             :     template GetTransactions::GetTransactions(
      28             :         GetTransactions::TransportType &&);
      29             : 
      30             :     GetTransactions::GetTransactions(const GetTransactions &o)
      31           0 :         : GetTransactions(o.proto_) {}
      32             : 
      33             :     GetTransactions::GetTransactions(GetTransactions &&o) noexcept
      34          76 :         : GetTransactions(std::move(o.proto_)) {}
      35             : 
      36             :     const GetTransactions::TransactionHashesType &
      37             :     GetTransactions::transactionHashes() const {
      38         171 :       return transaction_hashes_;
      39             :     }
      40             : 
      41             :   }  // namespace proto
      42             : }  // namespace shared_model

Generated by: LCOV version 1.13