hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
simulator.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SIMULATOR_HPP
7 #define IROHA_SIMULATOR_HPP
8 
11 
15 #include "logger/logger_fwd.hpp"
18 
19 namespace iroha {
20  namespace ametsuchi {
21  class CommandExecutor;
22  }
23 
24  namespace simulator {
25 
27  public:
30 
31  Simulator(
32  // TODO IR-598 mboldyrev 2019.08.10: remove command_executor from
33  // Simulator
34  std::unique_ptr<iroha::ametsuchi::CommandExecutor> command_executor,
35  std::shared_ptr<validation::StatefulValidator> statefulValidator,
36  std::shared_ptr<ametsuchi::TemporaryFactory> factory,
37  std::shared_ptr<CryptoSignerType> crypto_signer,
38  std::unique_ptr<shared_model::interface::UnsafeBlockFactory>
40  logger::LoggerPtr log);
41 
42  VerifiedProposalCreatorEvent processProposal(
43  network::OrderingEvent const &event) override;
44 
45  BlockCreatorEvent processVerifiedProposal(
46  VerifiedProposalCreatorEvent const &event) override;
47 
48  private:
49  // internal
50  std::shared_ptr<iroha::ametsuchi::CommandExecutor> command_executor_;
51 
52  std::shared_ptr<validation::StatefulValidator> validator_;
53  std::shared_ptr<ametsuchi::TemporaryFactory> ametsuchi_factory_;
54  std::shared_ptr<CryptoSignerType> crypto_signer_;
55  std::unique_ptr<shared_model::interface::UnsafeBlockFactory>
56  block_factory_;
57 
58  logger::LoggerPtr log_;
59  };
60  } // namespace simulator
61 } // namespace iroha
62 
63 #endif // IROHA_SIMULATOR_HPP
Definition: block_creator_common.hpp:34
Definition: block_query.hpp:17
static const model::converters::PbBlockFactory block_factory
Definition: sha3_hash.cpp:15
Definition: simulator.hpp:26
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: block.hpp:16
Definition: verified_proposal_creator.hpp:20
Definition: block_query.hpp:15
Definition: ordering_gate_common.hpp:27
Definition: block_creator.hpp:18
Definition: verified_proposal_creator_common.hpp:21
Definition: abstract_crypto_model_signer.hpp:16