hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::validation::TransactionValidator< FieldValidator, CommandValidator > Class Template Reference

#include "transaction_validator.hpp"

Inheritance diagram for shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >:
Inheritance graph
Collaboration diagram for shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >:
Collaboration graph

Public Member Functions

 TransactionValidator (const std::shared_ptr< ValidatorsConfig > &config)
 
Answer validate (const interface::Transaction &tx) const override
 
Answer validate (const interface::Transaction &tx, interface::types::TimestampType current_timestamp) const
 
- Public Member Functions inherited from shared_model::validation::AbstractValidator< interface::Transaction >
virtual ~AbstractValidator ()=default
 

Protected Attributes

FieldValidator field_validator_
 
std::shared_ptr< ValidatorsConfigvalidators_config_
 

Detailed Description

template<typename FieldValidator, typename CommandValidator>
class shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >

Class that validates commands from transaction

Template Parameters
FieldValidator
CommandValidator

Constructor & Destructor Documentation

template<typename FieldValidator , typename CommandValidator >
shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >::TransactionValidator ( const std::shared_ptr< ValidatorsConfig > &  config)
inlineexplicit

Member Function Documentation

template<typename FieldValidator , typename CommandValidator >
Answer shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >::validate ( const interface::Transaction tx) const
inlineoverridevirtual

Applies validation to given transaction

Parameters
tx- transaction to validate
Returns
Answer containing found error if any

Implements shared_model::validation::AbstractValidator< interface::Transaction >.

template<typename FieldValidator , typename CommandValidator >
Answer shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >::validate ( const interface::Transaction tx,
interface::types::TimestampType  current_timestamp 
) const
inline

Validates transaction against current_timestamp instead of time provider

Member Data Documentation

template<typename FieldValidator , typename CommandValidator >
FieldValidator shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >::field_validator_
protected
template<typename FieldValidator , typename CommandValidator >
std::shared_ptr<ValidatorsConfig> shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >::validators_config_
protected

The documentation for this class was generated from the following file: