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 
13 
14 namespace shared_model {
15  namespace validation {
16 
21  template <typename TransactionValidator,
22  typename OrderValidator,
23  bool CollectionCanBeEmpty>
25  protected:
27  OrderValidator order_validator_;
29 
30  private:
31  template <typename Validator>
32  std::optional<ValidationError> validateImpl(
34  &transactions,
35  Validator &&validator) const;
36 
37  public:
38  TransactionsCollectionValidator(std::shared_ptr<ValidatorsConfig> config);
39 
40  // TODO: IR-1505, igor-egorov, 2018-07-05 Remove method below when
41  // proposal and block will return collection of shared transactions
47  std::optional<ValidationError> validate(
49  &transactions) const;
50 
51  std::optional<ValidationError> validate(
52  const interface::types::SharedTxsCollectionType &transactions) const;
53 
54  std::optional<ValidationError> validate(
56  &transactions,
57  interface::types::TimestampType current_timestamp) const;
58 
59  std::optional<ValidationError> validate(
61  interface::types::TimestampType current_timestamp) const;
62 
64  };
65 
66  } // namespace validation
67 } // namespace shared_model
68 
69 #endif // IROHA_TRANSACTIONS_COLLECTION_VALIDATOR_HPP
const TransactionValidator & getTransactionValidator() const
Definition: transactions_collection_validator.cpp:151
boost::any_range< Transaction, boost::forward_traversal_tag, const Transaction & > TransactionsForwardCollectionType
Definition: transaction_sequence_common.hpp:25
bool txs_duplicates_allowed_
Definition: transactions_collection_validator.hpp:28
OrderValidator order_validator_
Definition: transactions_collection_validator.hpp:27
TransactionValidator transaction_validator_
Definition: transactions_collection_validator.hpp:26
TransactionsCollectionValidator(std::shared_ptr< ValidatorsConfig > config)
Definition: transactions_collection_validator.cpp:32
std::vector< std::shared_ptr< Transaction > > SharedTxsCollectionType
Definition: transaction_sequence_common.hpp:27
Definition: transaction_validator.hpp:285
std::optional< ValidationError > validate(const interface::types::TransactionsForwardCollectionType &transactions) const
Definition: transactions_collection_validator.cpp:96
Definition: command_executor.hpp:12
Definition: transactions_collection_validator.hpp:24
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:67