hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
temporary_wsv_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_TEMPORARY_WSV_IMPL_HPP
7 #define IROHA_TEMPORARY_WSV_IMPL_HPP
8 
10 
11 #include <soci/soci.h>
14 #include "logger/logger_fwd.hpp"
16 
17 namespace shared_model {
18  namespace interface {
19  class PermissionToString;
20  }
21 } // namespace shared_model
22 
23 namespace iroha {
24 
25  namespace ametsuchi {
26  class TemporaryWsvImpl : public TemporaryWsv {
27  friend class StorageImpl;
28 
29  public:
32  std::string savepoint_name,
33  logger::LoggerPtr log);
34 
35  void release() override;
36 
37  ~SavepointWrapperImpl() override;
38 
39  private:
40  soci::session &sql_;
41  std::string savepoint_name_;
42  bool is_released_;
43  logger::LoggerPtr log_;
44  };
45 
47  std::unique_ptr<soci::session> sql,
48  std::shared_ptr<shared_model::interface::CommonObjectsFactory>
49  factory,
50  std::shared_ptr<shared_model::interface::PermissionToString>
51  perm_converter,
52  logger::LoggerManagerTreePtr log_manager);
53 
54  expected::Result<void, validation::CommandError> apply(
55  const shared_model::interface::Transaction &transaction) override;
56 
57  std::unique_ptr<TemporaryWsv::SavepointWrapper> createSavepoint(
58  const std::string &name) override;
59 
60  ~TemporaryWsvImpl() override;
61 
62  private:
67  expected::Result<void, validation::CommandError> validateSignatures(
68  const shared_model::interface::Transaction &transaction);
69 
70  std::unique_ptr<soci::session> sql_;
71  std::unique_ptr<CommandExecutor> command_executor_;
72 
73  logger::LoggerManagerTreePtr log_manager_;
74  logger::LoggerPtr log_;
75  };
76  } // namespace ametsuchi
77 } // namespace iroha
78 
79 #endif // IROHA_TEMPORARY_WSV_IMPL_HPP
decltype(auto) constexpr apply(Tuple &&t, F &&f)
apply F to Tuple
Definition: soci_utils.hpp:72
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: temporary_wsv_impl.hpp:26
Definition: temporary_wsv.hpp:27
Definition: block_query.hpp:16
std::shared_ptr< LoggerManagerTree > LoggerManagerTreePtr
Definition: logger_manager_fwd.hpp:14
Definition: temporary_wsv.hpp:33
Definition: command_executor.hpp:12
Definition: storage_impl.hpp:37
Definition: transaction.hpp:22