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

#include "field_validator.hpp"

Collaboration diagram for shared_model::validation::FieldValidator:
Collaboration graph

Public Member Functions

 FieldValidator (std::shared_ptr< ValidatorsConfig > config, time_t future_gap=kDefaultFutureGap, TimeFunction time_provider=[] { return iroha::time::now();})
 
std::optional< ValidationErrorvalidateAccountId (const interface::types::AccountIdType &account_id) const
 
std::optional< ValidationErrorvalidateAssetId (const interface::types::AssetIdType &asset_id) const
 
std::optional< ValidationErrorvalidateEvmHexAddress (std::string_view address) const
 
std::optional< ValidationErrorvalidateBytecode (interface::types::EvmCodeHexStringView input) const
 
std::optional< ValidationErrorvalidatePeer (const interface::Peer &peer) const
 
std::optional< ValidationErrorvalidateAmount (const interface::Amount &amount) const
 
std::optional< ValidationErrorvalidatePubkey (std::string_view pubkey) const
 
std::optional< ValidationErrorvalidatePeerAddress (const interface::types::AddressType &address) const
 
std::optional< ValidationErrorvalidateRoleId (const interface::types::RoleIdType &role_id) const
 
std::optional< ValidationErrorvalidateAccountName (const interface::types::AccountNameType &account_name) const
 
std::optional< ValidationErrorvalidateDomainId (const interface::types::DomainIdType &domain_id) const
 
std::optional< ValidationErrorvalidateDomain (const interface::Domain &domain) const
 
std::optional< ValidationErrorvalidateAssetName (const interface::types::AssetNameType &asset_name) const
 
std::optional< ValidationErrorvalidateAccountDetailKey (const interface::types::AccountDetailKeyType &key) const
 
std::optional< ValidationErrorvalidateAccountDetailValue (const interface::types::AccountDetailValueType &value) const
 
std::optional< ValidationErrorvalidateOldAccountDetailValue (const std::optional< interface::types::AccountDetailValueType > &old_value) const
 
std::optional< ValidationErrorvalidatePrecision (const interface::types::PrecisionType &precision) const
 
std::optional< ValidationErrorvalidateRolePermission (const interface::permissions::Role &permission) const
 
std::optional< ValidationErrorvalidateGrantablePermission (const interface::permissions::Grantable &permission) const
 
std::optional< ValidationErrorvalidateQuorum (const interface::types::QuorumType &quorum) const
 
std::optional< ValidationErrorvalidateCreatorAccountId (const interface::types::AccountIdType &account_id) const
 
std::optional< ValidationErrorvalidateAccount (const interface::Account &account) const
 
std::optional< ValidationErrorvalidateCreatedTime (interface::types::TimestampType timestamp, interface::types::TimestampType now) const
 
std::optional< ValidationErrorvalidateCreatedTime (interface::types::TimestampType timestamp) const
 
std::optional< ValidationErrorvalidateCounter (const interface::types::CounterType &counter) const
 
std::optional< ValidationErrorvalidateSignatureForm (const interface::Signature &signature) const
 
std::optional< ValidationErrorvalidateSignatures (const interface::types::SignatureRangeType &signatures, const crypto::Blob &source) const
 
std::optional< ValidationErrorvalidateQueryPayloadMeta (const interface::QueryPayloadMeta &meta) const
 
std::optional< ValidationErrorvalidateDescription (const interface::types::DescriptionType &description) const
 
std::optional< ValidationErrorvalidateBatchMeta (const interface::BatchMeta &description) const
 
std::optional< ValidationErrorvalidateHeight (const interface::types::HeightType &height) const
 
std::optional< ValidationErrorvalidateHash (const crypto::Hash &hash) const
 
std::optional< ValidationErrorvalidateTxPaginationMeta (const interface::TxPaginationMeta &tx_pagination_meta) const
 
std::optional< ValidationErrorvalidateAccountAsset (const interface::AccountAsset &account_asset) const
 
std::optional< ValidationErrorvalidateAsset (const interface::Asset &asset) const
 
std::optional< ValidationErrorvalidateAssetPaginationMeta (const interface::AssetPaginationMeta &asset_pagination_meta) const
 
std::optional< ValidationErrorvalidateAccountDetailRecordId (const interface::AccountDetailRecordId &record_id) const
 
std::optional< ValidationErrorvalidateAccountDetailPaginationMeta (const interface::AccountDetailPaginationMeta &pagination_meta) const
 

Public Attributes

size_t max_description_size
 

Static Public Attributes

static constexpr auto kMaxDelay
 
static constexpr auto kDefaultFutureGap
 
static constexpr size_t hash_size
 
static constexpr size_t value_size = 4 * 1024 * 1024
 limit for the set account detail size in bytes More...
 

Detailed Description

Class that validates fields of commands, concrete queries, transaction, and query

Constructor & Destructor Documentation

◆ FieldValidator()

shared_model::validation::FieldValidator::FieldValidator ( std::shared_ptr< ValidatorsConfig config,
time_t  future_gap = kDefaultFutureGap,
TimeFunction  time_provider = [] { return iroha::time::now(); } 
)

Member Function Documentation

◆ validateAccount()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccount ( const interface::Account account) const
Here is the call graph for this function:

◆ validateAccountAsset()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccountAsset ( const interface::AccountAsset account_asset) const
Here is the call graph for this function:

◆ validateAccountDetailKey()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccountDetailKey ( const interface::types::AccountDetailKeyType key) const
Here is the caller graph for this function:

