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>
13 #include "logger/logger_fwd.hpp"
15 
16 namespace shared_model {
17  namespace interface {
18  class PermissionToString;
19  }
20 } // namespace shared_model
21 
22 namespace iroha {
23 
24  namespace ametsuchi {
25  class TransactionExecutor;
26 
27  class TemporaryWsvImpl : public TemporaryWsv {
28  friend class StorageImpl;
29 
30  public:
33  std::string savepoint_name,
34  logger::LoggerPtr log);
35 
36  void release() override;
37 
38  ~SavepointWrapperImpl() override;
39 
40  private:
41  soci::session &sql_;
42  std::string savepoint_name_;
43  bool is_released_;
44  logger::LoggerPtr log_;
45  };
46 
48  std::unique_ptr<soci::session> sql,
49  std::shared_ptr<shared_model::interface::PermissionToString>
50  perm_converter,
51  logger::LoggerManagerTreePtr log_manager);
52 
53  expected::Result<void, validation::CommandError> apply(
54  const shared_model::interface::Transaction &transaction) override;
55 
56  std::unique_ptr<TemporaryWsv::SavepointWrapper> createSavepoint(
57  const std::string &name) override;
58 
59  ~TemporaryWsvImpl() override;
60 
61  private:
66  expected::Result<void, validation::CommandError> validateSignatures(
67  const shared_model::interface::Transaction &transaction);
68 
69  std::unique_ptr<soci::session> sql_;
70  std::unique_ptr<TransactionExecutor> transaction_executor_;
71 
72  logger::LoggerManagerTreePtr log_manager_;
73  logger::LoggerPtr log_;
74  };
75  } // namespace ametsuchi
76 } // namespace iroha
77 
78 #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:27
Definition: temporary_wsv.hpp:27
Definition: block_query.hpp:14
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:41
Definition: transaction.hpp:22