hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
transactions_collection_validator.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_TRANSACTIONS_COLLECTION_VALIDATOR_HPP
7 #define IROHA_TRANSACTIONS_COLLECTION_VALIDATOR_HPP
8 
11 #include "validators/answer.hpp"
13 
14 namespace shared_model {
15  namespace validation {
16 
21  template <typename TransactionValidator, bool CollectionCanBeEmpty = false>
23  protected:
25  std::shared_ptr<AbstractValidator<interface::TransactionBatch>>
27 
28  private:
29  template <typename Validator>
30  Answer validateImpl(
32  &transactions,
33  Validator &&validator) const;
34 
36  std::shared_ptr<ValidatorsConfig> config,
37  TransactionValidator transactions_validator);
38 
39  public:
41  std::shared_ptr<ValidatorsConfig> config)
43  TransactionValidator(config)) {}
44 
45  // TODO: IR-1505, igor-egorov, 2018-07-05 Remove method below when
46  // proposal and block will return collection of shared transactions
53  &transactions) const;
54 
56  const interface::types::SharedTxsCollectionType &transactions) const;
57 
59  &transactions,
60  interface::types::TimestampType current_timestamp) const;
61 
64  interface::types::TimestampType current_timestamp) const;
65 
67  };
68 
69  } // namespace validation
70 } // namespace shared_model
71 
72 #endif // IROHA_TRANSACTIONS_COLLECTION_VALIDATOR_HPP
boost::any_range< Transaction, boost::forward_traversal_tag, const Transaction & > TransactionsForwardCollectionType
Definition: transaction_sequence_common.hpp:25
std::shared_ptr< AbstractValidator< interface::TransactionBatch > > batch_validator_
Definition: transactions_collection_validator.hpp:26
TransactionsCollectionValidator(std::shared_ptr< ValidatorsConfig > config)
Definition: transactions_collection_validator.hpp:40
Answer validate(const interface::types::TransactionsForwardCollectionType &transactions) const
Definition: transactions_collection_validator.cpp:89
TransactionValidator transaction_validator_
Definition: transactions_collection_validator.hpp:24
const TransactionValidator & getTransactionValidator() const
Definition: transactions_collection_validator.cpp:128
Definition: transaction_validator.hpp:249
Definition: command_executor.hpp:12
Definition: answer.hpp:28
std::vector< std::shared_ptr< Transaction >> SharedTxsCollectionType
Definition: transaction_sequence_common.hpp:27
Definition: transactions_collection_validator.hpp:22
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:59