CatapultServer  v0.5.0.1 (Elephant)
catapult::validators Namespace Reference

Namespaces

 stateful
 
 stateless
 

Classes

class  AccountRestrictionView
 A view on top of a catapult cache cache for retrieving a typed account restriction. More...
 
class  ActiveMosaicView
 A view on top of a catapult cache cache for retrieving active mosaics. More...
 
class  AggregateEntityValidatorT
 An aggregate validator. More...
 
class  AggregateNotificationValidatorT
 A strongly typed aggregate notification validator. More...
 
class  AggregateValidatorBuilder
 A strongly typed aggregate notification validator builder. More...
 
class  DemuxValidatorBuilderT
 A demultiplexing validator builder. More...
 
class  EntityValidatorT
 
class  FunctionalNotificationValidatorT
 Notification validator that wraps a function. More...
 
class  NotificationValidatorAdapter
 
class  NotificationValidatorT
 A strongly typed notification validator. More...
 
class  ParallelValidationPolicy
 A parallel validation policy that performs parallel validations on multiple threads. More...
 
class  ValidatingNotificationSubscriber
 A notification subscriber that validates notifications. More...
 
struct  ValidatorContext
 Contextual information passed to stateful validators. More...
 

Typedefs

using Notification = model::AccountAddressNotification
 
using BalanceTransferNotification = model::BalanceTransferNotification
 
using BalanceDebitNotification = model::BalanceDebitNotification
 
using NameSet = std::unordered_set< std::string >
 
using CacheReadOnlyType = typename cache::AccountRestrictionCacheTypes::CacheReadOnlyType
 
using ValidationResultPredicate = predicate< ValidationResult >
 Validation result predicate. More...
 
template<typename... TArgs>
using ValidatorVectorT = std::vector< std::unique_ptr< const EntityValidatorT< TArgs... > >>
 A vector of validators. More...
 
using ValidationFunction = std::function< ValidationResult(const model::WeakEntityInfo &)>
 A validation function. More...
 
using ValidationFunctions = std::vector< ValidationFunction >
 A vector of validation functions. More...
 
template<typename TResult >
using ValidationPolicyFunc = std::function< TResult(const model::WeakEntityInfos &, const ValidationFunctions &)>
 Function signature for validation policies. More...
 

Enumerations

enum  FacilityCode : uint8_t {
  FacilityCode::COPY_FACILITY_CODE =(AccountLink), FacilityCode::COPY_FACILITY_CODE =(Aggregate), FacilityCode::COPY_FACILITY_CODE =(Core), FacilityCode::COPY_FACILITY_CODE =(LockHash),
  FacilityCode::COPY_FACILITY_CODE =(LockSecret), FacilityCode::COPY_FACILITY_CODE =(Metadata), FacilityCode::COPY_FACILITY_CODE =(Mosaic), FacilityCode::COPY_FACILITY_CODE =(Multisig),
  FacilityCode::COPY_FACILITY_CODE =(Namespace), FacilityCode::COPY_FACILITY_CODE =(RestrictionAccount), FacilityCode::COPY_FACILITY_CODE =(RestrictionMosaic), FacilityCode::COPY_FACILITY_CODE =(Transfer),
  FacilityCode::Chain = 0xFF, FacilityCode::Consumer = 0xFE, FacilityCode::Extension = 0x45, FacilityCode::Hash = 0x49,
  FacilityCode::Signature = 0x53
}
 Possible validation facility codes. More...
 
enum  ResultSeverity : uint8_t { ResultSeverity::Success = 0, ResultSeverity::Neutral = 1, ResultSeverity::Failure = 2 }
 Possible result severities (only two bits are used). More...
 
enum  ResultFlags : uint8_t { ResultFlags::None, ResultFlags::Verbose = 1 }
 Possible result flags (only six bits are used). More...
 
enum  ValidationResult : uint32_t { ValidationResult::Success = 0x00000000, ValidationResult::Neutral = 0x40000000, ValidationResult::Failure = 0x80000000 }
 Enumeration of all possible validation results. More...
 

