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.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 TemporaryWsvImpl : public TemporaryWsv {
26  friend class StorageImpl;
27 
28  public:
31  std::string savepoint_name);
32 
33  void release() override;
34 
35  ~SavepointWrapperImpl() override;
36 
37  private:
38  soci::session &sql_;
39  std::string savepoint_name_;
40  bool is_released_;
41  logger::Logger log_;
42  };
43 
45  std::unique_ptr<soci::session> sql,
46  std::shared_ptr<shared_model::interface::CommonObjectsFactory>
47  factory,
48  std::shared_ptr<shared_model::interface::PermissionToString>
49  perm_converter,
50  logger::Logger log = logger::log("TemporaryWSV"));
51 
52  expected::Result<void, validation::CommandError> apply(
53  const shared_model::interface::Transaction &transaction) override;
54 
55  std::unique_ptr<TemporaryWsv::SavepointWrapper> createSavepoint(
56  const std::string &name) override;
57 
58  ~TemporaryWsvImpl() override;
59 
60  private:
65  expected::Result<void, validation::CommandError> validateSignatures(
66  const shared_model::interface::Transaction &transaction);
67 
68  std::unique_ptr<soci::session> sql_;
69  std::unique_ptr<CommandExecutor> command_executor_;
70 
71  logger::Logger log_;
72  };
73  } // namespace ametsuchi
74 } // namespace iroha
75 
76 #endif // IROHA_TEMPORARY_WSV_IMPL_HPP
decltype(auto) constexpr apply(Tuple &&t, F &&f)
apply F to Tuple
Definition: soci_utils.hpp:72
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
name
Definition: setup.py:67
std::shared_ptr< spdlog::logger > Logger
Definition: logger.hpp:26
Definition: temporary_wsv_impl.hpp:25
Definition: temporary_wsv.hpp:27
Definition: block_query.hpp:16
Logger log(const std::string &tag)
Definition: logger.cpp:48
Definition: temporary_wsv.hpp:33
Definition: command_executor.hpp:12
Definition: storage_impl.hpp:36
Definition: transaction.hpp:22