hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
util.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_PROTO_UTIL_HPP
7 #define IROHA_SHARED_MODEL_PROTO_UTIL_HPP
8 
9 #include <google/protobuf/message.h>
10 #include <vector>
11 #include "cryptography/blob.hpp"
12 
13 namespace shared_model {
14  namespace proto {
15 
16  template <typename T>
17  crypto::Blob makeBlob(T &&message) {
19  data.resize(message.ByteSizeLong());
20  message.SerializeToArray(data.data(), data.size());
21  return crypto::Blob(std::move(data));
22  }
23 
24  } // namespace proto
25 } // namespace shared_model
26 
27 #endif // IROHA_SHARED_MODEL_PROTO_UTIL_HPP
std::vector< uint8_t > Bytes
Definition: blob.hpp:26
Definition: blob.hpp:24
crypto::Blob makeBlob(T &&message)
Definition: util.hpp:17
Definition: command_executor.hpp:12