◆ validateAccountDetailPaginationMeta()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccountDetailPaginationMeta ( const interface::AccountDetailPaginationMeta pagination_meta) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateAccountDetailRecordId()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccountDetailRecordId ( const interface::AccountDetailRecordId record_id) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateAccountDetailValue()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccountDetailValue ( const interface::types::AccountDetailValueType value) const
Here is the caller graph for this function:

◆ validateAccountId()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccountId ( const interface::types::AccountIdType account_id) const
Here is the caller graph for this function:

◆ validateAccountName()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAccountName ( const interface::types::AccountNameType account_name) const
Here is the caller graph for this function:

◆ validateAmount()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAmount ( const interface::Amount amount) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateAsset()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAsset ( const interface::Asset asset) const
Here is the call graph for this function:

◆ validateAssetId()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAssetId ( const interface::types::AssetIdType asset_id) const
Here is the caller graph for this function:

◆ validateAssetName()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAssetName ( const interface::types::AssetNameType asset_name) const
Here is the caller graph for this function:

◆ validateAssetPaginationMeta()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateAssetPaginationMeta ( const interface::AssetPaginationMeta asset_pagination_meta) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateBatchMeta()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateBatchMeta ( const interface::BatchMeta description) const

◆ validateBytecode()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateBytecode ( interface::types::EvmCodeHexStringView  input) const
Here is the caller graph for this function:

◆ validateCounter()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateCounter ( const interface::types::CounterType counter) const
Here is the caller graph for this function:

◆ validateCreatedTime() [1/2]

std::optional< ValidationError > shared_model::validation::FieldValidator::validateCreatedTime ( interface::types::TimestampType  timestamp,
interface::types::TimestampType  now 
) const

Validate timestamp against now

Here is the caller graph for this function:

◆ validateCreatedTime() [2/2]

std::optional< ValidationError > shared_model::validation::FieldValidator::validateCreatedTime ( interface::types::TimestampType  timestamp) const

Validate timestamp against time_provider_

Here is the call graph for this function:

◆ validateCreatorAccountId()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateCreatorAccountId ( const interface::types::AccountIdType account_id) const
Here is the caller graph for this function:

◆ validateDescription()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateDescription ( const interface::types::DescriptionType description) const
Here is the caller graph for this function:

◆ validateDomain()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateDomain ( const interface::Domain domain) const
Here is the call graph for this function:

◆ validateDomainId()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateDomainId ( const interface::types::DomainIdType domain_id) const

Check if the given string domain_id is in valid domain syntax defined in the RFC 1035 and 1123. Return the result of the validation.

The domain syntax in RFC 1035 is given below:

<domain> ::= <subdomain> | ” ” <subdomain> ::= <label> | <subdomain> “.” <label> <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> <let-dig-hyp> ::= <let-dig> | “-” <let-dig> ::= <letter> | <digit> <letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case <digit> ::= any one of the ten digits 0 through 9

And the subsequent RFC 1123 disallows the root white space.

If the validation is not successful reason is updated with corresponding message

Here is the caller graph for this function:

◆ validateEvmHexAddress()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateEvmHexAddress ( std::string_view  address) const
Here is the caller graph for this function:

◆ validateGrantablePermission()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateGrantablePermission ( const interface::permissions::Grantable permission) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateHash()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateHash ( const crypto::Hash hash) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateHeight()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateHeight ( const interface::types::HeightType height) const
Here is the caller graph for this function:

◆ validateOldAccountDetailValue()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateOldAccountDetailValue ( const std::optional< interface::types::AccountDetailValueType > &  old_value) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validatePeer()

std::optional< ValidationError > shared_model::validation::FieldValidator::validatePeer ( const interface::Peer peer) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validatePeerAddress()

std::optional< ValidationError > shared_model::validation::FieldValidator::validatePeerAddress ( const interface::types::AddressType address) const
Here is the caller graph for this function:

◆ validatePrecision()

std::optional< ValidationError > shared_model::validation::FieldValidator::validatePrecision ( const interface::types::PrecisionType precision) const
Here is the caller graph for this function:

◆ validatePubkey()

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

◆ validateQueryPayloadMeta()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateQueryPayloadMeta ( const interface::QueryPayloadMeta meta) const

◆ validateQuorum()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateQuorum ( const interface::types::QuorumType quorum) const
Here is the caller graph for this function:

◆ validateRoleId()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateRoleId ( const interface::types::RoleIdType role_id) const
Here is the caller graph for this function:

◆ validateRolePermission()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateRolePermission ( const interface::permissions::Role permission) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateSignatureForm()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateSignatureForm ( const interface::Signature signature) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateSignatures()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateSignatures ( const interface::types::SignatureRangeType signatures,
const crypto::Blob source 
) const
Here is the call graph for this function:

◆ validateTxPaginationMeta()

std::optional< ValidationError > shared_model::validation::FieldValidator::validateTxPaginationMeta ( const interface::TxPaginationMeta tx_pagination_meta) const
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ hash_size

constexpr size_t shared_model::validation::FieldValidator::hash_size
static

◆ kDefaultFutureGap

constexpr auto shared_model::validation::FieldValidator::kDefaultFutureGap
static
Initial value:
=
std::chrono::minutes(5) / std::chrono::milliseconds(1)

◆ kMaxDelay

constexpr auto shared_model::validation::FieldValidator::kMaxDelay
static
Initial value:
=
std::chrono::hours(24) / std::chrono::milliseconds(1)

◆ max_description_size

size_t shared_model::validation::FieldValidator::max_description_size

◆ value_size

constexpr size_t shared_model::validation::FieldValidator::value_size = 4 * 1024 * 1024
static

limit for the set account detail size in bytes


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