Functions

 DECLARE_STATEFUL_VALIDATOR (Address, Notification)(model
 
 DECLARE_STATEFUL_VALIDATOR (Deadline, Notification)(const utils
 
 DEFINE_STATEFUL_VALIDATOR (EligibleHarvester, [](const auto &notification, const auto &context) { cache::ImportanceView view(context.Cache.template sub< cache::AccountStateCache >());return view.canHarvest(notification.Signer, context.Height) ? ValidationResult::Success :Failure_Core_Block_Harvester_Ineligible;})
 
 DECLARE_STATELESS_VALIDATOR (MaxTransactions, Notification)(uint32_t maxTransactions)
 
 DEFINE_STATEFUL_VALIDATOR (NemesisSink, [](const auto &notification, const auto &context) { auto isBlockHeightOne=context.Height==Height(1);auto isNemesisPublicKey=notification.Signer==context.Network.PublicKey;return isBlockHeightOne||!isNemesisPublicKey ? ValidationResult::Success :Failure_Core_Nemesis_Account_Signed_After_Nemesis_Block;})
 
 DECLARE_STATELESS_VALIDATOR (Network, Notification)(model
 
 DEFINE_CORE_RESULT (Past_Deadline, 1)
 Validation failed because the deadline passed. More...
 
 DEFINE_CORE_RESULT (Future_Deadline, 2)
 Validation failed because the deadline is too far in the future. More...
 
 DEFINE_CORE_RESULT (Insufficient_Balance, 3)
 Validation failed because the account has an insufficient balance. More...
 
 DEFINE_CORE_RESULT (Too_Many_Transactions, 4)
 Validation failed because there are too many transactions in a block. More...
 
 DEFINE_CORE_RESULT (Nemesis_Account_Signed_After_Nemesis_Block, 5)
 Validation failed because an entity originated from the nemesis account after the nemesis block. More...
 
 DEFINE_CORE_RESULT (Wrong_Network, 6)
 Validation failed because the entity has the wrong network specified. More...
 
 DEFINE_CORE_RESULT (Invalid_Address, 7)
 Validation failed because an address is invalid. More...
 
 DEFINE_CORE_RESULT (Invalid_Version, 8)
 Validation failed because entity version is invalid. More...
 
 DEFINE_CORE_RESULT (Invalid_Transaction_Fee, 9)
 Validation failed because a transaction fee is invalid. More...
 
 DEFINE_CORE_RESULT (Block_Harvester_Ineligible, 10)
 Validation failed because a block was harvested by an ineligible harvester. More...
 
 DEFINE_STATELESS_VALIDATOR (TransactionFee, [](const auto &notification) { if(notification.Fee > notification.MaxFee) return Failure_Core_Invalid_Transaction_Fee;constexpr auto Max_Raw_Block_Fee_Multiplier=static_cast< uint64_t >(std::numeric_limits< BlockFeeMultiplier::ValueType >::max());return notification.MaxFee.unwrap() > Max_Raw_Block_Fee_Multiplier *notification.TransactionSize ? Failure_Core_Invalid_Transaction_Fee :ValidationResult::Success;})
 
DECLARE_STATEFUL_VALIDATOR(Address, model::AccountAddressNotification)(model DECLARE_STATEFUL_VALIDATOR (NemesisSink, model::SignatureNotification)()
 
DECLARE_STATELESS_VALIDATOR(Network, model::EntityNotification)(model DECLARE_STATELESS_VALIDATOR (EntityVersion, model::EntityNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (EligibleHarvester, model::BlockNotification)()
 
 DECLARE_STATELESS_VALIDATOR (MaxTransactions, model::BlockNotification)(uint32_t maxTransactions)
 
DECLARE_STATEFUL_VALIDATOR(Deadline, model::TransactionDeadlineNotification)(const utils DECLARE_STATEFUL_VALIDATOR (BalanceTransfer, model::BalanceTransferNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (BalanceDebit, model::BalanceDebitNotification)()
 
 DECLARE_STATELESS_VALIDATOR (TransactionFee, model::TransactionFeeNotification)()
 
 DEFINE_VALIDATION_RESULT (Failure, Hash, Exists, 1, Verbose)
 Validation failed because the entity hash is already known. More...
 
 DEFINE_STATEFUL_VALIDATOR (UniqueTransactionHash, [](const auto &notification, const ValidatorContext &context) { const auto &hashCache=context.Cache.sub< cache::HashCache >();return hashCache.contains(state::TimestampedHash(notification.Deadline, notification.TransactionHash)) ? Failure_Hash_Exists :ValidationResult::Success;})
 
 DECLARE_STATEFUL_VALIDATOR (UniqueTransactionHash, model::TransactionNotification)()
 
 DEFINE_SIGNATURE_RESULT (Not_Verifiable, 1)
 Validation failed because the verification of the signature failed. More...
 
 DECLARE_STATELESS_VALIDATOR (Signature, Notification)(const GenerationHash &generationHash)
 
 DECLARE_STATELESS_VALIDATOR (Signature, model::SignatureNotification)(const GenerationHash &generationHash)
 
 DEFINE_STATELESS_VALIDATOR (AccountLinkAction, [](const auto &notification) { return ValidateLessThanOrEqual(notification.LinkAction, model::AccountLinkAction::Unlink, Failure_AccountLink_Invalid_Action);})
 
 DEFINE_STATEFUL_VALIDATOR (AccountLinkAvailability, [](const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::AccountStateCache >();auto accountStateIter=cache.find(notification.MainAccountKey);const auto &accountState=accountStateIter.get();if(model::AccountLinkAction::Link==notification.LinkAction) { if(state::AccountType::Unlinked !=accountState.AccountType) return Failure_AccountLink_Link_Already_Exists;} else { if(state::AccountType::Main !=accountState.AccountType) return Failure_AccountLink_Link_Does_Not_Exist;if(notification.RemoteAccountKey !=accountState.LinkedAccountKey) return Failure_AccountLink_Unlink_Data_Inconsistency;} return ValidationResult::Success;})
 
 DEFINE_STATEFUL_VALIDATOR (NewRemoteAccountAvailability, [](const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::AccountStateCache >();auto remoteAccountStateIter=cache.find(notification.RemoteAccountKey);return !remoteAccountStateIter.tryGet()||state::AccountType::Remote_Unlinked==remoteAccountStateIter.get().AccountType ? ValidationResult::Success :Failure_AccountLink_Remote_Account_Ineligible;})
 
 DEFINE_STATEFUL_VALIDATOR (RemoteInteraction,([](const auto &notification, const auto &context) { if(model::AccountLinkTransaction::Entity_Type==notification.TransactionType) return ValidationResult::Success;const auto &cache=context.Cache.template sub< cache::AccountStateCache >();const auto &addresses=notification.ParticipantsByAddress;const auto &keys=notification.ParticipantsByKey;auto predicate=[&cache, &context](const auto &key) { return IsRemote(cache, GetResolvedKey(key, context.Resolvers));};return std::any_of(addresses.cbegin(), addresses.cend(), predicate)||std::any_of(keys.cbegin(), keys.cend(), predicate) ? Failure_AccountLink_Remote_Account_Participant_Not_Allowed :ValidationResult::Success;}))
 
 DEFINE_STATEFUL_VALIDATOR (RemoteSender, [](const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::AccountStateCache >();auto accountStateIter=cache.find(notification.Signer);return accountStateIter.tryGet() &&state::IsRemote(accountStateIter.get().AccountType) ? Failure_AccountLink_Remote_Account_Signer_Not_Allowed :ValidationResult::Success;})
 
 DEFINE_ACCOUNT_LINK_RESULT (Invalid_Action, 1)
 Validation failed because account link action is invalid. More...
 
 DEFINE_ACCOUNT_LINK_RESULT (Link_Already_Exists, 2)
 Validation failed because main account is already linked to another account. More...
 
 DEFINE_ACCOUNT_LINK_RESULT (Link_Does_Not_Exist, 3)
 Validation failed because main account is not linked to another account. More...
 
 DEFINE_ACCOUNT_LINK_RESULT (Unlink_Data_Inconsistency, 4)
 Validation failed because unlink data is not consistent with existing account link. More...
 
 DEFINE_ACCOUNT_LINK_RESULT (Remote_Account_Ineligible, 5)
 Validation failed because link is attempting to convert ineligible account to remote. More...
 
 DEFINE_ACCOUNT_LINK_RESULT (Remote_Account_Signer_Not_Allowed, 6)
 Validation failed because remote is not allowed to sign a transaction. More...
 
 DEFINE_ACCOUNT_LINK_RESULT (Remote_Account_Participant_Not_Allowed, 7)
 Validation failed because remote is not allowed to participate in the transaction. More...
 
 DECLARE_STATELESS_VALIDATOR (AccountLinkAction, model::RemoteAccountLinkNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (AccountLinkAvailability, model::RemoteAccountLinkNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (NewRemoteAccountAvailability, model::NewRemoteAccountNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (RemoteSender, model::TransactionNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (RemoteInteraction, model::AddressInteractionNotification)()
 
 DECLARE_STATELESS_VALIDATOR (BasicAggregateCosignatures, Notification)(uint32_t maxTransactions
 
 DEFINE_AGGREGATE_RESULT (Too_Many_Transactions, 1)
 Validation failed because aggregate has too many transactions. More...
 
 DEFINE_AGGREGATE_RESULT (No_Transactions, 2)
 Validation failed because aggregate does not have any transactions. More...
 
 DEFINE_AGGREGATE_RESULT (Too_Many_Cosignatures, 3)
 Validation failed because aggregate has too many cosignatures. More...
 
 DEFINE_AGGREGATE_RESULT (Redundant_Cosignatures, 4)
 Validation failed because redundant cosignatures are present. More...
 
 DEFINE_AGGREGATE_RESULT (Ineligible_Cosigners, 5)
 Validation failed because at least one cosigner is ineligible. More...
 
 DEFINE_AGGREGATE_RESULT (Missing_Cosigners, 6)
 Validation failed because at least one required cosigner is missing. More...
 
 DEFINE_STATELESS_VALIDATOR (StrictAggregateCosignatures, [](const auto &notification) { utils::ArrayPointerFlagMap< Key > cosigners;cosigners.emplace(&notification.Signer, false);const auto *pCosignature=notification.CosignaturesPtr;for(auto i=0u;i< notification.CosignaturesCount;++i) { cosigners.emplace(&pCosignature->Signer, false);++pCosignature;} auto hasMissingCosigners=false;const auto *pTransaction=notification.TransactionsPtr;for(auto i=0u;i< notification.TransactionsCount;++i) { auto iter=cosigners.find(&pTransaction->Signer);if(cosigners.cend()==iter) hasMissingCosigners=true;else iter->second=true;pTransaction=AdvanceNext(pTransaction);} return std::all_of(cosigners.cbegin(), cosigners.cend(), [](const auto &pair) { return pair.second;}) ? hasMissingCosigners ? Failure_Aggregate_Missing_Cosigners :ValidationResult::Success :Failure_Aggregate_Ineligible_Cosigners;})
 
 DECLARE_STATELESS_VALIDATOR (BasicAggregateCosignatures, model::AggregateCosignaturesNotification)(uint32_t maxTransactions
 
 DECLARE_STATELESS_VALIDATOR (StrictAggregateCosignatures, model::AggregateCosignaturesNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (HashLockMosaic, Notification)(MosaicId currencyMosaicId
 
 DEFINE_HASH_LOCK_RESULT (Invalid_Mosaic_Id, 1)
 Validation failed because lock does not allow the specified mosaic. More...
 
 DEFINE_HASH_LOCK_RESULT (Invalid_Mosaic_Amount, 2)
 Validation failed because lock does not allow the specified amount. More...
 
 DEFINE_HASH_LOCK_RESULT (Hash_Exists, 3)
 Validation failed because hash is already present in cache. More...
 
 DEFINE_HASH_LOCK_RESULT (Hash_Does_Not_Exist, 4)
 Validation failed because hash is not present in cache. More...
 
 DEFINE_HASH_LOCK_RESULT (Inactive_Hash, 5)
 Validation failed because hash is inactive. More...
 
 DEFINE_HASH_LOCK_RESULT (Invalid_Duration, 6)
 Validation failed because duration is too long. More...
 
 DECLARE_STATELESS_VALIDATOR (HashLockDuration, model::HashLockDurationNotification)(BlockDuration maxHashLockDuration)
 
 DECLARE_STATEFUL_VALIDATOR (HashLockMosaic, model::HashLockMosaicNotification)(MosaicId currencyMosaicId
 
 DECLARE_STATEFUL_VALIDATOR (HashLockCacheUnique, model::HashLockNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (AggregateHashPresent, model::TransactionNotification)()
 
 DECLARE_STATELESS_VALIDATOR (ProofSecret, Notification)(uint16_t minProofSize
 
 DEFINE_SECRET_LOCK_RESULT (Invalid_Hash_Algorithm, 1)
 Validation failed because hash algorithm for lock type secret is invalid. More...
 
 DEFINE_SECRET_LOCK_RESULT (Hash_Exists, 2)
 Validation failed because hash is already present in cache. More...
 
 DEFINE_SECRET_LOCK_RESULT (Hash_Not_Implemented, 3)
 Validation failed because hash is not implemented yet. More...
 
 DEFINE_SECRET_LOCK_RESULT (Proof_Size_Out_Of_Bounds, 4)
 Validation failed because proof is too small or too large. More...
 
 DEFINE_SECRET_LOCK_RESULT (Secret_Mismatch, 5)
 Validation failed because secret does not match proof. More...
 
 DEFINE_SECRET_LOCK_RESULT (Unknown_Composite_Key, 6)
 Validation failed because composite key is unknown. More...
 
 DEFINE_SECRET_LOCK_RESULT (Inactive_Secret, 7)
 Validation failed because secret is inactive. More...
 
 DEFINE_SECRET_LOCK_RESULT (Hash_Algorithm_Mismatch, 8)
 Validation failed because hash algorithm does not match. More...
 
 DEFINE_SECRET_LOCK_RESULT (Invalid_Duration, 9)
 Validation failed because duration is too long. More...
 
 DEFINE_STATELESS_VALIDATOR (SecretLockHashAlgorithm, [](const auto &notification) { return ValidateLessThanOrEqual(notification.HashAlgorithm, model::LockHashAlgorithm::Op_Hash_256, Failure_LockSecret_Invalid_Hash_Algorithm);})
 
 DECLARE_STATELESS_VALIDATOR (SecretLockDuration, model::SecretLockDurationNotification)(BlockDuration maxSecretLockDuration)
 
 DECLARE_STATELESS_VALIDATOR (SecretLockHashAlgorithm, model::SecretLockHashAlgorithmNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (SecretLockCacheUnique, model::SecretLockNotification)()
 
 DECLARE_STATELESS_VALIDATOR (ProofSecret, model::ProofSecretNotification)(uint16_t minProofSize
 
 DECLARE_STATEFUL_VALIDATOR (Proof, model::ProofPublicationNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (MaxMosaicsBalanceTransfer, model::BalanceTransferNotification)(uint16_t maxMosaics)
 
 DECLARE_STATEFUL_VALIDATOR (MaxMosaicsSupplyChange, model::MosaicSupplyChangeNotification)(uint16_t maxMosaics)
 
 DEFINE_STATEFUL_VALIDATOR (MosaicAvailability, [](const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::MosaicCache >();auto mosaicIter=cache.find(notification.MosaicId);if(!mosaicIter.tryGet()) return ValidationResult::Success;if(!cache.isActive(notification.MosaicId, context.Height)) return Failure_Mosaic_Expired;const auto &entry=mosaicIter.get();auto requiredPropertyChanged=ContainsRequiredPropertyChange(notification.Properties);if(!requiredPropertyChanged &&entry.definition().isEternal()) return Failure_Mosaic_Modification_No_Changes;return Amount() !=entry.supply() ? Failure_Mosaic_Modification_Disallowed :ValidationResult::Success;})
 
 DECLARE_STATEFUL_VALIDATOR (MosaicDuration, Notification)(BlockDuration maxMosaicDuration)
 
 DECLARE_STATELESS_VALIDATOR (MosaicProperties, Notification)(uint8_t maxDivisibility
 
 DECLARE_STATEFUL_VALIDATOR (MosaicSupplyChangeAllowed, Notification)(Amount maxAtomicUnits)
 
 DEFINE_STATELESS_VALIDATOR (MosaicSupplyChange, [](const auto &notification) { if(!IsValidDirection(notification.Direction)) return Failure_Mosaic_Invalid_Supply_Change_Direction;return Amount()==notification.Delta ? Failure_Mosaic_Invalid_Supply_Change_Amount :ValidationResult::Success;})
 
 DECLARE_STATEFUL_VALIDATOR (MosaicTransfer, Notification)(UnresolvedMosaicId currencyMosaicId)
 
 DEFINE_STATEFUL_VALIDATOR (ProperMosaic, [](const auto &notification, const ValidatorContext &context) { auto view=ActiveMosaicView(context.Cache);auto mosaicId=notification.MosaicId;if(Notification::MosaicType::Unresolved==notification.ProvidedMosaicType) mosaicId=context.Resolvers.resolve(notification.UnresolvedMosaicId);ActiveMosaicView::FindIterator mosaicIter;return view.tryGet(mosaicId, context.Height, notification.Signer, mosaicIter);})
 
 DEFINE_MOSAIC_RESULT (Invalid_Duration, 1)
 Validation failed because the duration has an invalid value. More...
 
 DEFINE_MOSAIC_RESULT (Invalid_Name, 2)
 Validation failed because the name is invalid. More...
 
 DEFINE_MOSAIC_RESULT (Name_Id_Mismatch, 3)
 Validation failed because the name and id don't match. More...
 
 DEFINE_MOSAIC_RESULT (Expired, 4)
 Validation failed because the parent is expired. More...
 
 DEFINE_MOSAIC_RESULT (Owner_Conflict, 5)
 Validation failed because the parent owner conflicts with the child owner. More...
 
 DEFINE_MOSAIC_RESULT (Id_Mismatch, 6)
 Validation failed because the id is not the expected id generated from signer and nonce. More...
 
 DEFINE_MOSAIC_RESULT (Parent_Id_Conflict, 100)
 Validation failed because the existing parent id does not match the supplied parent id. More...
 
 DEFINE_MOSAIC_RESULT (Invalid_Property, 101)
 Validation failed because a mosaic property is invalid. More...
 
 DEFINE_MOSAIC_RESULT (Invalid_Flags, 102)
 Validation failed because the mosaic flags are invalid. More...
 
 DEFINE_MOSAIC_RESULT (Invalid_Divisibility, 103)
 Validation failed because the mosaic divisibility is invalid. More...
 
 DEFINE_MOSAIC_RESULT (Invalid_Supply_Change_Direction, 104)
 Validation failed because the mosaic supply change direction is invalid. More...
 
 DEFINE_MOSAIC_RESULT (Invalid_Supply_Change_Amount, 105)
 Validation failed because the mosaic supply change amount is invalid. More...
 
 DEFINE_MOSAIC_RESULT (Invalid_Id, 106)
 Validation failed because the mosaic id is invalid. More...
 
 DEFINE_MOSAIC_RESULT (Modification_Disallowed, 107)
 Validation failed because mosaic modification is not allowed. More...
 
 DEFINE_MOSAIC_RESULT (Modification_No_Changes, 108)
 Validation failed because mosaic modification would not result in any changes. More...
 
 DEFINE_MOSAIC_RESULT (Supply_Immutable, 109)
 Validation failed because the mosaic supply is immutable. More...
 
 DEFINE_MOSAIC_RESULT (Supply_Negative, 110)
 Validation failed because the resulting mosaic supply is negative. More...
 
 DEFINE_MOSAIC_RESULT (Supply_Exceeded, 111)
 Validation failed because the resulting mosaic supply exceeds the maximum allowed value. More...
 
 DEFINE_MOSAIC_RESULT (Non_Transferable, 112)
 Validation failed because the mosaic is not transferable. More...
 
 DEFINE_MOSAIC_RESULT (Max_Mosaics_Exceeded, 113)
 Validation failed because the credit of the mosaic would exceed the maximum of different mosaics an account is allowed to own. More...
 
 DECLARE_STATEFUL_VALIDATOR (ProperMosaic, model::MosaicRequiredNotification)()
 
 DECLARE_STATELESS_VALIDATOR (MosaicProperties, model::MosaicPropertiesNotification)(uint8_t maxDivisibility
 
 DECLARE_STATELESS_VALIDATOR (MosaicId, model::MosaicNonceNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (MosaicAvailability, model::MosaicDefinitionNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (MosaicDuration, model::MosaicDefinitionNotification)(BlockDuration maxMosaicDuration)
 
 DECLARE_STATELESS_VALIDATOR (MosaicSupplyChange, model::MosaicSupplyChangeNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (MosaicTransfer, model::BalanceTransferNotification)(UnresolvedMosaicId currencyMosaicId)
 
 DECLARE_STATEFUL_VALIDATOR (MosaicSupplyChangeAllowed, model::MosaicSupplyChangeNotification)(Amount maxAtomicUnits)
 
 DEFINE_STATELESS_VALIDATOR (ModifyMultisigCosigners, [](const auto &notification) { utils::KeyPointerSet addedAccounts;utils::KeyPointerSet removedAccounts;const auto *pModifications=notification.ModificationsPtr;for(auto i=0u;i< notification.ModificationsCount;++i) { if(!IsValidModificationType(pModifications[i].ModificationType)) return Failure_Multisig_Modify_Unsupported_Modification_Type;auto &accounts=model::CosignatoryModificationType::Add==pModifications[i].ModificationType ? addedAccounts :removedAccounts;const auto &oppositeAccounts=&accounts==&addedAccounts ? removedAccounts :addedAccounts;auto &key=pModifications[i].CosignatoryPublicKey;if(oppositeAccounts.end() !=oppositeAccounts.find(&key)) return Failure_Multisig_Modify_Account_In_Both_Sets;accounts.insert(&key);} if(1< removedAccounts.size()) return Failure_Multisig_Modify_Multiple_Deletes;if(notification.ModificationsCount !=addedAccounts.size()+removedAccounts.size()) return Failure_Multisig_Modify_Redundant_Modifications;return ValidationResult::Success;})
 
 DEFINE_STATEFUL_VALIDATOR (ModifyMultisigInvalidCosigners, [](const auto &notification, const ValidatorContext &context) { const auto &multisigCache=context.Cache.sub< cache::MultisigCache >();const auto *pModifications=notification.ModificationsPtr;if(!multisigCache.contains(notification.Signer)) { for(auto i=0u;i< notification.ModificationsCount;++i) { if(model::CosignatoryModificationType::Del==pModifications[i].ModificationType) return Failure_Multisig_Modify_Unknown_Multisig_Account;} return ValidationResult::Success;} auto multisigIter=multisigCache.find(notification.Signer);const auto &multisigEntry=multisigIter.get();for(auto i=0u;i< notification.ModificationsCount;++i) { auto isCosignatory=multisigEntry.hasCosignatory(pModifications[i].CosignatoryPublicKey);auto isEnablingCosignatory=model::CosignatoryModificationType::Add==pModifications[i].ModificationType;if(!isEnablingCosignatory &&!isCosignatory) return Failure_Multisig_Modify_Not_A_Cosigner;if(isEnablingCosignatory &&isCosignatory) return Failure_Multisig_Modify_Already_A_Cosigner;} return ValidationResult::Success;})
 
 DEFINE_STATEFUL_VALIDATOR (ModifyMultisigInvalidSettings, [](const auto &notification, const ValidatorContext &context) { const auto &multisigCache=context.Cache.sub< cache::MultisigCache >();if(!multisigCache.contains(notification.Signer)) { if(-1 !=notification.MinRemovalDelta||-1 !=notification.MinApprovalDelta) return Failure_Multisig_Modify_Min_Setting_Out_Of_Range;return ValidationResult::Success;} auto multisigIter=multisigCache.find(notification.Signer);const auto &multisigEntry=multisigIter.get();int newMinRemoval=multisigEntry.minRemoval()+notification.MinRemovalDelta;int newMinApproval=multisigEntry.minApproval()+notification.MinApprovalDelta;if(1 > newMinRemoval||1 > newMinApproval) return Failure_Multisig_Modify_Min_Setting_Out_Of_Range;int maxValue=static_cast< int >(multisigEntry.cosignatories().size());if(newMinRemoval > maxValue||newMinApproval > maxValue) return Failure_Multisig_Modify_Min_Setting_Larger_Than_Num_Cosignatories;return ValidationResult::Success;})
 
 DECLARE_STATEFUL_VALIDATOR (ModifyMultisigLoopAndLevel, Notification)(uint8_t maxMultisigDepth)
 
 DECLARE_STATEFUL_VALIDATOR (ModifyMultisigMaxCosignedAccounts, Notification)(uint8_t maxCosignedAccountsPerAccount)
 
 DECLARE_STATEFUL_VALIDATOR (ModifyMultisigMaxCosigners, Notification)(uint8_t maxCosignersPerAccount)
 
 DEFINE_STATEFUL_VALIDATOR (MultisigAggregateEligibleCosigners, [](const auto &notification, const ValidatorContext &context) { AggregateCosignaturesChecker checker(notification, context.Cache.sub< cache::MultisigCache >());return checker.hasIneligibleCosigners() ? Failure_Aggregate_Ineligible_Cosigners :ValidationResult::Success;})
 
 DEFINE_STATEFUL_VALIDATOR (MultisigAggregateSufficientCosigners, [](const auto &notification, const ValidatorContext &context) { AggregateCosignaturesChecker checker(notification, context.Cache.sub< cache::MultisigCache >());return checker.hasSufficientCosigners() ? ValidationResult::Success :Failure_Aggregate_Missing_Cosigners;})
 
 DEFINE_STATEFUL_VALIDATOR (MultisigPermittedOperation, [](const auto &notification, const ValidatorContext &context) { const auto &multisigCache=context.Cache.sub< cache::MultisigCache >();if(!multisigCache.contains(notification.Signer)) return ValidationResult::Success;auto multisigIter=multisigCache.find(notification.Signer);return multisigIter.get().cosignatories().empty() ? ValidationResult::Success :Failure_Multisig_Operation_Not_Permitted_By_Account;})
 
 DEFINE_MULTISIG_RESULT (Modify_Account_In_Both_Sets, 1)
 Validation failed because account is specified to be both added and removed. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Multiple_Deletes, 2)
 Validation failed because multiple removals are present. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Redundant_Modifications, 3)
 Validation failed because redundant modifications are present. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Unknown_Multisig_Account, 4)
 Validation failed because account is not in multisig cache. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Not_A_Cosigner, 5)
 Validation failed because account to be removed is not present. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Already_A_Cosigner, 6)
 Validation failed because account to be added is already a cosignatory. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Min_Setting_Out_Of_Range, 7)
 Validation failed because new minimum settings are out of range. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Min_Setting_Larger_Than_Num_Cosignatories, 8)
 Validation failed because min settings are larger than number of cosignatories. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Unsupported_Modification_Type, 9)
 Validation failed because the modification type is unsupported. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Max_Cosigned_Accounts, 10)
 Validation failed because the cosignatory already cosigns the maximum number of accounts. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Max_Cosigners, 11)
 Validation failed because the multisig account already has the maximum number of cosignatories. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Loop, 12)
 Validation failed because a multisig loop is created. More...
 
 DEFINE_MULTISIG_RESULT (Modify_Max_Multisig_Depth, 13)
 Validation failed because the max multisig depth is exceeded. More...
 
 DEFINE_MULTISIG_RESULT (Operation_Not_Permitted_By_Account, 14)
 Validation failed because an operation is not permitted by a multisig account. More...
 
stateless::NotificationValidatorPointerT< model::ModifyMultisigCosignersNotificationCreateModifyMultisigCosignersValidator ()
 
stateful::NotificationValidatorPointerT< model::TransactionNotificationCreateMultisigPermittedOperationValidator ()
 
stateful::NotificationValidatorPointerT< model::ModifyMultisigCosignersNotificationCreateModifyMultisigInvalidCosignersValidator ()
 
stateful::NotificationValidatorPointerT< model::ModifyMultisigNewCosignerNotificationCreateModifyMultisigMaxCosignedAccountsValidator (uint8_t maxCosignedAccountsPerAccount)
 
stateful::NotificationValidatorPointerT< model::ModifyMultisigCosignersNotificationCreateModifyMultisigMaxCosignersValidator (uint8_t maxCosignersPerAccount)
 
stateful::NotificationValidatorPointerT< model::ModifyMultisigNewCosignerNotificationCreateModifyMultisigLoopAndLevelValidator (uint8_t maxMultisigDepth)
 
stateful::NotificationValidatorPointerT< model::ModifyMultisigSettingsNotificationCreateModifyMultisigInvalidSettingsValidator ()
 
stateful::NotificationValidatorPointerT< model::AggregateCosignaturesNotificationCreateMultisigAggregateEligibleCosignersValidator ()
 
stateful::NotificationValidatorPointerT< model::AggregateEmbeddedTransactionNotificationCreateMultisigAggregateSufficientCosignersValidator ()
 
 DEFINE_STATELESS_VALIDATOR (AliasAction, [](const auto &notification) { return ValidateLessThanOrEqual(notification.AliasAction, model::AliasAction::Unlink, Failure_Namespace_Alias_Invalid_Action);})
 
 DEFINE_STATEFUL_VALIDATOR (AliasAvailability, [](const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::NamespaceCache >();auto namespaceIter=cache.find(notification.NamespaceId);if(!namespaceIter.tryGet()) return Failure_Namespace_Alias_Namespace_Unknown;const auto &root=namespaceIter.get().root();if(!root.lifetime().isActiveAndUnlocked(context.Height)) return Failure_Namespace_Expired;auto aliasType=root.alias(notification.NamespaceId).type();if(model::AliasAction::Link==notification.AliasAction &&state::AliasType::None !=aliasType) return Failure_Namespace_Alias_Already_Exists;else if(model::AliasAction::Unlink==notification.AliasAction &&state::AliasType::None==aliasType) return Failure_Namespace_Alias_Does_Not_Exist;return root.owner()==notification.Owner ? ValidationResult::Success :Failure_Namespace_Alias_Owner_Conflict;})
 
 DEFINE_STATEFUL_VALIDATOR (ChildNamespaceAvailability, [](const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::NamespaceCache >();auto height=context.Height;if(cache.contains(notification.NamespaceId)) return Failure_Namespace_Already_Exists;if(!cache.contains(notification.ParentId)) return Failure_Namespace_Parent_Unknown;auto namespaceIter=cache.find(notification.ParentId);const auto &parentEntry=namespaceIter.get();const auto &parentPath=parentEntry.ns().path();if(parentPath.size()==parentPath.capacity()) return Failure_Namespace_Too_Deep;const auto &root=parentEntry.root();if(!root.lifetime().isActiveAndUnlocked(height)) return Failure_Namespace_Expired;if(root.owner() !=notification.Signer) return Failure_Namespace_Owner_Conflict;return ValidationResult::Success;})
 
 DEFINE_STATEFUL_VALIDATOR (RootNamespaceAvailability, [](const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::NamespaceCache >();auto height=context.Height;if(Height(1) !=height &&Eternal_Artifact_Duration==notification.Duration) return Failure_Namespace_Eternal_After_Nemesis_Block;if(!cache.contains(notification.NamespaceId)) return ValidationResult::Success;auto namespaceIter=cache.find(notification.NamespaceId);const auto &root=namespaceIter.get().root();if(IsEternal(root.lifetime())||Eternal_Artifact_Duration==notification.Duration) return Failure_Namespace_Invalid_Duration;if(!root.lifetime().isActiveOrGracePeriod(height)) return ValidationResult::Success;return root.owner()==notification.Signer ? ValidationResult::Success :Failure_Namespace_Owner_Conflict;})
 
 DECLARE_STATEFUL_VALIDATOR (NamespaceDurationOverflow, Notification)(BlockDuration maxNamespaceDuration)
 
 DECLARE_STATELESS_VALIDATOR (NamespaceName, Notification)(uint8_t maxNameSize
 
 DEFINE_STATELESS_VALIDATOR (NamespaceType, [](const auto &notification) { return ValidateLessThanOrEqual(notification.NamespaceType, model::NamespaceType::Child, Failure_Namespace_Invalid_Namespace_Type);})
 
 DEFINE_NAMESPACE_RESULT (Invalid_Duration, 1)
 Validation failed because the duration has an invalid value. More...
 
 DEFINE_NAMESPACE_RESULT (Invalid_Name, 2)
 Validation failed because the name is invalid. More...
 
 DEFINE_NAMESPACE_RESULT (Name_Id_Mismatch, 3)
 Validation failed because the name and id don't match. More...
 
 DEFINE_NAMESPACE_RESULT (Expired, 4)
 Validation failed because the parent is expired. More...
 
 DEFINE_NAMESPACE_RESULT (Owner_Conflict, 5)
 Validation failed because the parent owner conflicts with the child owner. More...
 
 DEFINE_NAMESPACE_RESULT (Id_Mismatch, 6)
 Validation failed because the id is not the expected id generated from signer and nonce. More...
 
 DEFINE_NAMESPACE_RESULT (Invalid_Namespace_Type, 100)
 Validation failed because the namespace type is invalid. More...
 
 DEFINE_NAMESPACE_RESULT (Root_Name_Reserved, 101)
 Validation failed because the root namespace has a reserved name. More...
 
 DEFINE_NAMESPACE_RESULT (Too_Deep, 102)
 Validation failed because the resulting namespace would exceed the maximum allowed namespace depth. More...
 
 DEFINE_NAMESPACE_RESULT (Parent_Unknown, 103)
 Validation failed because the namespace parent is unknown. More...
 
 DEFINE_NAMESPACE_RESULT (Already_Exists, 104)
 Validation failed because the namespace already exists. More...
 
 DEFINE_NAMESPACE_RESULT (Already_Active, 105)
 Validation failed because the namespace is already active. More...
 
 DEFINE_NAMESPACE_RESULT (Eternal_After_Nemesis_Block, 106)
 Validation failed because an eternal namespace was received after the nemesis block. More...
 
 DEFINE_NAMESPACE_RESULT (Max_Children_Exceeded, 107)
 Validation failed because the maximum number of children for a root namespace was exceeded. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Invalid_Action, 108)
 Validation failed because alias action is invalid. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Namespace_Unknown, 109)
 Validation failed because namespace does not exist. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Already_Exists, 110)
 Validation failed because namespace is already linked to an alias. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Does_Not_Exist, 111)
 Validation failed because namespace is not linked to an alias. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Owner_Conflict, 112)
 Validation failed because namespace has different owner. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Unlink_Type_Inconsistency, 113)
 Validation failed because unlink type is not consistent with existing alias. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Unlink_Data_Inconsistency, 114)
 Validation failed because unlink data is not consistent with existing alias. More...
 
 DEFINE_NAMESPACE_RESULT (Alias_Invalid_Address, 115)
 Validation failed because aliased address is invalid. More...
 
 DECLARE_STATEFUL_VALIDATOR (RootNamespaceMaxChildren, Notification)(uint16_t maxChildren)
 
 DECLARE_STATELESS_VALIDATOR (RootNamespace, Notification)(BlockDuration maxDuration)
 
 DECLARE_STATELESS_VALIDATOR (NamespaceType, model::NamespaceNotification)()
 
 DECLARE_STATELESS_VALIDATOR (NamespaceName, model::NamespaceNameNotification)(uint8_t maxNameSize
 
 DECLARE_STATELESS_VALIDATOR (RootNamespace, model::RootNamespaceNotification)(BlockDuration maxDuration)
 
 DECLARE_STATEFUL_VALIDATOR (RootNamespaceAvailability, model::RootNamespaceNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (NamespaceDurationOverflow, model::RootNamespaceNotification)(BlockDuration maxNamespaceDuration)
 
 DECLARE_STATEFUL_VALIDATOR (ChildNamespaceAvailability, model::ChildNamespaceNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (RootNamespaceMaxChildren, model::ChildNamespaceNotification)(uint16_t maxChildren)
 
 DECLARE_STATELESS_VALIDATOR (AliasAction, model::AliasOwnerNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (AliasAvailability, model::AliasOwnerNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (UnlinkAliasedAddressConsistency, model::AliasedAddressNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (UnlinkAliasedMosaicIdConsistency, model::AliasedMosaicIdNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (AddressAlias, model::AliasedAddressNotification)()
 
 DECLARE_STATELESS_VALIDATOR (AccountAddressRestrictionNoSelfModification, Notification)(model
 
 DEFINE_STATELESS_VALIDATOR (AccountOperationRestrictionModificationValues, [](const auto &notification) { return AreAllAccountRestrictionValuesValid(notification.ModificationsPtr, notification.ModificationsCount) ? ValidationResult::Success :Failure_RestrictionAccount_Value_Invalid;})
 
 DEFINE_STATEFUL_VALIDATOR (AccountOperationRestrictionNoSelfBlocking, [](const auto &notification, const ValidatorContext &context) { return Validate(notification, context) ? ValidationResult::Success :Failure_RestrictionAccount_Modification_Not_Allowed;})
 
 DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_TYPE_VALIDATOR (AccountAddressRestrictionModificationTypes, model::ModifyAccountAddressRestrictionNotification, UnresolvedAddress) DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_TYPE_VALIDATOR(AccountMosaicRestrictionModificationTypes
 
 DEFINE_ACCOUNT_RESTRICTION_REDUNDANT_MODIFICATION_VALIDATOR (AccountAddressRestriction, UnresolvedAddress, utils::ArrayHasher< UnresolvedAddress >) DEFINE_ACCOUNT_RESTRICTION_REDUNDANT_MODIFICATION_VALIDATOR(AccountMosaicRestriction
 
 DEFINE_STATELESS_VALIDATOR (AccountRestrictionType, [](const auto &notification) { return IsValidAccountRestrictionType(notification.AccountRestrictionType) ? ValidationResult::Success :Failure_RestrictionAccount_Invalid_Restriction_Type;})
 
 DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_VALIDATOR (AccountAddressRestrictionValueModification, model::ModifyAccountAddressRestrictionValueNotification, Address) DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_VALIDATOR(AccountMosaicRestrictionValueModification
 
 DEFINE_STATEFUL_VALIDATOR (AddressInteraction, [](const auto &notification, const ValidatorContext &context) { auto networkIdentifier=context.Network.Identifier;auto sourceAddress=model::PublicKeyToAddress(notification.Source, networkIdentifier);for(const auto &address :notification.ParticipantsByAddress) { if(!IsInteractionAllowed(context.Cache, sourceAddress, context.Resolvers.resolve(address))) return Failure_RestrictionAccount_Signer_Address_Interaction_Not_Allowed;} for(const auto &key :notification.ParticipantsByKey) { auto address=model::PublicKeyToAddress(key, networkIdentifier);if(!IsInteractionAllowed(context.Cache, sourceAddress, address)) return Failure_RestrictionAccount_Signer_Address_Interaction_Not_Allowed;} return ValidationResult::Success;})
 
 DEFINE_ACCOUNT_RESTRICTION_MAX_VALUES_VALIDATOR (MaxAccountAddressRestrictionValues, model::ModifyAccountAddressRestrictionNotification, UnresolvedAddress) DEFINE_ACCOUNT_RESTRICTION_MAX_VALUES_VALIDATOR(MaxAccountMosaicRestrictionValues
 
 DEFINE_STATEFUL_VALIDATOR (MosaicRecipient, [](const auto &notification, const ValidatorContext &context) { AccountRestrictionView view(context.Cache);if(!view.initialize(context.Resolvers.resolve(notification.Recipient))) return ValidationResult::Success;auto mosaicId=context.Resolvers.resolve(notification.MosaicId);auto isTransferAllowed=view.isAllowed(model::AccountRestrictionType::MosaicId, mosaicId);return isTransferAllowed ? ValidationResult::Success :Failure_RestrictionAccount_Mosaic_Transfer_Not_Allowed;})
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Invalid_Restriction_Type, 1)
 Validation failed because the account restriction type is invalid. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Modification_Type_Invalid, 2)
 Validation failed because a modification type is invalid. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Modification_Address_Invalid, 3)
 Validation failed because a modification address is invalid. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Modification_Operation_Type_Incompatible, 4)
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Modify_Unsupported_Modification_Type, 5)
 Validation failed because the modification type is unsupported. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Modification_Redundant, 6)
 Validation failed because a modification is redundant. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Modification_Not_Allowed, 7)
 Validation failed because a value is not in the container. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Modification_Count_Exceeded, 8)
 Validation failed because the transaction has too many modifications. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Values_Count_Exceeded, 9)
 Validation failed because the resulting account restriction has too many values. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Value_Invalid, 10)
 Validation failed because the account restriction value is invalid. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Signer_Address_Interaction_Not_Allowed, 11)
 Validation failed because the signer is not allowed to interact with an address involved in the transaction. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Mosaic_Transfer_Not_Allowed, 12)
 Validation failed because the mosaic transfer is prohibited by the recipient. More...
 
 DEFINE_RESTRICTION_ACCOUNT_RESULT (Transaction_Type_Not_Allowed, 13)
 Validation failed because the transaction type is not allowed to be initiated by the signer. More...
 
 DEFINE_STATEFUL_VALIDATOR (Transaction, [](const auto &notification, const ValidatorContext &context) { AccountRestrictionView view(context.Cache);if(!view.initialize(model::PublicKeyToAddress(notification.Signer, context.Network.Identifier))) return ValidationResult::Success;auto isTransferAllowed=view.isAllowed(model::AccountRestrictionType::TransactionType, notification.TransactionType);return isTransferAllowed ? ValidationResult::Success :Failure_RestrictionAccount_Transaction_Type_Not_Allowed;})
 
 DECLARE_STATELESS_VALIDATOR (AccountRestrictionType, model::AccountRestrictionTypeNotification)()
 
DECLARE_STATELESS_VALIDATOR(AccountAddressRestrictionNoSelfModification, model::ModifyAccountAddressRestrictionValueNotification)(model DECLARE_STATEFUL_VALIDATOR (AddressInteraction, model::AddressInteractionNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (MosaicRecipient, model::BalanceTransferNotification)()
 
 DECLARE_STATELESS_VALIDATOR (AccountOperationRestrictionModificationValues, model::ModifyAccountOperationRestrictionNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (Transaction, model::TransactionNotification)()
 
 DECLARE_STATEFUL_VALIDATOR (AccountOperationRestrictionNoSelfBlocking, model::ModifyAccountOperationRestrictionValueNotification)()
 
 DEFINE_TRANSFER_RESULT (Message_Too_Large, 1)
 Validation failed because the message is too large. More...
 
 DEFINE_TRANSFER_RESULT (Out_Of_Order_Mosaics, 2)
 Validation failed because mosaics are out of order. More...
 
 DECLARE_STATELESS_VALIDATOR (TransferMessage, Notification)(uint16_t maxMessageSize)
 
 DEFINE_STATELESS_VALIDATOR (TransferMosaics, [](const auto &notification) { if(1 >=notification.MosaicsCount) return ValidationResult::Success;auto pMosaics=notification.MosaicsPtr;auto lastMosaicId=pMosaics[0].MosaicId;for(auto i=1u;i< notification.MosaicsCount;++i) { auto currentMosaicId=pMosaics[i].MosaicId;if(lastMosaicId >=currentMosaicId) return Failure_Transfer_Out_Of_Order_Mosaics;lastMosaicId=currentMosaicId;} return ValidationResult::Success;})
 
 DECLARE_STATELESS_VALIDATOR (TransferMessage, model::TransferMessageNotification)(uint16_t maxMessageSize)
 
 DECLARE_STATELESS_VALIDATOR (TransferMosaics, model::TransferMosaicsNotification)()
 
void AggregateValidationResult (std::atomic< ValidationResult > &aggregate, ValidationResult value)
 Aggregates result into aggregate. More...
 
void AggregateValidationResult (ValidationResult &aggregate, ValidationResult value)
 Aggregates result into aggregate. More...
 
std::shared_ptr< const ParallelValidationPolicyCreateParallelValidationPolicy (const std::shared_ptr< thread::IoThreadPool > &pPool)
 Creates a parallel validation policy using pPool for parallelization. More...
 
std::ostream & operator<< (std::ostream &out, ValidationResult result)
 Insertion operator for outputting result to out. More...
 
constexpr ValidationResult MakeValidationResult (ResultSeverity severity, FacilityCode facility, uint16_t code, ResultFlags flags)
 Makes a validation result given severity, facility, code and flags. More...
 
constexpr ResultSeverity GetSeverity (ValidationResult result)
 Extracts the encoded result severity from result. More...
 
constexpr bool IsSet (ValidationResult result, ResultFlags flags)
 Checks if result has all flags set. More...
 
constexpr bool IsValidationResultSuccess (ValidationResult result)
 Returns a value indicating whether the validation result is a success. More...
 
constexpr bool IsValidationResultFailure (ValidationResult result)
 Returns a value indicating whether the validation result is a failure. More...
 
constexpr utils::LogLevel MapToLogLevel (ValidationResult result)
 Maps validation result to an appropriate logging level. More...
 
template<typename TValue >
constexpr ValidationResult ValidateLessThanOrEqual (TValue value, TValue maxValue, ValidationResult failureResult)
 Validates that value is less than or equal to maxValue and returns failureResult on failure. More...
 

Variables

uint8_t maxCosignatures
 
Amount lockedFundsPerAggregate
 
uint16_t maxProofSize
 
BlockDuration maxMosaicDuration
 
const NameSetreservedRootNamespaceNames
 
for(const auto &name :reservedRootNamespaceNames) reservedRootIds.emplace(model return MAKE_STATELESS_VALIDATOR (NamespaceName,([maxNameSize, reservedRootIds](const auto &notification) { if(maxNameSize< notification.NameSize||!model::IsValidName(notification.NamePtr, notification.NameSize)) return Failure_Namespace_Invalid_Name;auto name=utils::RawString(reinterpret_cast< const char * >(notification.NamePtr), notification.NameSize);if(notification.NamespaceId !=model::GenerateNamespaceId(notification.ParentId, name)) return Failure_Namespace_Name_Id_Mismatch;auto namespaceId=Namespace_Base_Id==notification.ParentId ? notification.NamespaceId :notification.ParentId;if(reservedRootIds.cend() !=reservedRootIds.find(namespaceId)) return Failure_Namespace_Root_Name_Reserved;return ValidationResult::Success;}))
 
 UnresolvedMosaicId
 

Typedef Documentation

◆ BalanceDebitNotification

◆ BalanceTransferNotification

◆ CacheReadOnlyType

◆ NameSet

using catapult::validators::NameSet = typedef std::unordered_set<std::string>

◆ Notification

◆ ValidationFunction

A validation function.

◆ ValidationFunctions

A vector of validation functions.

◆ ValidationPolicyFunc

template<typename TResult >
using catapult::validators::ValidationPolicyFunc = typedef std::function<TResult (const model::WeakEntityInfos&, const ValidationFunctions&)>

Function signature for validation policies.

◆ ValidationResultPredicate

Validation result predicate.

◆ ValidatorVectorT

template<typename... TArgs>
using catapult::validators::ValidatorVectorT = typedef std::vector<std::unique_ptr<const EntityValidatorT<TArgs...> >>

A vector of validators.

Enumeration Type Documentation

◆ FacilityCode

enum catapult::validators::FacilityCode : uint8_t
strong

Possible validation facility codes.

Enumerator
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
COPY_FACILITY_CODE 
Chain 

Chain facility code.

Consumer 

Consumer facility code.

Extension 

Extension facility code.

Hash 

Hash facility code.

Signature 

Signature facility code.

◆ ResultFlags

enum catapult::validators::ResultFlags : uint8_t
strong

Possible result flags (only six bits are used).

Enumerator
None 

No special result flags are set.

Verbose 

Result is verbose and should be suppressed from most logs.

◆ ResultSeverity

enum catapult::validators::ResultSeverity : uint8_t
strong

Possible result severities (only two bits are used).

Enumerator
Success 

Validation result is success.

Neutral 

Validation result is neither success nor failure.

Failure 

Validation result is failure.

◆ ValidationResult

Enumeration of all possible validation results.

Enumerator
Success 

Validation succeeded.

Neutral 

Validation is neutral.

Failure 

Validation failed.

Function Documentation

◆ AggregateValidationResult() [1/2]

void catapult::validators::AggregateValidationResult ( std::atomic< ValidationResult > &  aggregate,
ValidationResult  value 
)

Aggregates result into aggregate.

Here is the caller graph for this function:

◆ AggregateValidationResult() [2/2]

void catapult::validators::AggregateValidationResult ( ValidationResult aggregate,
ValidationResult  value 
)

Aggregates result into aggregate.

◆ CreateModifyMultisigCosignersValidator()

stateless::NotificationValidatorPointerT<model::ModifyMultisigCosignersNotification> catapult::validators::CreateModifyMultisigCosignersValidator ( )

Validator that applies to modify multisig cosigners notifications and validates that:

  • same account does not occur in removed and added cosignatories
  • there is at most one cosignatory removed
Here is the caller graph for this function:

◆ CreateModifyMultisigInvalidCosignersValidator()

stateful::NotificationValidatorPointerT<model::ModifyMultisigCosignersNotification> catapult::validators::CreateModifyMultisigInvalidCosignersValidator ( )

Validator that applies to modify multisig cosigners notifications and validates that:

  • added account isn't already a cosignatory
  • removed account is already a cosignatory
Here is the caller graph for this function:

◆ CreateModifyMultisigInvalidSettingsValidator()

stateful::NotificationValidatorPointerT<model::ModifyMultisigSettingsNotification> catapult::validators::CreateModifyMultisigInvalidSettingsValidator ( )

Validator that applies to modify multisig settings notifications and validates that:

  • new min removal and min approval are greater than 0
  • new min removal and min approval settings are not greater than total number of cosignatories
Here is the caller graph for this function:

◆ CreateModifyMultisigLoopAndLevelValidator()

stateful::NotificationValidatorPointerT<model::ModifyMultisigNewCosignerNotification> catapult::validators::CreateModifyMultisigLoopAndLevelValidator ( uint8_t  maxMultisigDepth)

Validator that applies to modify multisig new cosigner notifications and validates that:

  • the multisig depth is at most maxMultisigDepth
  • no multisig loops are created
Here is the caller graph for this function:

◆ CreateModifyMultisigMaxCosignedAccountsValidator()

stateful::NotificationValidatorPointerT<model::ModifyMultisigNewCosignerNotification> catapult::validators::CreateModifyMultisigMaxCosignedAccountsValidator ( uint8_t  maxCosignedAccountsPerAccount)

Validator that applies to modify multisig new cosigner notifications and validates that:

  • the cosignatory is cosigning at most maxCosignedAccountsPerAccount
Here is the caller graph for this function:

◆ CreateModifyMultisigMaxCosignersValidator()

stateful::NotificationValidatorPointerT<model::ModifyMultisigCosignersNotification> catapult::validators::CreateModifyMultisigMaxCosignersValidator ( uint8_t  maxCosignersPerAccount)

Validator that applies to modify multisig cosigners notifications and validates that:

  • the multisig account has at most maxCosignersPerAccount cosignatories
Here is the caller graph for this function:

◆ CreateMultisigAggregateEligibleCosignersValidator()

stateful::NotificationValidatorPointerT<model::AggregateCosignaturesNotification> catapult::validators::CreateMultisigAggregateEligibleCosignersValidator ( )

Validator that applies to aggregate cosignatures notifications and validates that:

  • all cosigners are eligible counterparties
Here is the caller graph for this function:

◆ CreateMultisigAggregateSufficientCosignersValidator()

stateful::NotificationValidatorPointerT<model::AggregateEmbeddedTransactionNotification> catapult::validators::CreateMultisigAggregateSufficientCosignersValidator ( )

Validator that applies to aggregate embeded transaction notifications and validates that:

  • present cosigners are sufficient
Here is the caller graph for this function:

◆ CreateMultisigPermittedOperationValidator()

stateful::NotificationValidatorPointerT<model::TransactionNotification> catapult::validators::CreateMultisigPermittedOperationValidator ( )

Validator that applies to transaction notifications and validates that:

  • multisig accounts cannot initiate transactions
Here is the caller graph for this function:

◆ CreateParallelValidationPolicy()

std::shared_ptr< const ParallelValidationPolicy > catapult::validators::CreateParallelValidationPolicy ( const std::shared_ptr< thread::IoThreadPool > &  pPool)

Creates a parallel validation policy using pPool for parallelization.

◆ DECLARE_STATEFUL_VALIDATOR() [1/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( AccountLinkAvailability  ,
model::RemoteAccountLinkNotification   
)

Validator that applies to remote account link notifications and validates that:

  • link action is consistent with current state
  • only main account can unlink
  • unlink data matches current state

◆ DECLARE_STATEFUL_VALIDATOR() [2/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( AccountOperationRestrictionNoSelfBlocking  ,
model::ModifyAccountOperationRestrictionValueNotification   
)

Validator that applies to modify account transaction restriction notifications and validates that:

  • account operation restriction transactions are not blocked

◆ DECLARE_STATEFUL_VALIDATOR() [3/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( Address  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [4/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( AddressAlias  ,
model::AliasedAddressNotification   
)

Validator that applies to aliased address notifications and validates that:

  • account is known

◆ DECLARE_STATEFUL_VALIDATOR() [5/44]

DECLARE_STATELESS_VALIDATOR (AccountAddressRestrictionNoSelfModification, model::ModifyAccountAddressRestrictionValueNotification)( model catapult::validators::DECLARE_STATEFUL_VALIDATOR ( AddressInteraction  ,
model::AddressInteractionNotification   
)

Validator that applies to modify account address restriction value notifications and validates that:

  • modification value for network with id networkIdentifier is valid Validator that applies to address interaction notifications and validates that:
  • the source address is allowed to interact with all participant addresses

◆ DECLARE_STATEFUL_VALIDATOR() [6/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( AggregateHashPresent  ,
model::TransactionNotification   
)

Validator that applies to transaction notifications and validates that:

  • incomplete aggregate transactions must have an active, unused hash lock info present in cache

◆ DECLARE_STATEFUL_VALIDATOR() [7/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( AliasAvailability  ,
model::AliasOwnerNotification   
)

Validator that applies to alias owner notifications and validates that:

  • namespace exists
  • link does not overwrite existing link
  • unlinked alias exists
  • owner of namespace matches alias owner

◆ DECLARE_STATEFUL_VALIDATOR() [8/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( BalanceDebit  ,
model::BalanceDebitNotification   
)

Validator that applies to all balance debit notifications and validates that:

  • the sending account has enough funds

◆ DECLARE_STATEFUL_VALIDATOR() [9/44]

DECLARE_STATEFUL_VALIDATOR (Deadline, model::TransactionDeadlineNotification)( const utils catapult::validators::DECLARE_STATEFUL_VALIDATOR ( BalanceTransfer  ,
model::BalanceTransferNotification   
)

Validator that applies to all transaction notifications and validates that:

  • the transaction deadline is no later than the block timestamp
  • the transaction deadline is no more than maxTransactionLifetime past the block timestamp Validator that applies to all balance transfer notifications and validates that:
  • the sending account has enough funds

◆ DECLARE_STATEFUL_VALIDATOR() [10/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( ChildNamespaceAvailability  ,
model::ChildNamespaceNotification   
)

Validator that applies to child namespace notifications and validates that:

  • namespace is available and can be created

◆ DECLARE_STATEFUL_VALIDATOR() [11/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( Deadline  ,
Notification   
) const

◆ DECLARE_STATEFUL_VALIDATOR() [12/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( EligibleHarvester  ,
model::BlockNotification   
)

Validator that applies to all block notifications and validates that:

  • the block signer was eligible to create the block

◆ DECLARE_STATEFUL_VALIDATOR() [13/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( HashLockCacheUnique  ,
model::HashLockNotification   
)

Validator that applies to hash lock notifications and validates that:

  • attached hash is not present in hash lock info cache

◆ DECLARE_STATEFUL_VALIDATOR() [14/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( HashLockMosaic  ,
model::HashLockMosaicNotification   
)

Validator that applies to hash lock mosaic notifications and validates that:

  • mosaic id is currencyMosaicId
  • mosaic amount is equal to lockedFundsPerAggregate

◆ DECLARE_STATEFUL_VALIDATOR() [15/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( HashLockMosaic  ,
Notification   
)

◆ DECLARE_STATEFUL_VALIDATOR() [16/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MaxMosaicsBalanceTransfer  ,
model::BalanceTransferNotification   
)

Validator that applies to all balance transfer notifications and validates that:

  • the recipient does not exceed the maximum number of mosaics (maxMosaics) an account is allowed to own

◆ DECLARE_STATEFUL_VALIDATOR() [17/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MaxMosaicsSupplyChange  ,
model::MosaicSupplyChangeNotification   
)

Validator that applies to mosaic supply change notifications and validates that:

  • the account changing the supply does not exceed the maximum number of mosaics (maxMosaics) an account is allowed to own

◆ DECLARE_STATEFUL_VALIDATOR() [18/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( ModifyMultisigLoopAndLevel  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [19/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( ModifyMultisigMaxCosignedAccounts  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [20/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( ModifyMultisigMaxCosigners  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [21/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicAvailability  ,
model::MosaicDefinitionNotification   
)

Validator that applies to mosaic definition notifications and validates that:

  • the mosaic is available and can be created or modified

◆ DECLARE_STATEFUL_VALIDATOR() [22/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicDuration  ,
model::MosaicDefinitionNotification   
)

Validator that applies to mosaic definition notifications and validates that:

  • the resulting mosaic duration is not larger than maxMosaicDuration and there was no overflow

◆ DECLARE_STATEFUL_VALIDATOR() [23/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicDuration  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [24/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicRecipient  ,
model::BalanceTransferNotification   
)

Validator that applies to balance transfer notifications and validates that:

  • the mosaic is allowed to be transferred to the recipient

◆ DECLARE_STATEFUL_VALIDATOR() [25/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicSupplyChangeAllowed  ,
model::MosaicSupplyChangeNotification   
)

Validator that applies to mosaic supply change notifications and validates that:

  • the affected mosaic has mutable supply
  • decrease does not cause owner amount to become negative
  • increase does not cause total atomic units to exceed maxAtomicUnits
    Note
    This validator is dependent on MosaicChangeAllowedValidator.

◆ DECLARE_STATEFUL_VALIDATOR() [26/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicSupplyChangeAllowed  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [27/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicTransfer  ,
model::BalanceTransferNotification   
)

Validator that applies to all balance transfer notifications and validates that:

  • transferred mosaic is active and is transferable
  • as an optimization, special currency mosaic (currencyMosaicId) transfers are always allowed

◆ DECLARE_STATEFUL_VALIDATOR() [28/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( MosaicTransfer  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [29/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( NamespaceDurationOverflow  ,
model::RootNamespaceNotification   
)

Validator that applies to root namespace notifications and validates that:

  • namespace duration is acceptable given maxNamespaceDuration

◆ DECLARE_STATEFUL_VALIDATOR() [30/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( NamespaceDurationOverflow  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [31/44]

DECLARE_STATEFUL_VALIDATOR (Address, model::AccountAddressNotification)(model catapult::validators::DECLARE_STATEFUL_VALIDATOR ( NemesisSink  ,
model::SignatureNotification   
)

Validator that applies to all account address notifications and validates that:

  • the address is valid and targets the expected network (networkIdentifier) Validator that applies to all signature notifications and validates that:
  • nemesis account signatures are not allowed after the nemesis block

◆ DECLARE_STATEFUL_VALIDATOR() [32/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( NewRemoteAccountAvailability  ,
model::NewRemoteAccountNotification   
)

Validator that applies to new remote account notifications and validates that:

  • remote account does not exist

◆ DECLARE_STATEFUL_VALIDATOR() [33/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( Proof  ,
model::ProofPublicationNotification   
)

Validator that applies to proof notifications and validates that:

  • secret obtained from proof is present in cache

◆ DECLARE_STATEFUL_VALIDATOR() [34/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( ProperMosaic  ,
model::MosaicRequiredNotification   
)

Validator that applies to mosaic required notifications and validates that:

  • mosaic exists and is active
  • mosaic owner matches requesting signer

◆ DECLARE_STATEFUL_VALIDATOR() [35/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( RemoteInteraction  ,
model::AddressInteractionNotification   
)

Validator that applies to address interaction notifications and validates that:

  • remote account is allowed to participate in the interaction

◆ DECLARE_STATEFUL_VALIDATOR() [36/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( RemoteSender  ,
model::TransactionNotification   
)

Validator that applies to transaction notifications and validates that:

  • remote account is not the transaction signer

◆ DECLARE_STATEFUL_VALIDATOR() [37/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( RootNamespaceAvailability  ,
model::RootNamespaceNotification   
)

Validator that applies to root namespace notifications and validates that:

  • namespace is available and can be created or renewed

◆ DECLARE_STATEFUL_VALIDATOR() [38/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( RootNamespaceMaxChildren  ,
model::ChildNamespaceNotification   
)

Validator that applies to child namespace notifications and validates that:

  • maximum number of children (maxChildren) for a root namespace is not exceeded

◆ DECLARE_STATEFUL_VALIDATOR() [39/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( RootNamespaceMaxChildren  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATEFUL_VALIDATOR() [40/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( SecretLockCacheUnique  ,
model::SecretLockNotification   
)

Validator that applies to secret lock notifications and validates that:

  • attached hash is not present in secret lock info cache

◆ DECLARE_STATEFUL_VALIDATOR() [41/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( Transaction  ,
model::TransactionNotification   
)

Validator that applies to transaction notifications and validates that:

  • the signer is allowed to initiate a transaction of the specified transaction type

◆ DECLARE_STATEFUL_VALIDATOR() [42/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( UniqueTransactionHash  ,
model::TransactionNotification   
)

Validator that applies to all transaction notifications and validates that:

  • the entity hash is unique and has not been previously seen

◆ DECLARE_STATEFUL_VALIDATOR() [43/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( UnlinkAliasedAddressConsistency  ,
model::AliasedAddressNotification   
)

Validator that applies to aliased address notifications and validates that:

  • unlink operation matches existing link

◆ DECLARE_STATEFUL_VALIDATOR() [44/44]

catapult::validators::DECLARE_STATEFUL_VALIDATOR ( UnlinkAliasedMosaicIdConsistency  ,
model::AliasedMosaicIdNotification   
)

Validator that applies to aliased mosaic id notifications and validates that:

  • unlink operation matches existing link

◆ DECLARE_STATELESS_VALIDATOR() [1/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( AccountAddressRestrictionNoSelfModification  ,
Notification   
)
Here is the call graph for this function:

◆ DECLARE_STATELESS_VALIDATOR() [2/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( AccountLinkAction  ,
model::RemoteAccountLinkNotification   
)

Validator that applies to remote account link notifications and validates that:

  • account link action is valid

◆ DECLARE_STATELESS_VALIDATOR() [3/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( AccountOperationRestrictionModificationValues  ,
model::ModifyAccountOperationRestrictionNotification   
)

Validator that applies to modify account transaction restriction notifications and validates that:

  • all transaction modification values are valid

◆ DECLARE_STATELESS_VALIDATOR() [4/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( AccountRestrictionType  ,
model::AccountRestrictionTypeNotification   
)

Validator that applies to account restriction type notifications and validates that:

  • restriction type is known

◆ DECLARE_STATELESS_VALIDATOR() [5/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( AliasAction  ,
model::AliasOwnerNotification   
)

Validator that applies to alias owner notifications and validates that:

  • alias action is valid

◆ DECLARE_STATELESS_VALIDATOR() [6/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( BasicAggregateCosignatures  ,
model::AggregateCosignaturesNotification   
)

Validator that applies to aggregate cosignatures notifications and validates that:

  • the number of transactions does not exceed maxTransactions
  • the number of implicit and explicit cosignatures does not exceed maxCosignatures
  • there are no redundant cosigners

◆ DECLARE_STATELESS_VALIDATOR() [7/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( BasicAggregateCosignatures  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [8/32]

DECLARE_STATELESS_VALIDATOR (Network, model::EntityNotification)(model catapult::validators::DECLARE_STATELESS_VALIDATOR ( EntityVersion  ,
model::EntityNotification   
)

Validator that applies to all entity notifications and validates that:

  • the entity targets the expected network (networkIdentifier) Validator that applies to entity notifications and validates that:
  • the entity version is within supported range.

◆ DECLARE_STATELESS_VALIDATOR() [9/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( HashLockDuration  ,
model::HashLockDurationNotification   
)

Validator that applies to hash lock notifications and validates that:

  • lock duration is at most maxHashLockDuration

◆ DECLARE_STATELESS_VALIDATOR() [10/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( MaxTransactions  ,
model::BlockNotification   
)

Validator that applies to all block notifications and validates that:

  • the block does not contain more than maxTransactions transactions

◆ DECLARE_STATELESS_VALIDATOR() [11/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( MaxTransactions  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [12/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( MosaicId  ,
model::MosaicNonceNotification   
)

Validator that applies to mosaic nonce notifications and validates that:

  • mosaic id is the expected id generated from signer and nonce

◆ DECLARE_STATELESS_VALIDATOR() [13/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( MosaicProperties  ,
model::MosaicPropertiesNotification   
)

Validator that applies to mosaic properties notifications and validates that:

  • definition has valid mosaic flags
  • definition has divisibility no greater than maxDivisibility
  • mosaic duration has a value not larger than maxMosaicDuration
  • optional mosaic properties are sorted, known and not duplicative

◆ DECLARE_STATELESS_VALIDATOR() [14/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( MosaicProperties  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [15/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( MosaicSupplyChange  ,
model::MosaicSupplyChangeNotification   
)

Validator that applies to mosaic supply change notifications and validates that:

  • direction has a valid value
  • delta amount is non-zero

◆ DECLARE_STATELESS_VALIDATOR() [16/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( NamespaceName  ,
model::NamespaceNameNotification   
)

Validator that applies to namespace name notifications and validates that:

  • namespace name has a maximum size of maxNameSize
  • namespace name consists only of allowed characters
  • for root namespaces, name is not in reservedRootNamespaceNames
  • for child namespaces, the parent id is not an id that can be generated from reservedRootNamespaceNames

◆ DECLARE_STATELESS_VALIDATOR() [17/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( NamespaceName  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [18/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( NamespaceType  ,
model::NamespaceNotification   
)

Validator that applies to namespace notifications and validates that:

  • namespace type is valid

◆ DECLARE_STATELESS_VALIDATOR() [19/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( Network  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [20/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( ProofSecret  ,
model::ProofSecretNotification   
)

Validator that applies to proof notifications and validates that:

  • hash algorithm is supported
  • proof size is within inclusive bounds of minProofSize and maxProofSize
  • hash of proof matches secret

◆ DECLARE_STATELESS_VALIDATOR() [21/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( ProofSecret  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [22/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( RootNamespace  ,
model::RootNamespaceNotification   
)

Validator that applies to root namespace notifications and validates that:

  • namespace duration is less than or equal to maxDuration for root namespace
  • namespace duration is zero for child namespace

◆ DECLARE_STATELESS_VALIDATOR() [23/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( RootNamespace  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [24/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( SecretLockDuration  ,
model::SecretLockDurationNotification   
)

Validator that applies to secret lock notifications and validates that:

  • lock duration is at most maxSecretLockDuration

◆ DECLARE_STATELESS_VALIDATOR() [25/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( SecretLockHashAlgorithm  ,
model::SecretLockHashAlgorithmNotification   
)

Validator that applies to secret lock hash algorithm notifications and validates that:

  • hash algorithm is valid

◆ DECLARE_STATELESS_VALIDATOR() [26/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( Signature  ,
model::SignatureNotification   
) const &

Validator that applies to all signature notifications and validates that:

  • signatures are valid given generationHash

◆ DECLARE_STATELESS_VALIDATOR() [27/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( Signature  ,
Notification   
) const &
Here is the call graph for this function:

◆ DECLARE_STATELESS_VALIDATOR() [28/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( StrictAggregateCosignatures  ,
model::AggregateCosignaturesNotification   
)

Validator that applies to aggregate cosignatures notifications and validates that:

  • the set of component signers is equal to the set of cosigners

◆ DECLARE_STATELESS_VALIDATOR() [29/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( TransactionFee  ,
model::TransactionFeeNotification   
)

Validator that applies to all transaction fee notifications and validates that:

  • fee is no greater than max fee
  • max fee multiplier does not overflow 32-bit value

◆ DECLARE_STATELESS_VALIDATOR() [30/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( TransferMessage  ,
model::TransferMessageNotification   
)

Validator that applies to transfer message notifications and validates that:

  • messages have a maximum message size of maxMessageSize

◆ DECLARE_STATELESS_VALIDATOR() [31/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( TransferMessage  ,
Notification   
)

◆ DECLARE_STATELESS_VALIDATOR() [32/32]

catapult::validators::DECLARE_STATELESS_VALIDATOR ( TransferMosaics  ,
model::TransferMosaicsNotification   
)

Validator that applies to transfer mosaics notifications and validates that:

  • mosaics are ordered

◆ DEFINE_ACCOUNT_LINK_RESULT() [1/7]

catapult::validators::DEFINE_ACCOUNT_LINK_RESULT ( Invalid_Action  ,
 
)

Validation failed because account link action is invalid.

◆ DEFINE_ACCOUNT_LINK_RESULT() [2/7]

catapult::validators::DEFINE_ACCOUNT_LINK_RESULT ( Link_Already_Exists  ,
 
)

Validation failed because main account is already linked to another account.

◆ DEFINE_ACCOUNT_LINK_RESULT() [3/7]

catapult::validators::DEFINE_ACCOUNT_LINK_RESULT ( Link_Does_Not_Exist  ,
 
)

Validation failed because main account is not linked to another account.

◆ DEFINE_ACCOUNT_LINK_RESULT() [4/7]

catapult::validators::DEFINE_ACCOUNT_LINK_RESULT ( Remote_Account_Ineligible  ,
 
)

Validation failed because link is attempting to convert ineligible account to remote.

◆ DEFINE_ACCOUNT_LINK_RESULT() [5/7]

catapult::validators::DEFINE_ACCOUNT_LINK_RESULT ( Remote_Account_Participant_Not_Allowed  ,
 
)

Validation failed because remote is not allowed to participate in the transaction.

◆ DEFINE_ACCOUNT_LINK_RESULT() [6/7]

catapult::validators::DEFINE_ACCOUNT_LINK_RESULT ( Remote_Account_Signer_Not_Allowed  ,
 
)

Validation failed because remote is not allowed to sign a transaction.

◆ DEFINE_ACCOUNT_LINK_RESULT() [7/7]

catapult::validators::DEFINE_ACCOUNT_LINK_RESULT ( Unlink_Data_Inconsistency  ,
 
)

Validation failed because unlink data is not consistent with existing account link.

◆ DEFINE_ACCOUNT_RESTRICTION_MAX_VALUES_VALIDATOR()

catapult::validators::DEFINE_ACCOUNT_RESTRICTION_MAX_VALUES_VALIDATOR ( MaxAccountAddressRestrictionValues  ,
model::ModifyAccountAddressRestrictionNotification  ,
UnresolvedAddress   
)

◆ DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_TYPE_VALIDATOR()

catapult::validators::DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_TYPE_VALIDATOR ( AccountAddressRestrictionModificationTypes  ,
model::ModifyAccountAddressRestrictionNotification  ,
UnresolvedAddress   
)

◆ DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_VALIDATOR()

catapult::validators::DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_VALIDATOR ( AccountAddressRestrictionValueModification  ,
model::ModifyAccountAddressRestrictionValueNotification  ,
Address   
)

◆ DEFINE_ACCOUNT_RESTRICTION_REDUNDANT_MODIFICATION_VALIDATOR()

catapult::validators::DEFINE_ACCOUNT_RESTRICTION_REDUNDANT_MODIFICATION_VALIDATOR ( AccountAddressRestriction  ,
UnresolvedAddress  ,
utils::ArrayHasher< UnresolvedAddress  
)

◆ DEFINE_AGGREGATE_RESULT() [1/6]

catapult::validators::DEFINE_AGGREGATE_RESULT ( Ineligible_Cosigners  ,
 
)

Validation failed because at least one cosigner is ineligible.

◆ DEFINE_AGGREGATE_RESULT() [2/6]

catapult::validators::DEFINE_AGGREGATE_RESULT ( Missing_Cosigners  ,
 
)

Validation failed because at least one required cosigner is missing.

◆ DEFINE_AGGREGATE_RESULT() [3/6]

catapult::validators::DEFINE_AGGREGATE_RESULT ( No_Transactions  ,
 
)

Validation failed because aggregate does not have any transactions.

◆ DEFINE_AGGREGATE_RESULT() [4/6]

catapult::validators::DEFINE_AGGREGATE_RESULT ( Redundant_Cosignatures  ,
 
)

Validation failed because redundant cosignatures are present.

◆ DEFINE_AGGREGATE_RESULT() [5/6]

catapult::validators::DEFINE_AGGREGATE_RESULT ( Too_Many_Cosignatures  ,
 
)

Validation failed because aggregate has too many cosignatures.

◆ DEFINE_AGGREGATE_RESULT() [6/6]

catapult::validators::DEFINE_AGGREGATE_RESULT ( Too_Many_Transactions  ,
 
)

Validation failed because aggregate has too many transactions.

◆ DEFINE_CORE_RESULT() [1/10]

catapult::validators::DEFINE_CORE_RESULT ( Block_Harvester_Ineligible  ,
10   
)

Validation failed because a block was harvested by an ineligible harvester.

◆ DEFINE_CORE_RESULT() [2/10]

catapult::validators::DEFINE_CORE_RESULT ( Future_Deadline  ,
 
)

Validation failed because the deadline is too far in the future.

◆ DEFINE_CORE_RESULT() [3/10]

catapult::validators::DEFINE_CORE_RESULT ( Insufficient_Balance  ,
 
)

Validation failed because the account has an insufficient balance.

◆ DEFINE_CORE_RESULT() [4/10]

catapult::validators::DEFINE_CORE_RESULT ( Invalid_Address  ,
 
)

Validation failed because an address is invalid.

◆ DEFINE_CORE_RESULT() [5/10]

catapult::validators::DEFINE_CORE_RESULT ( Invalid_Transaction_Fee  ,
 
)

Validation failed because a transaction fee is invalid.

◆ DEFINE_CORE_RESULT() [6/10]

catapult::validators::DEFINE_CORE_RESULT ( Invalid_Version  ,
 
)

Validation failed because entity version is invalid.

◆ DEFINE_CORE_RESULT() [7/10]

catapult::validators::DEFINE_CORE_RESULT ( Nemesis_Account_Signed_After_Nemesis_Block  ,
 
)

Validation failed because an entity originated from the nemesis account after the nemesis block.

◆ DEFINE_CORE_RESULT() [8/10]

catapult::validators::DEFINE_CORE_RESULT ( Past_Deadline  ,
 
)

Validation failed because the deadline passed.

◆ DEFINE_CORE_RESULT() [9/10]

catapult::validators::DEFINE_CORE_RESULT ( Too_Many_Transactions  ,
 
)

Validation failed because there are too many transactions in a block.

◆ DEFINE_CORE_RESULT() [10/10]

catapult::validators::DEFINE_CORE_RESULT ( Wrong_Network  ,
 
)

Validation failed because the entity has the wrong network specified.

◆ DEFINE_HASH_LOCK_RESULT() [1/6]

catapult::validators::DEFINE_HASH_LOCK_RESULT ( Hash_Does_Not_Exist  ,
 
)

Validation failed because hash is not present in cache.

◆ DEFINE_HASH_LOCK_RESULT() [2/6]

catapult::validators::DEFINE_HASH_LOCK_RESULT ( Hash_Exists  ,
 
)

Validation failed because hash is already present in cache.

◆ DEFINE_HASH_LOCK_RESULT() [3/6]

catapult::validators::DEFINE_HASH_LOCK_RESULT ( Inactive_Hash  ,
 
)

Validation failed because hash is inactive.

◆ DEFINE_HASH_LOCK_RESULT() [4/6]

catapult::validators::DEFINE_HASH_LOCK_RESULT ( Invalid_Duration  ,
 
)

Validation failed because duration is too long.

◆ DEFINE_HASH_LOCK_RESULT() [5/6]

catapult::validators::DEFINE_HASH_LOCK_RESULT ( Invalid_Mosaic_Amount  ,
 
)

Validation failed because lock does not allow the specified amount.

◆ DEFINE_HASH_LOCK_RESULT() [6/6]

catapult::validators::DEFINE_HASH_LOCK_RESULT ( Invalid_Mosaic_Id  ,
 
)

Validation failed because lock does not allow the specified mosaic.

◆ DEFINE_MOSAIC_RESULT() [1/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Expired  ,
 
)

Validation failed because the parent is expired.

◆ DEFINE_MOSAIC_RESULT() [2/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Id_Mismatch  ,
 
)

Validation failed because the id is not the expected id generated from signer and nonce.

◆ DEFINE_MOSAIC_RESULT() [3/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Divisibility  ,
103   
)

Validation failed because the mosaic divisibility is invalid.

◆ DEFINE_MOSAIC_RESULT() [4/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Duration  ,
 
)

Validation failed because the duration has an invalid value.

◆ DEFINE_MOSAIC_RESULT() [5/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Flags  ,
102   
)

Validation failed because the mosaic flags are invalid.

◆ DEFINE_MOSAIC_RESULT() [6/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Id  ,
106   
)

Validation failed because the mosaic id is invalid.

◆ DEFINE_MOSAIC_RESULT() [7/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Name  ,
 
)

Validation failed because the name is invalid.

◆ DEFINE_MOSAIC_RESULT() [8/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Property  ,
101   
)

Validation failed because a mosaic property is invalid.

◆ DEFINE_MOSAIC_RESULT() [9/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Supply_Change_Amount  ,
105   
)

Validation failed because the mosaic supply change amount is invalid.

◆ DEFINE_MOSAIC_RESULT() [10/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Invalid_Supply_Change_Direction  ,
104   
)

Validation failed because the mosaic supply change direction is invalid.

◆ DEFINE_MOSAIC_RESULT() [11/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Max_Mosaics_Exceeded  ,
113   
)

Validation failed because the credit of the mosaic would exceed the maximum of different mosaics an account is allowed to own.

◆ DEFINE_MOSAIC_RESULT() [12/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Modification_Disallowed  ,
107   
)

Validation failed because mosaic modification is not allowed.

◆ DEFINE_MOSAIC_RESULT() [13/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Modification_No_Changes  ,
108   
)

Validation failed because mosaic modification would not result in any changes.

◆ DEFINE_MOSAIC_RESULT() [14/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Name_Id_Mismatch  ,
 
)

Validation failed because the name and id don't match.

◆ DEFINE_MOSAIC_RESULT() [15/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Non_Transferable  ,
112   
)

Validation failed because the mosaic is not transferable.

◆ DEFINE_MOSAIC_RESULT() [16/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Owner_Conflict  ,
 
)

Validation failed because the parent owner conflicts with the child owner.

◆ DEFINE_MOSAIC_RESULT() [17/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Parent_Id_Conflict  ,
100   
)

Validation failed because the existing parent id does not match the supplied parent id.

◆ DEFINE_MOSAIC_RESULT() [18/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Supply_Exceeded  ,
111   
)

Validation failed because the resulting mosaic supply exceeds the maximum allowed value.

◆ DEFINE_MOSAIC_RESULT() [19/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Supply_Immutable  ,
109   
)

Validation failed because the mosaic supply is immutable.

◆ DEFINE_MOSAIC_RESULT() [20/20]

catapult::validators::DEFINE_MOSAIC_RESULT ( Supply_Negative  ,
110   
)

Validation failed because the resulting mosaic supply is negative.

◆ DEFINE_MULTISIG_RESULT() [1/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Account_In_Both_Sets  ,
 
)

Validation failed because account is specified to be both added and removed.

◆ DEFINE_MULTISIG_RESULT() [2/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Already_A_Cosigner  ,
 
)

Validation failed because account to be added is already a cosignatory.

◆ DEFINE_MULTISIG_RESULT() [3/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Loop  ,
12   
)

Validation failed because a multisig loop is created.

◆ DEFINE_MULTISIG_RESULT() [4/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Max_Cosigned_Accounts  ,
10   
)

Validation failed because the cosignatory already cosigns the maximum number of accounts.

◆ DEFINE_MULTISIG_RESULT() [5/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Max_Cosigners  ,
11   
)

Validation failed because the multisig account already has the maximum number of cosignatories.

◆ DEFINE_MULTISIG_RESULT() [6/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Max_Multisig_Depth  ,
13   
)

Validation failed because the max multisig depth is exceeded.

◆ DEFINE_MULTISIG_RESULT() [7/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Min_Setting_Larger_Than_Num_Cosignatories  ,
 
)

Validation failed because min settings are larger than number of cosignatories.

◆ DEFINE_MULTISIG_RESULT() [8/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Min_Setting_Out_Of_Range  ,
 
)

Validation failed because new minimum settings are out of range.

◆ DEFINE_MULTISIG_RESULT() [9/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Multiple_Deletes  ,
 
)

Validation failed because multiple removals are present.

◆ DEFINE_MULTISIG_RESULT() [10/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Not_A_Cosigner  ,
 
)

Validation failed because account to be removed is not present.

◆ DEFINE_MULTISIG_RESULT() [11/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Redundant_Modifications  ,
 
)

Validation failed because redundant modifications are present.

◆ DEFINE_MULTISIG_RESULT() [12/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Unknown_Multisig_Account  ,
 
)

Validation failed because account is not in multisig cache.

◆ DEFINE_MULTISIG_RESULT() [13/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Modify_Unsupported_Modification_Type  ,
 
)

Validation failed because the modification type is unsupported.

◆ DEFINE_MULTISIG_RESULT() [14/14]

catapult::validators::DEFINE_MULTISIG_RESULT ( Operation_Not_Permitted_By_Account  ,
14   
)

Validation failed because an operation is not permitted by a multisig account.

◆ DEFINE_NAMESPACE_RESULT() [1/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Already_Exists  ,
110   
)

Validation failed because namespace is already linked to an alias.

◆ DEFINE_NAMESPACE_RESULT() [2/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Does_Not_Exist  ,
111   
)

Validation failed because namespace is not linked to an alias.

◆ DEFINE_NAMESPACE_RESULT() [3/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Invalid_Action  ,
108   
)

Validation failed because alias action is invalid.

◆ DEFINE_NAMESPACE_RESULT() [4/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Invalid_Address  ,
115   
)

Validation failed because aliased address is invalid.

◆ DEFINE_NAMESPACE_RESULT() [5/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Namespace_Unknown  ,
109   
)

Validation failed because namespace does not exist.

◆ DEFINE_NAMESPACE_RESULT() [6/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Owner_Conflict  ,
112   
)

Validation failed because namespace has different owner.

◆ DEFINE_NAMESPACE_RESULT() [7/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Unlink_Data_Inconsistency  ,
114   
)

Validation failed because unlink data is not consistent with existing alias.

◆ DEFINE_NAMESPACE_RESULT() [8/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Alias_Unlink_Type_Inconsistency  ,
113   
)

Validation failed because unlink type is not consistent with existing alias.

◆ DEFINE_NAMESPACE_RESULT() [9/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Already_Active  ,
105   
)

Validation failed because the namespace is already active.

◆ DEFINE_NAMESPACE_RESULT() [10/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Already_Exists  ,
104   
)

Validation failed because the namespace already exists.

◆ DEFINE_NAMESPACE_RESULT() [11/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Eternal_After_Nemesis_Block  ,
106   
)

Validation failed because an eternal namespace was received after the nemesis block.

◆ DEFINE_NAMESPACE_RESULT() [12/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Expired  ,
 
)

Validation failed because the parent is expired.

◆ DEFINE_NAMESPACE_RESULT() [13/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Id_Mismatch  ,
 
)

Validation failed because the id is not the expected id generated from signer and nonce.

◆ DEFINE_NAMESPACE_RESULT() [14/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Invalid_Duration  ,
 
)

Validation failed because the duration has an invalid value.

◆ DEFINE_NAMESPACE_RESULT() [15/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Invalid_Name  ,
 
)

Validation failed because the name is invalid.

◆ DEFINE_NAMESPACE_RESULT() [16/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Invalid_Namespace_Type  ,
100   
)

Validation failed because the namespace type is invalid.

◆ DEFINE_NAMESPACE_RESULT() [17/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Max_Children_Exceeded  ,
107   
)

Validation failed because the maximum number of children for a root namespace was exceeded.

◆ DEFINE_NAMESPACE_RESULT() [18/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Name_Id_Mismatch  ,
 
)

Validation failed because the name and id don't match.

◆ DEFINE_NAMESPACE_RESULT() [19/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Owner_Conflict  ,
 
)

Validation failed because the parent owner conflicts with the child owner.

◆ DEFINE_NAMESPACE_RESULT() [20/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Parent_Unknown  ,
103   
)

Validation failed because the namespace parent is unknown.

◆ DEFINE_NAMESPACE_RESULT() [21/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Root_Name_Reserved  ,
101   
)

Validation failed because the root namespace has a reserved name.

◆ DEFINE_NAMESPACE_RESULT() [22/22]

catapult::validators::DEFINE_NAMESPACE_RESULT ( Too_Deep  ,
102   
)

Validation failed because the resulting namespace would exceed the maximum allowed namespace depth.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [1/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Invalid_Restriction_Type  ,
 
)

Validation failed because the account restriction type is invalid.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [2/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Modification_Address_Invalid  ,
 
)

Validation failed because a modification address is invalid.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [3/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Modification_Count_Exceeded  ,
 
)

Validation failed because the transaction has too many modifications.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [4/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Modification_Not_Allowed  ,
 
)

Validation failed because a value is not in the container.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [5/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Modification_Operation_Type_Incompatible  ,
 
)

Validation failed because the operation type is incompatible.

Note
This indicates that the existing restrictions have a different operation type than that specified in the notification.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [6/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Modification_Redundant  ,
 
)

Validation failed because a modification is redundant.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [7/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Modification_Type_Invalid  ,
 
)

Validation failed because a modification type is invalid.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [8/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Modify_Unsupported_Modification_Type  ,
 
)

Validation failed because the modification type is unsupported.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [9/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Mosaic_Transfer_Not_Allowed  ,
12   
)

Validation failed because the mosaic transfer is prohibited by the recipient.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [10/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Signer_Address_Interaction_Not_Allowed  ,
11   
)

Validation failed because the signer is not allowed to interact with an address involved in the transaction.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [11/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Transaction_Type_Not_Allowed  ,
13   
)

Validation failed because the transaction type is not allowed to be initiated by the signer.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [12/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Value_Invalid  ,
10   
)

Validation failed because the account restriction value is invalid.

◆ DEFINE_RESTRICTION_ACCOUNT_RESULT() [13/13]

catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT ( Values_Count_Exceeded  ,
 
)

Validation failed because the resulting account restriction has too many values.

◆ DEFINE_SECRET_LOCK_RESULT() [1/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Hash_Algorithm_Mismatch  ,
 
)

Validation failed because hash algorithm does not match.

◆ DEFINE_SECRET_LOCK_RESULT() [2/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Hash_Exists  ,
 
)

Validation failed because hash is already present in cache.

◆ DEFINE_SECRET_LOCK_RESULT() [3/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Hash_Not_Implemented  ,
 
)

Validation failed because hash is not implemented yet.

◆ DEFINE_SECRET_LOCK_RESULT() [4/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Inactive_Secret  ,
 
)

Validation failed because secret is inactive.

◆ DEFINE_SECRET_LOCK_RESULT() [5/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Invalid_Duration  ,
 
)

Validation failed because duration is too long.

◆ DEFINE_SECRET_LOCK_RESULT() [6/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Invalid_Hash_Algorithm  ,
 
)

Validation failed because hash algorithm for lock type secret is invalid.

◆ DEFINE_SECRET_LOCK_RESULT() [7/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Proof_Size_Out_Of_Bounds  ,
 
)

Validation failed because proof is too small or too large.

◆ DEFINE_SECRET_LOCK_RESULT() [8/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Secret_Mismatch  ,
 
)

Validation failed because secret does not match proof.

◆ DEFINE_SECRET_LOCK_RESULT() [9/9]

catapult::validators::DEFINE_SECRET_LOCK_RESULT ( Unknown_Composite_Key  ,
 
)

Validation failed because composite key is unknown.

◆ DEFINE_SIGNATURE_RESULT()

catapult::validators::DEFINE_SIGNATURE_RESULT ( Not_Verifiable  ,
 
)

Validation failed because the verification of the signature failed.

◆ DEFINE_STATEFUL_VALIDATOR() [1/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( AccountLinkAvailability  ,
[] (const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::AccountStateCache >();auto accountStateIter=cache.find(notification.MainAccountKey);const auto &accountState=accountStateIter.get();if(model::AccountLinkAction::Link==notification.LinkAction) { if(state::AccountType::Unlinked !=accountState.AccountType) return Failure_AccountLink_Link_Already_Exists;} else { if(state::AccountType::Main !=accountState.AccountType) return Failure_AccountLink_Link_Does_Not_Exist;if(notification.RemoteAccountKey !=accountState.LinkedAccountKey) return Failure_AccountLink_Unlink_Data_Inconsistency;} return ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [2/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( AccountOperationRestrictionNoSelfBlocking  ,
[] (const auto &notification, const ValidatorContext &context) { return Validate(notification, context) ? ValidationResult::Success :Failure_RestrictionAccount_Modification_Not_Allowed;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [3/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( AddressInteraction  ,
[] (const auto &notification, const ValidatorContext &context) { auto networkIdentifier=context.Network.Identifier;auto sourceAddress=model::PublicKeyToAddress(notification.Source, networkIdentifier);for(const auto &address :notification.ParticipantsByAddress) { if(!IsInteractionAllowed(context.Cache, sourceAddress, context.Resolvers.resolve(address))) return Failure_RestrictionAccount_Signer_Address_Interaction_Not_Allowed;} for(const auto &key :notification.ParticipantsByKey) { auto address=model::PublicKeyToAddress(key, networkIdentifier);if(!IsInteractionAllowed(context.Cache, sourceAddress, address)) return Failure_RestrictionAccount_Signer_Address_Interaction_Not_Allowed;} return ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [4/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( AliasAvailability  ,
[] (const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::NamespaceCache >();auto namespaceIter=cache.find(notification.NamespaceId);if(!namespaceIter.tryGet()) return Failure_Namespace_Alias_Namespace_Unknown;const auto &root=namespaceIter.get().root();if(!root.lifetime().isActiveAndUnlocked(context.Height)) return Failure_Namespace_Expired;auto aliasType=root.alias(notification.NamespaceId).type();if(model::AliasAction::Link==notification.AliasAction &&state::AliasType::None !=aliasType) return Failure_Namespace_Alias_Already_Exists;else if(model::AliasAction::Unlink==notification.AliasAction &&state::AliasType::None==aliasType) return Failure_Namespace_Alias_Does_Not_Exist;return root.owner()==notification.Owner ? ValidationResult::Success :Failure_Namespace_Alias_Owner_Conflict;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [5/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( ChildNamespaceAvailability  ,
[] (const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::NamespaceCache >();auto height=context.Height;if(cache.contains(notification.NamespaceId)) return Failure_Namespace_Already_Exists;if(!cache.contains(notification.ParentId)) return Failure_Namespace_Parent_Unknown;auto namespaceIter=cache.find(notification.ParentId);const auto &parentEntry=namespaceIter.get();const auto &parentPath=parentEntry.ns().path();if(parentPath.size()==parentPath.capacity()) return Failure_Namespace_Too_Deep;const auto &root=parentEntry.root();if(!root.lifetime().isActiveAndUnlocked(height)) return Failure_Namespace_Expired;if(root.owner() !=notification.Signer) return Failure_Namespace_Owner_Conflict;return ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [6/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( EligibleHarvester  ,
[] (const auto &notification, const auto &context) { cache::ImportanceView view(context.Cache.template sub< cache::AccountStateCache >());return view.canHarvest(notification.Signer, context.Height) ? ValidationResult::Success :Failure_Core_Block_Harvester_Ineligible;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [7/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( ModifyMultisigInvalidCosigners  ,
[] (const auto &notification, const ValidatorContext &context) { const auto &multisigCache=context.Cache.sub< cache::MultisigCache >();const auto *pModifications=notification.ModificationsPtr;if(!multisigCache.contains(notification.Signer)) { for(auto i=0u;i< notification.ModificationsCount;++i) { if(model::CosignatoryModificationType::Del==pModifications[i].ModificationType) return Failure_Multisig_Modify_Unknown_Multisig_Account;} return ValidationResult::Success;} auto multisigIter=multisigCache.find(notification.Signer);const auto &multisigEntry=multisigIter.get();for(auto i=0u;i< notification.ModificationsCount;++i) { auto isCosignatory=multisigEntry.hasCosignatory(pModifications[i].CosignatoryPublicKey);auto isEnablingCosignatory=model::CosignatoryModificationType::Add==pModifications[i].ModificationType;if(!isEnablingCosignatory &&!isCosignatory) return Failure_Multisig_Modify_Not_A_Cosigner;if(isEnablingCosignatory &&isCosignatory) return Failure_Multisig_Modify_Already_A_Cosigner;} return ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [8/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( ModifyMultisigInvalidSettings  ,
[] (const auto &notification, const ValidatorContext &context) { const auto &multisigCache=context.Cache.sub< cache::MultisigCache >();if(!multisigCache.contains(notification.Signer)) { if(-1 !=notification.MinRemovalDelta||-1 !=notification.MinApprovalDelta) return Failure_Multisig_Modify_Min_Setting_Out_Of_Range;return ValidationResult::Success;} auto multisigIter=multisigCache.find(notification.Signer);const auto &multisigEntry=multisigIter.get();int newMinRemoval=multisigEntry.minRemoval()+notification.MinRemovalDelta;int newMinApproval=multisigEntry.minApproval()+notification.MinApprovalDelta;if(1 > newMinRemoval||1 > newMinApproval) return Failure_Multisig_Modify_Min_Setting_Out_Of_Range;int maxValue=static_cast< int >(multisigEntry.cosignatories().size());if(newMinRemoval > maxValue||newMinApproval > maxValue) return Failure_Multisig_Modify_Min_Setting_Larger_Than_Num_Cosignatories;return ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [9/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( MosaicAvailability  ,
[] (const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::MosaicCache >();auto mosaicIter=cache.find(notification.MosaicId);if(!mosaicIter.tryGet()) return ValidationResult::Success;if(!cache.isActive(notification.MosaicId, context.Height)) return Failure_Mosaic_Expired;const auto &entry=mosaicIter.get();auto requiredPropertyChanged=ContainsRequiredPropertyChange(notification.Properties);if(!requiredPropertyChanged &&entry.definition().isEternal()) return Failure_Mosaic_Modification_No_Changes;return Amount() !=entry.supply() ? Failure_Mosaic_Modification_Disallowed :ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [10/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( MosaicRecipient  ,
[] (const auto &notification, const ValidatorContext &context) { AccountRestrictionView view(context.Cache);if(!view.initialize(context.Resolvers.resolve(notification.Recipient))) return ValidationResult::Success;auto mosaicId=context.Resolvers.resolve(notification.MosaicId);auto isTransferAllowed=view.isAllowed(model::AccountRestrictionType::MosaicId, mosaicId);return isTransferAllowed ? ValidationResult::Success :Failure_RestrictionAccount_Mosaic_Transfer_Not_Allowed;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [11/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( MultisigAggregateEligibleCosigners  ,
[] (const auto &notification, const ValidatorContext &context) { AggregateCosignaturesChecker checker(notification, context.Cache.sub< cache::MultisigCache >());return checker.hasIneligibleCosigners() ? Failure_Aggregate_Ineligible_Cosigners :ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [12/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( MultisigAggregateSufficientCosigners  ,
[] (const auto &notification, const ValidatorContext &context) { AggregateCosignaturesChecker checker(notification, context.Cache.sub< cache::MultisigCache >());return checker.hasSufficientCosigners() ? ValidationResult::Success :Failure_Aggregate_Missing_Cosigners;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [13/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( MultisigPermittedOperation  ,
[] (const auto &notification, const ValidatorContext &context) { const auto &multisigCache=context.Cache.sub< cache::MultisigCache >();if(!multisigCache.contains(notification.Signer)) return ValidationResult::Success;auto multisigIter=multisigCache.find(notification.Signer);return multisigIter.get().cosignatories().empty() ? ValidationResult::Success :Failure_Multisig_Operation_Not_Permitted_By_Account;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [14/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( NemesisSink  ,
[] (const auto &notification, const auto &context) { auto isBlockHeightOne=context.Height==Height(1);auto isNemesisPublicKey=notification.Signer==context.Network.PublicKey;return isBlockHeightOne||!isNemesisPublicKey ? ValidationResult::Success :Failure_Core_Nemesis_Account_Signed_After_Nemesis_Block;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [15/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( NewRemoteAccountAvailability  ,
[] (const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::AccountStateCache >();auto remoteAccountStateIter=cache.find(notification.RemoteAccountKey);return !remoteAccountStateIter.tryGet()||state::AccountType::Remote_Unlinked==remoteAccountStateIter.get().AccountType ? ValidationResult::Success :Failure_AccountLink_Remote_Account_Ineligible;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [16/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( ProperMosaic  ,
[] (const auto &notification, const ValidatorContext &context) { auto view=ActiveMosaicView(context.Cache);auto mosaicId=notification.MosaicId;if(Notification::MosaicType::Unresolved==notification.ProvidedMosaicType) mosaicId=context.Resolvers.resolve(notification.UnresolvedMosaicId);ActiveMosaicView::FindIterator mosaicIter;return view.tryGet(mosaicId, context.Height, notification.Signer, mosaicIter);}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [17/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( RemoteInteraction  ,
([](const auto &notification, const auto &context) { if(model::AccountLinkTransaction::Entity_Type==notification.TransactionType) return ValidationResult::Success;const auto &cache=context.Cache.template sub< cache::AccountStateCache >();const auto &addresses=notification.ParticipantsByAddress;const auto &keys=notification.ParticipantsByKey;auto predicate=[&cache, &context](const auto &key) { return IsRemote(cache, GetResolvedKey(key, context.Resolvers));};return std::any_of(addresses.cbegin(), addresses.cend(), predicate)||std::any_of(keys.cbegin(), keys.cend(), predicate) ? Failure_AccountLink_Remote_Account_Participant_Not_Allowed :ValidationResult::Success;})   
)

◆ DEFINE_STATEFUL_VALIDATOR() [18/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( RemoteSender  ,
[] (const auto &notification, const auto &context) { const auto &cache=context.Cache.template sub< cache::AccountStateCache >();auto accountStateIter=cache.find(notification.Signer);return accountStateIter.tryGet() &&state::IsRemote(accountStateIter.get().AccountType) ? Failure_AccountLink_Remote_Account_Signer_Not_Allowed :ValidationResult::Success;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [19/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( RootNamespaceAvailability  ,
[] (const auto &notification, const ValidatorContext &context) { const auto &cache=context.Cache.sub< cache::NamespaceCache >();auto height=context.Height;if(Height(1) !=height &&Eternal_Artifact_Duration==notification.Duration) return Failure_Namespace_Eternal_After_Nemesis_Block;if(!cache.contains(notification.NamespaceId)) return ValidationResult::Success;auto namespaceIter=cache.find(notification.NamespaceId);const auto &root=namespaceIter.get().root();if(IsEternal(root.lifetime())||Eternal_Artifact_Duration==notification.Duration) return Failure_Namespace_Invalid_Duration;if(!root.lifetime().isActiveOrGracePeriod(height)) return ValidationResult::Success;return root.owner()==notification.Signer ? ValidationResult::Success :Failure_Namespace_Owner_Conflict;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [20/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( Transaction  ,
[] (const auto &notification, const ValidatorContext &context) { AccountRestrictionView view(context.Cache);if(!view.initialize(model::PublicKeyToAddress(notification.Signer, context.Network.Identifier))) return ValidationResult::Success;auto isTransferAllowed=view.isAllowed(model::AccountRestrictionType::TransactionType, notification.TransactionType);return isTransferAllowed ? ValidationResult::Success :Failure_RestrictionAccount_Transaction_Type_Not_Allowed;}   
)

◆ DEFINE_STATEFUL_VALIDATOR() [21/21]

catapult::validators::DEFINE_STATEFUL_VALIDATOR ( UniqueTransactionHash  ,
[] (const auto &notification, const ValidatorContext &context) { const auto &hashCache=context.Cache.sub< cache::HashCache >();return hashCache.contains(state::TimestampedHash(notification.Deadline, notification.TransactionHash)) ? Failure_Hash_Exists :ValidationResult::Success;}   
)

◆ DEFINE_STATELESS_VALIDATOR() [1/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( AccountLinkAction  ,
[] (const auto &notification) { return ValidateLessThanOrEqual(notification.LinkAction, model::AccountLinkAction::Unlink, Failure_AccountLink_Invalid_Action);}   
)

◆ DEFINE_STATELESS_VALIDATOR() [2/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( AccountOperationRestrictionModificationValues  ,
[] (const auto &notification) { return AreAllAccountRestrictionValuesValid(notification.ModificationsPtr, notification.ModificationsCount) ? ValidationResult::Success :Failure_RestrictionAccount_Value_Invalid;}   
)

◆ DEFINE_STATELESS_VALIDATOR() [3/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( AccountRestrictionType  ,
[] (const auto &notification) { return IsValidAccountRestrictionType(notification.AccountRestrictionType) ? ValidationResult::Success :Failure_RestrictionAccount_Invalid_Restriction_Type;}   
)

◆ DEFINE_STATELESS_VALIDATOR() [4/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( AliasAction  ,
[] (const auto &notification) { return ValidateLessThanOrEqual(notification.AliasAction, model::AliasAction::Unlink, Failure_Namespace_Alias_Invalid_Action);}   
)

◆ DEFINE_STATELESS_VALIDATOR() [5/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( ModifyMultisigCosigners  ,
[] (const auto &notification) { utils::KeyPointerSet addedAccounts;utils::KeyPointerSet removedAccounts;const auto *pModifications=notification.ModificationsPtr;for(auto i=0u;i< notification.ModificationsCount;++i) { if(!IsValidModificationType(pModifications[i].ModificationType)) return Failure_Multisig_Modify_Unsupported_Modification_Type;auto &accounts=model::CosignatoryModificationType::Add==pModifications[i].ModificationType ? addedAccounts :removedAccounts;const auto &oppositeAccounts=&accounts==&addedAccounts ? removedAccounts :addedAccounts;auto &key=pModifications[i].CosignatoryPublicKey;if(oppositeAccounts.end() !=oppositeAccounts.find(&key)) return Failure_Multisig_Modify_Account_In_Both_Sets;accounts.insert(&key);} if(1< removedAccounts.size()) return Failure_Multisig_Modify_Multiple_Deletes;if(notification.ModificationsCount !=addedAccounts.size()+removedAccounts.size()) return Failure_Multisig_Modify_Redundant_Modifications;return ValidationResult::Success;}   
)

◆ DEFINE_STATELESS_VALIDATOR() [6/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( MosaicSupplyChange  ,
[] (const auto &notification) { if(!IsValidDirection(notification.Direction)) return Failure_Mosaic_Invalid_Supply_Change_Direction;return Amount()==notification.Delta ? Failure_Mosaic_Invalid_Supply_Change_Amount :ValidationResult::Success;}   
)

◆ DEFINE_STATELESS_VALIDATOR() [7/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( NamespaceType  ,
[] (const auto &notification) { return ValidateLessThanOrEqual(notification.NamespaceType, model::NamespaceType::Child, Failure_Namespace_Invalid_Namespace_Type);}   
)

◆ DEFINE_STATELESS_VALIDATOR() [8/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( SecretLockHashAlgorithm  ,
[] (const auto &notification) { return ValidateLessThanOrEqual(notification.HashAlgorithm, model::LockHashAlgorithm::Op_Hash_256, Failure_LockSecret_Invalid_Hash_Algorithm);}   
)

◆ DEFINE_STATELESS_VALIDATOR() [9/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( StrictAggregateCosignatures  ,
[] (const auto &notification) { utils::ArrayPointerFlagMap< Key > cosigners;cosigners.emplace(&notification.Signer, false);const auto *pCosignature=notification.CosignaturesPtr;for(auto i=0u;i< notification.CosignaturesCount;++i) { cosigners.emplace(&pCosignature->Signer, false);++pCosignature;} auto hasMissingCosigners=false;const auto *pTransaction=notification.TransactionsPtr;for(auto i=0u;i< notification.TransactionsCount;++i) { auto iter=cosigners.find(&pTransaction->Signer);if(cosigners.cend()==iter) hasMissingCosigners=true;else iter->second=true;pTransaction=AdvanceNext(pTransaction);} return std::all_of(cosigners.cbegin(), cosigners.cend(), [](const auto &pair) { return pair.second;}) ? hasMissingCosigners ? Failure_Aggregate_Missing_Cosigners :ValidationResult::Success :Failure_Aggregate_Ineligible_Cosigners;}   
)

◆ DEFINE_STATELESS_VALIDATOR() [10/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( TransactionFee  ,
[] (const auto &notification) { if(notification.Fee > notification.MaxFee) return Failure_Core_Invalid_Transaction_Fee;constexpr auto Max_Raw_Block_Fee_Multiplier=static_cast< uint64_t >(std::numeric_limits< BlockFeeMultiplier::ValueType >::max());return notification.MaxFee.unwrap() > Max_Raw_Block_Fee_Multiplier *notification.TransactionSize ? Failure_Core_Invalid_Transaction_Fee :ValidationResult::Success;}   
)

◆ DEFINE_STATELESS_VALIDATOR() [11/11]

catapult::validators::DEFINE_STATELESS_VALIDATOR ( TransferMosaics  ,
[] (const auto &notification) { if(1 >=notification.MosaicsCount) return ValidationResult::Success;auto pMosaics=notification.MosaicsPtr;auto lastMosaicId=pMosaics[0].MosaicId;for(auto i=1u;i< notification.MosaicsCount;++i) { auto currentMosaicId=pMosaics[i].MosaicId;if(lastMosaicId >=currentMosaicId) return Failure_Transfer_Out_Of_Order_Mosaics;lastMosaicId=currentMosaicId;} return ValidationResult::Success;}   
)

◆ DEFINE_TRANSFER_RESULT() [1/2]

catapult::validators::DEFINE_TRANSFER_RESULT ( Message_Too_Large  ,
 
)

Validation failed because the message is too large.

◆ DEFINE_TRANSFER_RESULT() [2/2]

catapult::validators::DEFINE_TRANSFER_RESULT ( Out_Of_Order_Mosaics  ,
 
)

Validation failed because mosaics are out of order.

◆ DEFINE_VALIDATION_RESULT()

catapult::validators::DEFINE_VALIDATION_RESULT ( Failure  ,
Hash  ,
Exists  ,
,
Verbose   
)

Validation failed because the entity hash is already known.

◆ GetSeverity()

constexpr ResultSeverity catapult::validators::GetSeverity ( ValidationResult  result)
constexpr

Extracts the encoded result severity from result.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSet()

constexpr bool catapult::validators::IsSet ( ValidationResult  result,
ResultFlags  flags 
)
constexpr

Checks if result has all flags set.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsValidationResultFailure()

constexpr bool catapult::validators::IsValidationResultFailure ( ValidationResult  result)
constexpr

Returns a value indicating whether the validation result is a failure.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsValidationResultSuccess()

constexpr bool catapult::validators::IsValidationResultSuccess ( ValidationResult  result)
constexpr

Returns a value indicating whether the validation result is a success.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeValidationResult()

constexpr ValidationResult catapult::validators::MakeValidationResult ( ResultSeverity  severity,
FacilityCode  facility,
uint16_t  code,
ResultFlags  flags 
)
constexpr

Makes a validation result given severity, facility, code and flags.

◆ MapToLogLevel()

constexpr utils::LogLevel catapult::validators::MapToLogLevel ( ValidationResult  result)
constexpr

Maps validation result to an appropriate logging level.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<()

std::ostream & catapult::validators::operator<< ( std::ostream &  out,
ValidationResult  result 
)

Insertion operator for outputting result to out.

Here is the call graph for this function:

◆ ValidateLessThanOrEqual()

template<typename TValue >
constexpr ValidationResult catapult::validators::ValidateLessThanOrEqual ( TValue  value,
TValue  maxValue,
ValidationResult  failureResult 
)
constexpr

Validates that value is less than or equal to maxValue and returns failureResult on failure.

Variable Documentation

◆ lockedFundsPerAggregate

Amount catapult::validators::lockedFundsPerAggregate
Initial value:
{
return MAKE_STATEFUL_VALIDATOR(HashLockMosaic, ([currencyMosaicId, lockedFundsPerAggregate](
const auto& notification,
const auto& context) {
if (lockedFundsPerAggregate != notification.Mosaic.Amount)
return Failure_LockHash_Invalid_Mosaic_Amount;
return currencyMosaicId != context.Resolvers.resolve(notification.Mosaic.MosaicId)
? Failure_LockHash_Invalid_Mosaic_Id
: ValidationResult::Success;
}))

◆ MAKE_STATELESS_VALIDATOR

for (const auto& name : reservedRootNamespaceNames) reservedRootIds.emplace(model return catapult::validators::MAKE_STATELESS_VALIDATOR(NamespaceName,([maxNameSize, reservedRootIds](const auto &notification) { if(maxNameSize< notification.NameSize||!model::IsValidName(notification.NamePtr, notification.NameSize)) return Failure_Namespace_Invalid_Name; auto name=utils::RawString(reinterpret_cast< const char * >(notification.NamePtr), notification.NameSize); if(notification.NamespaceId !=model::GenerateNamespaceId(notification.ParentId, name)) return Failure_Namespace_Name_Id_Mismatch; auto namespaceId=Namespace_Base_Id==notification.ParentId ? notification.NamespaceId :notification.ParentId; if(reservedRootIds.cend() !=reservedRootIds.find(namespaceId)) return Failure_Namespace_Root_Name_Reserved; return ValidationResult::Success; }))

◆ maxCosignatures

uint8_t catapult::validators::maxCosignatures
Initial value:
{
return MAKE_STATELESS_VALIDATOR(BasicAggregateCosignatures, ([maxTransactions, maxCosignatures](const auto& notification) {
if (0 == notification.TransactionsCount)
return Failure_Aggregate_No_Transactions;
if (maxTransactions < notification.TransactionsCount)
return Failure_Aggregate_Too_Many_Transactions;
if (maxCosignatures < notification.CosignaturesCount + 1)
return Failure_Aggregate_Too_Many_Cosignatures;
cosigners.insert(&notification.Signer);
const auto* pCosignature = notification.CosignaturesPtr;
for (auto i = 0u; i < notification.CosignaturesCount; ++i) {
if (!cosigners.insert(&pCosignature->Signer).second)
return Failure_Aggregate_Redundant_Cosignatures;
++pCosignature;
}
return ValidationResult::Success;
}))

◆ maxMosaicDuration

BlockDuration catapult::validators::maxMosaicDuration
Initial value:
{
return MAKE_STATELESS_VALIDATOR(MosaicProperties, ([maxDivisibility, maxMosaicDuration](const auto& notification) {
if (!IsValidFlags(notification.PropertiesHeader.Flags))
return Failure_Mosaic_Invalid_Flags;
if (notification.PropertiesHeader.Divisibility > maxDivisibility)
return Failure_Mosaic_Invalid_Divisibility;
return CheckOptionalProperties(notification, maxMosaicDuration);
}))

◆ maxProofSize

uint16_t catapult::validators::maxProofSize
Initial value:
{
return MAKE_STATELESS_VALIDATOR(ProofSecret, ([minProofSize, maxProofSize](const auto& notification) {
if (!SupportedHash(notification.HashAlgorithm))
return Failure_LockSecret_Hash_Not_Implemented;
if (notification.Proof.Size < minProofSize || notification.Proof.Size > maxProofSize)
return Failure_LockSecret_Proof_Size_Out_Of_Bounds;
auto secret = model::CalculateHash(notification.HashAlgorithm, notification.Proof);
return notification.Secret == secret ? ValidationResult::Success : Failure_LockSecret_Secret_Mismatch;
}))

◆ reservedRootNamespaceNames

const std::unordered_set< std::string > & catapult::validators::reservedRootNamespaceNames
Initial value:
{
std::unordered_set<NamespaceId, utils::BaseValueHasher<NamespaceId>> reservedRootIds

◆ UnresolvedMosaicId

catapult::validators::UnresolvedMosaicId
MAKE_STATEFUL_VALIDATOR
#define MAKE_STATEFUL_VALIDATOR(NAME, HANDLER)
Definition: ValidatorTypes.h:123
catapult::validators::maxCosignatures
uint8_t maxCosignatures
Definition: BasicAggregateCosignaturesValidator.cpp:28
catapult::validators::lockedFundsPerAggregate
Amount lockedFundsPerAggregate
Definition: HashLockMosaicValidator.cpp:28
catapult::validators::maxMosaicDuration
BlockDuration maxMosaicDuration
Definition: MosaicPropertiesValidator.cpp:52
catapult::validators::maxProofSize
uint16_t maxProofSize
Definition: ProofSecretValidator.cpp:38
catapult::model::CalculateHash
Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer &data)
Calculates hashAlgorithm hash of data.
Definition: LockHashUtils.cpp:46
MAKE_STATELESS_VALIDATOR
#define MAKE_STATELESS_VALIDATOR(NAME, HANDLER)
Definition: ValidatorTypes.h:101
catapult::utils::KeyPointerSet
ArrayPointerSet< Key > KeyPointerSet
A key pointer set.
Definition: ArraySet.h:73