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)
 
std::optional< ValidationErrorvalidate (const interface::Transaction &tx) const override
 
std::optional< ValidationErrorvalidate (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_
 
CommandValidator command_validator_visitor_
 

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

◆ TransactionValidator()

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

Member Function Documentation

◆ validate() [1/2]

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

Applies validation to given transaction

Parameters
tx- transaction to validate
Returns
found error if any

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

Here is the caller graph for this function:

◆ validate() [2/2]

template<typename FieldValidator , typename CommandValidator >
std::optional<ValidationError> 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

◆ command_validator_visitor_

template<typename FieldValidator , typename CommandValidator >
CommandValidator shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >::command_validator_visitor_
protected

◆ field_validator_

template<typename FieldValidator , typename CommandValidator >
FieldValidator shared_model::validation::TransactionValidator< FieldValidator, CommandValidator >::field_validator_
protected

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