hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
transaction_batch_helpers.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_TRANSACTION_BATCH_HELPERS_HPP
7 #define IROHA_TRANSACTION_BATCH_HELPERS_HPP
8 
9 #include <sstream>
10 
11 #include "cryptography/hash.hpp"
12 
13 namespace shared_model {
14  namespace interface {
15 
20  public:
28  template <typename Collection>
30  const Collection &reduced_hashes) {
31  std::stringstream concatenated_hash;
32  for (const auto &hash : reduced_hashes) {
33  concatenated_hash << hash.hex();
34  }
35  return types::HashType::fromHexString(concatenated_hash.str());
36  }
37  };
38  } // namespace interface
39 } // namespace shared_model
40 
41 #endif // IROHA_TRANSACTION_BATCH_HELPERS_HPP
Definition: hash.hpp:18
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
Definition: command_executor.hpp:12
Definition: transaction_batch_helpers.hpp:19
static Hash fromHexString(const std::string &hex)
Definition: hash.cpp:20
static types::HashType calculateReducedBatchHash(const Collection &reduced_hashes)
Definition: transaction_batch_helpers.hpp:29