hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::validation Namespace Reference

Classes

class  AbstractValidator
 
class  AlwaysValidValidator
 
class  BatchOrderValidator
 
class  BatchValidator
 
class  BlocksQueryValidator
 
class  BlockValidator
 
class  CommandValidatorVisitor
 
class  FieldValidator
 
class  ProposalValidator
 
class  ProtoBlocksQueryValidator
 
class  ProtoBlockValidator
 
class  ProtoCommandValidator
 
class  ProtoProposalValidator
 
class  ProtoQueryValidator
 
class  ProtoTransactionValidator
 
class  QueryValidator
 
class  QueryValidatorVisitor
 
struct  Settings
 
class  SignableModelValidator
 
class  TransactionsCollectionValidator
 
class  TransactionValidator
 
struct  ValidationError
 Represents a validation error. More...
 
class  ValidationErrorCreator
 Helper class for ValidationError creation. More...
 
struct  ValidatorsConfig
 

Typedefs

using DefaultUnsignedTransactionValidator = TransactionValidator< FieldValidator, CommandValidatorVisitor< FieldValidator > >
 
using DefaultSignedTransactionValidator = SignableModelValidator< DefaultUnsignedTransactionValidator, const interface::Transaction &, FieldValidator >
 
using DefaultOptionalSignedTransactionValidator = SignableModelValidator< DefaultUnsignedTransactionValidator, const interface::Transaction &, FieldValidator, false >
 
using DefaultUnsignedQueryValidator = QueryValidator< FieldValidator, QueryValidatorVisitor< FieldValidator > >
 
using DefaultSignedQueryValidator = SignableModelValidator< DefaultUnsignedQueryValidator, const interface::Query &, FieldValidator >
 
using DefaultUnsignedBlocksQueryValidator = BlocksQueryValidator< FieldValidator >
 
using DefaultSignedBlocksQueryValidator = SignableModelValidator< DefaultUnsignedBlocksQueryValidator, const interface::BlocksQuery &, FieldValidator >
 
using DefaultUnsignedTransactionsValidator = TransactionsCollectionValidator< DefaultUnsignedTransactionValidator, BatchOrderValidator, false >
 
using DefaultUnsignedOptionalTransactionsValidator = TransactionsCollectionValidator< DefaultUnsignedTransactionValidator, BatchOrderValidator, true >
 
using DefaultSignedTransactionsValidator = TransactionsCollectionValidator< DefaultSignedTransactionValidator, BatchOrderValidator, false >
 
using DefaultProposalValidator = ProposalValidator< FieldValidator, DefaultSignedTransactionsValidator >
 
using DefaultUnsignedBlockValidator = BlockValidator< FieldValidator, DefaultUnsignedOptionalTransactionsValidator >
 
using DefaultSignedBlockValidator = SignableModelValidator< DefaultUnsignedBlockValidator, const interface::Block &, FieldValidator >
 
using DefaultBatchValidator = BatchValidator< BatchOrderValidator >
 
using ReasonType = std::string
 
using ReasonName = std::string
 

Functions

std::optional< ValidationErrorvalidatePubkey (const interface::types::PubkeyType &pubkey)
 
std::optional< ValidationErrorvalidatePaginationMetaPageSize (const size_t &page_size)
 
std::optional< ValidationErrorvalidateProtoQuery (const iroha::protocol::Query &qry)
 
std::unique_ptr< shared_model::validation::SettingsgetDefaultSettings ()
 
std::optional< ValidationErroroperator| (std::optional< ValidationError > oe1, std::optional< ValidationError > oe2)
 
std::optional< ValidationErroraggregateErrors (const ReasonName &name, std::vector< std::optional< ReasonType >> optional_reasons, std::vector< std::optional< ValidationError >> optional_child_errors)
 
std::ostream & operator<< (std::ostream &os, const ValidationError &o)
 
bool validateHexString (const std::string &str)
 

Variables

const size_t kDefaultDescriptionSize = 64
 

Typedef Documentation

◆ DefaultBatchValidator

◆ DefaultOptionalSignedTransactionValidator

Same as DefaultSignedTransactionValidator, but checks signatures only if they are present

◆ DefaultProposalValidator

Proposal validator which checks stateless validation of proposal

◆ DefaultSignedBlocksQueryValidator

Block query validator which checks stateless validation including signatures

◆ DefaultSignedBlockValidator

Block validator which checks blocks including signatures

◆ DefaultSignedQueryValidator

Query validator which checks stateless validation including signatures

◆ DefaultSignedTransactionsValidator

Transactions collection validator that checks signatures and stateless validness of transactions

◆ DefaultSignedTransactionValidator

Transaction validator which checks stateless validation and signature of transaction

◆ DefaultUnsignedBlocksQueryValidator

Block query validator checks stateless validation WITHOUT signatures

◆ DefaultUnsignedBlockValidator

Block validator which checks blocks WITHOUT signatures. Note that it does not check transactions' signatures as well

◆ DefaultUnsignedOptionalTransactionsValidator

Transactions collection validator that checks stateless validness of transactions WITHOUT signatures and allows transaction collection to be empty

◆ DefaultUnsignedQueryValidator

Query validator which checks stateless validation WITHOUT signatures

◆ DefaultUnsignedTransactionsValidator

Transactions collection validator that checks stateless validness of transactions WITHOUT signatures

◆ DefaultUnsignedTransactionValidator

Transaction validator which checks stateless validation WITHOUT signatures

◆ ReasonName

using shared_model::validation::ReasonName = typedef std::string

◆ ReasonType

using shared_model::validation::ReasonType = typedef std::string

Function Documentation

◆ aggregateErrors()

std::optional< ValidationError > shared_model::validation::aggregateErrors ( const ReasonName name,
std::vector< std::optional< ReasonType >>  optional_reasons,
std::vector< std::optional< ValidationError >>  optional_child_errors 
)

Create an error if provided some reasons or child errors.

Parameters
name- resulting error name.
optional_reasons- a collection of optional error reasons
optional_child_errors- optional child errors
Returns
an error with all present reasons and child errors from parameters, if any, or std::nullopt, if not any reason nor error provided.
Here is the caller graph for this function:

◆ getDefaultSettings()

std::unique_ptr< shared_model::validation::Settings > shared_model::validation::getDefaultSettings ( )
Here is the caller graph for this function:

◆ operator<<()

std::ostream & shared_model::validation::operator<< ( std::ostream &  os,
const ValidationError o 
)
Here is the call graph for this function:

◆ operator|()

std::optional<ValidationError> shared_model::validation::operator| ( std::optional< ValidationError oe1,
std::optional< ValidationError oe2 
)
Here is the caller graph for this function:

◆ validateHexString()

bool shared_model::validation::validateHexString ( const std::string &  str)

Check if given string has hex format

Parameters
strstring to check
Returns
true if string is in hex, false otherwise
Here is the caller graph for this function:

◆ validatePaginationMetaPageSize()

std::optional<ValidationError> shared_model::validation::validatePaginationMetaPageSize ( const size_t &  page_size)
Here is the caller graph for this function:

◆ validateProtoQuery()

std::optional<ValidationError> shared_model::validation::validateProtoQuery ( const iroha::protocol::Query &  qry)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validatePubkey()

std::optional< ValidationError > shared_model::validation::validatePubkey ( const interface::types::PubkeyType pubkey)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ kDefaultDescriptionSize

const size_t shared_model::validation::kDefaultDescriptionSize = 64