hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
blocks_query_validator.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_BLOCKS_QUERY_VALIDATOR_HPP
7 #define IROHA_SHARED_MODEL_BLOCKS_QUERY_VALIDATOR_HPP
8 
10 #include "validators/answer.hpp"
11 
12 namespace shared_model {
13  namespace validation {
18  template <typename FieldValidator>
20  public:
22  const FieldValidator &field_validator = FieldValidator())
23  : field_validator_(field_validator) {}
24 
31  Answer answer;
32  std::string qry_reason_name = "Blocks query";
33  ReasonsGroupType qry_reason(qry_reason_name, GroupedReasons());
34 
36  qry.creatorAccountId());
39 
40  if (not qry_reason.second.empty()) {
41  answer.addReason(std::move(qry_reason));
42  }
43  return answer;
44  }
45 
46  protected:
49  };
50  } // namespace validation
51 } // namespace shared_model
52 
53 #endif // IROHA_SHARED_MODEL_BLOCKS_QUERY_VALIDATOR_HPP
Answer answer_
Definition: blocks_query_validator.hpp:47
FieldValidator field_validator_
Definition: blocks_query_validator.hpp:48
void validateCreatedTime(ReasonsGroupType &reason, interface::types::TimestampType timestamp, interface::types::TimestampType now) const
Definition: field_validator.cpp:266
BlocksQueryValidator(const FieldValidator &field_validator=FieldValidator())
Definition: blocks_query_validator.hpp:21
Definition: blocks_query.hpp:20
void addReason(ReasonsGroupType &&reasons)
Definition: answer.hpp:64
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
Answer validate(const interface::BlocksQuery &qry) const
Definition: blocks_query_validator.hpp:30
virtual const types::AccountIdType & creatorAccountId() const =0
Definition: proto_blocks_query.cpp:34
virtual types::TimestampType createdTime() const =0
Definition: blocks_query_validator.hpp:19
void validateCounter(ReasonsGroupType &reason, const interface::types::CounterType &counter) const
Definition: field_validator.cpp:293
Definition: field_validator.hpp:32
std::vector< ConcreteReasonType > GroupedReasons
Definition: answer.hpp:20
std::pair< ReasonsGroupName, GroupedReasons > ReasonsGroupType
Definition: answer.hpp:22
Definition: command_executor.hpp:12
void validateCreatorAccountId(ReasonsGroupType &reason, const interface::types::AccountIdType &account_id) const
Definition: field_validator.cpp:253
Definition: answer.hpp:28
virtual types::CounterType queryCounter() const =0
Definition: proto_blocks_query.cpp:39