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>>
28 
29  private:
30  template <typename Validator>
31  Answer validateImpl(
33  &transactions,
34  Validator &&validator) const;
35 
37  std::shared_ptr<ValidatorsConfig> config,
38  TransactionValidator transactions_validator);
39 
40  public:
42  std::shared_ptr<ValidatorsConfig> config)
44  TransactionValidator(config)) {}
45 
46  // TODO: IR-1505, igor-egorov, 2018-07-05 Remove method below when
47  // proposal and block will return collection of shared transactions
54  &transactions) const;
55 
57  const interface::types::SharedTxsCollectionType &transactions) const;
58 
60  &transactions,
61  interface::types::TimestampType current_timestamp) const;
62 
65  interface::types::TimestampType current_timestamp) const;
66 
68  };
69 
70  } // namespace validation
71 } // namespace shared_model
72 
73 #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:41
bool txs_duplicates_allowed_
Definition: transactions_collection_validator.hpp:27
const TransactionValidator & getTransactionValidator() const
Definition: transactions_collection_validator.cpp:145
Answer validate(const interface::types::TransactionsForwardCollectionType &transactions) const
Definition: transactions_collection_validator.cpp:106
TransactionValidator transaction_validator_
Definition: transactions_collection_validator.hpp:24
std::vector< std::shared_ptr< Transaction > > SharedTxsCollectionType
Definition: transaction_sequence_common.hpp:27
Definition: transaction_validator.hpp:288
Definition: command_executor.hpp:12
Definition: answer.hpp:28
Definition: transactions_collection_validator.hpp:22
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:64