CatapultServer
v0.5.0.1 (Elephant)
|
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... | |
Functions | |
DECLARE_STATEFUL_VALIDATOR (Address, Notification)(model | |
DECLARE_STATEFUL_VALIDATOR (Deadline, Notification)(const utils | |
DEFINE_STATEFUL_VALIDATOR (EligibleHarvester, [](const auto ¬ification, 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 ¬ification, 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 ¬ification) { 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 ¬ification, 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 ¬ification) { return ValidateLessThanOrEqual(notification.LinkAction, model::AccountLinkAction::Unlink, Failure_AccountLink_Invalid_Action);}) | |
DEFINE_STATEFUL_VALIDATOR (AccountLinkAvailability, [](const auto ¬ification, 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 ¬ification, 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 ¬ification, 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 ¬ification, 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 ¬ification) { utils::ArrayPointerFlagMap< Key > cosigners;cosigners.emplace(¬ification.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 ¬ification) { 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 ¬ification, 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 ¬ification) { 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 ¬ification, 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 ¬ification) { 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 ¬ification, 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 ¬ification, 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 ¬ification, 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 ¬ification, 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 ¬ification, 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::ModifyMultisigCosignersNotification > | CreateModifyMultisigCosignersValidator () |
stateful::NotificationValidatorPointerT< model::TransactionNotification > | CreateMultisigPermittedOperationValidator () |
stateful::NotificationValidatorPointerT< model::ModifyMultisigCosignersNotification > | CreateModifyMultisigInvalidCosignersValidator () |
stateful::NotificationValidatorPointerT< model::ModifyMultisigNewCosignerNotification > | CreateModifyMultisigMaxCosignedAccountsValidator (uint8_t maxCosignedAccountsPerAccount) |
stateful::NotificationValidatorPointerT< model::ModifyMultisigCosignersNotification > | CreateModifyMultisigMaxCosignersValidator (uint8_t maxCosignersPerAccount) |
stateful::NotificationValidatorPointerT< model::ModifyMultisigNewCosignerNotification > | CreateModifyMultisigLoopAndLevelValidator (uint8_t maxMultisigDepth) |
stateful::NotificationValidatorPointerT< model::ModifyMultisigSettingsNotification > | CreateModifyMultisigInvalidSettingsValidator () |
stateful::NotificationValidatorPointerT< model::AggregateCosignaturesNotification > | CreateMultisigAggregateEligibleCosignersValidator () |
stateful::NotificationValidatorPointerT< model::AggregateEmbeddedTransactionNotification > | CreateMultisigAggregateSufficientCosignersValidator () |
DEFINE_STATELESS_VALIDATOR (AliasAction, [](const auto ¬ification) { return ValidateLessThanOrEqual(notification.AliasAction, model::AliasAction::Unlink, Failure_Namespace_Alias_Invalid_Action);}) | |
DEFINE_STATEFUL_VALIDATOR (AliasAvailability, [](const auto ¬ification, 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 ¬ification, 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 ¬ification, 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 ¬ification) { 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 ¬ification) { return AreAllAccountRestrictionValuesValid(notification.ModificationsPtr, notification.ModificationsCount) ? ValidationResult::Success :Failure_RestrictionAccount_Value_Invalid;}) | |
DEFINE_STATEFUL_VALIDATOR (AccountOperationRestrictionNoSelfBlocking, [](const auto ¬ification, 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 ¬ification) { 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 ¬ification, 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 ¬ification, 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 ¬ification, 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 ¬ification) { 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 ParallelValidationPolicy > | CreateParallelValidationPolicy (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 NameSet & | reservedRootNamespaceNames |
for(const auto &name :reservedRootNamespaceNames) reservedRootIds.emplace(model return | MAKE_STATELESS_VALIDATOR (NamespaceName,([maxNameSize, reservedRootIds](const auto ¬ification) { 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 | |
using catapult::validators::BalanceTransferNotification = typedef model::BalanceTransferNotification |
using catapult::validators::CacheReadOnlyType = typedef typename cache::AccountRestrictionCacheTypes::CacheReadOnlyType |
using catapult::validators::NameSet = typedef std::unordered_set<std::string> |
using catapult::validators::ValidationFunction = typedef std::function<ValidationResult (const model::WeakEntityInfo&)> |
A validation function.
using catapult::validators::ValidationFunctions = typedef std::vector<ValidationFunction> |
A vector of validation functions.
using catapult::validators::ValidationPolicyFunc = typedef std::function<TResult (const model::WeakEntityInfos&, const ValidationFunctions&)> |
Function signature for validation policies.
using catapult::validators::ValidationResultPredicate = typedef predicate<ValidationResult> |
Validation result predicate.
using catapult::validators::ValidatorVectorT = typedef std::vector<std::unique_ptr<const EntityValidatorT<TArgs...> >> |
A vector of validators.
|
strong |
Possible validation facility codes.
|
strong |
|
strong |
|
strong |
void catapult::validators::AggregateValidationResult | ( | std::atomic< ValidationResult > & | aggregate, |
ValidationResult | value | ||
) |
Aggregates result into aggregate.
void catapult::validators::AggregateValidationResult | ( | ValidationResult & | aggregate, |
ValidationResult | value | ||
) |
Aggregates result into aggregate.
stateless::NotificationValidatorPointerT<model::ModifyMultisigCosignersNotification> catapult::validators::CreateModifyMultisigCosignersValidator | ( | ) |
Validator that applies to modify multisig cosigners notifications and validates that:
stateful::NotificationValidatorPointerT<model::ModifyMultisigCosignersNotification> catapult::validators::CreateModifyMultisigInvalidCosignersValidator | ( | ) |
Validator that applies to modify multisig cosigners notifications and validates that:
stateful::NotificationValidatorPointerT<model::ModifyMultisigSettingsNotification> catapult::validators::CreateModifyMultisigInvalidSettingsValidator | ( | ) |
Validator that applies to modify multisig settings notifications and validates that:
stateful::NotificationValidatorPointerT<model::ModifyMultisigNewCosignerNotification> catapult::validators::CreateModifyMultisigLoopAndLevelValidator | ( | uint8_t | maxMultisigDepth | ) |
Validator that applies to modify multisig new cosigner notifications and validates that:
stateful::NotificationValidatorPointerT<model::ModifyMultisigNewCosignerNotification> catapult::validators::CreateModifyMultisigMaxCosignedAccountsValidator | ( | uint8_t | maxCosignedAccountsPerAccount | ) |
Validator that applies to modify multisig new cosigner notifications and validates that:
stateful::NotificationValidatorPointerT<model::ModifyMultisigCosignersNotification> catapult::validators::CreateModifyMultisigMaxCosignersValidator | ( | uint8_t | maxCosignersPerAccount | ) |
Validator that applies to modify multisig cosigners notifications and validates that:
stateful::NotificationValidatorPointerT<model::AggregateCosignaturesNotification> catapult::validators::CreateMultisigAggregateEligibleCosignersValidator | ( | ) |
Validator that applies to aggregate cosignatures notifications and validates that:
stateful::NotificationValidatorPointerT<model::AggregateEmbeddedTransactionNotification> catapult::validators::CreateMultisigAggregateSufficientCosignersValidator | ( | ) |
Validator that applies to aggregate embeded transaction notifications and validates that:
stateful::NotificationValidatorPointerT<model::TransactionNotification> catapult::validators::CreateMultisigPermittedOperationValidator | ( | ) |
Validator that applies to transaction notifications and validates that:
std::shared_ptr< const ParallelValidationPolicy > catapult::validators::CreateParallelValidationPolicy | ( | const std::shared_ptr< thread::IoThreadPool > & | pPool | ) |
Creates a parallel validation policy using pPool for parallelization.
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | AccountLinkAvailability | , |
model::RemoteAccountLinkNotification | |||
) |
Validator that applies to remote account link notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | AccountOperationRestrictionNoSelfBlocking | , |
model::ModifyAccountOperationRestrictionValueNotification | |||
) |
Validator that applies to modify account transaction restriction notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | Address | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | AddressAlias | , |
model::AliasedAddressNotification | |||
) |
Validator that applies to aliased address notifications and validates that:
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:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | AggregateHashPresent | , |
model::TransactionNotification | |||
) |
Validator that applies to transaction notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | AliasAvailability | , |
model::AliasOwnerNotification | |||
) |
Validator that applies to alias owner notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | BalanceDebit | , |
model::BalanceDebitNotification | |||
) |
Validator that applies to all balance debit notifications and validates that:
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:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | ChildNamespaceAvailability | , |
model::ChildNamespaceNotification | |||
) |
Validator that applies to child namespace notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | Deadline | , |
Notification | |||
) | const |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | EligibleHarvester | , |
model::BlockNotification | |||
) |
Validator that applies to all block notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | HashLockCacheUnique | , |
model::HashLockNotification | |||
) |
Validator that applies to hash lock notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | HashLockMosaic | , |
model::HashLockMosaicNotification | |||
) |
Validator that applies to hash lock mosaic notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | HashLockMosaic | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MaxMosaicsBalanceTransfer | , |
model::BalanceTransferNotification | |||
) |
Validator that applies to all balance transfer notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MaxMosaicsSupplyChange | , |
model::MosaicSupplyChangeNotification | |||
) |
Validator that applies to mosaic supply change notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | ModifyMultisigLoopAndLevel | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | ModifyMultisigMaxCosignedAccounts | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | ModifyMultisigMaxCosigners | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicAvailability | , |
model::MosaicDefinitionNotification | |||
) |
Validator that applies to mosaic definition notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicDuration | , |
model::MosaicDefinitionNotification | |||
) |
Validator that applies to mosaic definition notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicDuration | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicRecipient | , |
model::BalanceTransferNotification | |||
) |
Validator that applies to balance transfer notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicSupplyChangeAllowed | , |
model::MosaicSupplyChangeNotification | |||
) |
Validator that applies to mosaic supply change notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicSupplyChangeAllowed | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicTransfer | , |
model::BalanceTransferNotification | |||
) |
Validator that applies to all balance transfer notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | MosaicTransfer | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | NamespaceDurationOverflow | , |
model::RootNamespaceNotification | |||
) |
Validator that applies to root namespace notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | NamespaceDurationOverflow | , |
Notification | |||
) |
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:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | NewRemoteAccountAvailability | , |
model::NewRemoteAccountNotification | |||
) |
Validator that applies to new remote account notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | Proof | , |
model::ProofPublicationNotification | |||
) |
Validator that applies to proof notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | ProperMosaic | , |
model::MosaicRequiredNotification | |||
) |
Validator that applies to mosaic required notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | RemoteInteraction | , |
model::AddressInteractionNotification | |||
) |
Validator that applies to address interaction notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | RemoteSender | , |
model::TransactionNotification | |||
) |
Validator that applies to transaction notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | RootNamespaceAvailability | , |
model::RootNamespaceNotification | |||
) |
Validator that applies to root namespace notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | RootNamespaceMaxChildren | , |
model::ChildNamespaceNotification | |||
) |
Validator that applies to child namespace notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | RootNamespaceMaxChildren | , |
Notification | |||
) |
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | SecretLockCacheUnique | , |
model::SecretLockNotification | |||
) |
Validator that applies to secret lock notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | Transaction | , |
model::TransactionNotification | |||
) |
Validator that applies to transaction notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | UniqueTransactionHash | , |
model::TransactionNotification | |||
) |
Validator that applies to all transaction notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | UnlinkAliasedAddressConsistency | , |
model::AliasedAddressNotification | |||
) |
Validator that applies to aliased address notifications and validates that:
catapult::validators::DECLARE_STATEFUL_VALIDATOR | ( | UnlinkAliasedMosaicIdConsistency | , |
model::AliasedMosaicIdNotification | |||
) |
Validator that applies to aliased mosaic id notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | AccountAddressRestrictionNoSelfModification | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | AccountLinkAction | , |
model::RemoteAccountLinkNotification | |||
) |
Validator that applies to remote account link notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | AccountOperationRestrictionModificationValues | , |
model::ModifyAccountOperationRestrictionNotification | |||
) |
Validator that applies to modify account transaction restriction notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | AccountRestrictionType | , |
model::AccountRestrictionTypeNotification | |||
) |
Validator that applies to account restriction type notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | AliasAction | , |
model::AliasOwnerNotification | |||
) |
Validator that applies to alias owner notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | BasicAggregateCosignatures | , |
model::AggregateCosignaturesNotification | |||
) |
Validator that applies to aggregate cosignatures notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | BasicAggregateCosignatures | , |
Notification | |||
) |
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:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | HashLockDuration | , |
model::HashLockDurationNotification | |||
) |
Validator that applies to hash lock notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | MaxTransactions | , |
model::BlockNotification | |||
) |
Validator that applies to all block notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | MaxTransactions | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | MosaicId | , |
model::MosaicNonceNotification | |||
) |
Validator that applies to mosaic nonce notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | MosaicProperties | , |
model::MosaicPropertiesNotification | |||
) |
Validator that applies to mosaic properties notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | MosaicProperties | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | MosaicSupplyChange | , |
model::MosaicSupplyChangeNotification | |||
) |
Validator that applies to mosaic supply change notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | NamespaceName | , |
model::NamespaceNameNotification | |||
) |
Validator that applies to namespace name notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | NamespaceName | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | NamespaceType | , |
model::NamespaceNotification | |||
) |
Validator that applies to namespace notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | Network | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | ProofSecret | , |
model::ProofSecretNotification | |||
) |
Validator that applies to proof notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | ProofSecret | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | RootNamespace | , |
model::RootNamespaceNotification | |||
) |
Validator that applies to root namespace notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | RootNamespace | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | SecretLockDuration | , |
model::SecretLockDurationNotification | |||
) |
Validator that applies to secret lock notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | SecretLockHashAlgorithm | , |
model::SecretLockHashAlgorithmNotification | |||
) |
Validator that applies to secret lock hash algorithm notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | Signature | , |
model::SignatureNotification | |||
) | const & |
Validator that applies to all signature notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | Signature | , |
Notification | |||
) | const & |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | StrictAggregateCosignatures | , |
model::AggregateCosignaturesNotification | |||
) |
Validator that applies to aggregate cosignatures notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | TransactionFee | , |
model::TransactionFeeNotification | |||
) |
Validator that applies to all transaction fee notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | TransferMessage | , |
model::TransferMessageNotification | |||
) |
Validator that applies to transfer message notifications and validates that:
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | TransferMessage | , |
Notification | |||
) |
catapult::validators::DECLARE_STATELESS_VALIDATOR | ( | TransferMosaics | , |
model::TransferMosaicsNotification | |||
) |
Validator that applies to transfer mosaics notifications and validates that:
catapult::validators::DEFINE_ACCOUNT_LINK_RESULT | ( | Invalid_Action | , |
1 | |||
) |
Validation failed because account link action is invalid.
catapult::validators::DEFINE_ACCOUNT_LINK_RESULT | ( | Link_Already_Exists | , |
2 | |||
) |
Validation failed because main account is already linked to another account.
catapult::validators::DEFINE_ACCOUNT_LINK_RESULT | ( | Link_Does_Not_Exist | , |
3 | |||
) |
Validation failed because main account is not linked to another account.
catapult::validators::DEFINE_ACCOUNT_LINK_RESULT | ( | Remote_Account_Ineligible | , |
5 | |||
) |
Validation failed because link is attempting to convert ineligible account to remote.
catapult::validators::DEFINE_ACCOUNT_LINK_RESULT | ( | Remote_Account_Participant_Not_Allowed | , |
7 | |||
) |
Validation failed because remote is not allowed to participate in the transaction.
catapult::validators::DEFINE_ACCOUNT_LINK_RESULT | ( | Remote_Account_Signer_Not_Allowed | , |
6 | |||
) |
Validation failed because remote is not allowed to sign a transaction.
catapult::validators::DEFINE_ACCOUNT_LINK_RESULT | ( | Unlink_Data_Inconsistency | , |
4 | |||
) |
Validation failed because unlink data is not consistent with existing account link.
catapult::validators::DEFINE_ACCOUNT_RESTRICTION_MAX_VALUES_VALIDATOR | ( | MaxAccountAddressRestrictionValues | , |
model::ModifyAccountAddressRestrictionNotification | , | ||
UnresolvedAddress | |||
) |
catapult::validators::DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_TYPE_VALIDATOR | ( | AccountAddressRestrictionModificationTypes | , |
model::ModifyAccountAddressRestrictionNotification | , | ||
UnresolvedAddress | |||
) |
catapult::validators::DEFINE_ACCOUNT_RESTRICTION_MODIFICATION_VALIDATOR | ( | AccountAddressRestrictionValueModification | , |
model::ModifyAccountAddressRestrictionValueNotification | , | ||
Address | |||
) |
catapult::validators::DEFINE_ACCOUNT_RESTRICTION_REDUNDANT_MODIFICATION_VALIDATOR | ( | AccountAddressRestriction | , |
UnresolvedAddress | , | ||
utils::ArrayHasher< UnresolvedAddress > | |||
) |
catapult::validators::DEFINE_AGGREGATE_RESULT | ( | Ineligible_Cosigners | , |
5 | |||
) |
Validation failed because at least one cosigner is ineligible.
catapult::validators::DEFINE_AGGREGATE_RESULT | ( | Missing_Cosigners | , |
6 | |||
) |
Validation failed because at least one required cosigner is missing.
catapult::validators::DEFINE_AGGREGATE_RESULT | ( | No_Transactions | , |
2 | |||
) |
Validation failed because aggregate does not have any transactions.
catapult::validators::DEFINE_AGGREGATE_RESULT | ( | Redundant_Cosignatures | , |
4 | |||
) |
Validation failed because redundant cosignatures are present.
catapult::validators::DEFINE_AGGREGATE_RESULT | ( | Too_Many_Cosignatures | , |
3 | |||
) |
Validation failed because aggregate has too many cosignatures.
catapult::validators::DEFINE_AGGREGATE_RESULT | ( | Too_Many_Transactions | , |
1 | |||
) |
Validation failed because aggregate has too many transactions.
catapult::validators::DEFINE_CORE_RESULT | ( | Block_Harvester_Ineligible | , |
10 | |||
) |
Validation failed because a block was harvested by an ineligible harvester.
catapult::validators::DEFINE_CORE_RESULT | ( | Future_Deadline | , |
2 | |||
) |
Validation failed because the deadline is too far in the future.
catapult::validators::DEFINE_CORE_RESULT | ( | Insufficient_Balance | , |
3 | |||
) |
Validation failed because the account has an insufficient balance.
catapult::validators::DEFINE_CORE_RESULT | ( | Invalid_Address | , |
7 | |||
) |
Validation failed because an address is invalid.
catapult::validators::DEFINE_CORE_RESULT | ( | Invalid_Transaction_Fee | , |
9 | |||
) |
Validation failed because a transaction fee is invalid.
catapult::validators::DEFINE_CORE_RESULT | ( | Invalid_Version | , |
8 | |||
) |
Validation failed because entity version is invalid.
catapult::validators::DEFINE_CORE_RESULT | ( | Nemesis_Account_Signed_After_Nemesis_Block | , |
5 | |||
) |
Validation failed because an entity originated from the nemesis account after the nemesis block.
catapult::validators::DEFINE_CORE_RESULT | ( | Past_Deadline | , |
1 | |||
) |
Validation failed because the deadline passed.
catapult::validators::DEFINE_CORE_RESULT | ( | Too_Many_Transactions | , |
4 | |||
) |
Validation failed because there are too many transactions in a block.
catapult::validators::DEFINE_CORE_RESULT | ( | Wrong_Network | , |
6 | |||
) |
Validation failed because the entity has the wrong network specified.
catapult::validators::DEFINE_HASH_LOCK_RESULT | ( | Hash_Does_Not_Exist | , |
4 | |||
) |
Validation failed because hash is not present in cache.
catapult::validators::DEFINE_HASH_LOCK_RESULT | ( | Hash_Exists | , |
3 | |||
) |
Validation failed because hash is already present in cache.
catapult::validators::DEFINE_HASH_LOCK_RESULT | ( | Inactive_Hash | , |
5 | |||
) |
Validation failed because hash is inactive.
catapult::validators::DEFINE_HASH_LOCK_RESULT | ( | Invalid_Duration | , |
6 | |||
) |
Validation failed because duration is too long.
catapult::validators::DEFINE_HASH_LOCK_RESULT | ( | Invalid_Mosaic_Amount | , |
2 | |||
) |
Validation failed because lock does not allow the specified amount.
catapult::validators::DEFINE_HASH_LOCK_RESULT | ( | Invalid_Mosaic_Id | , |
1 | |||
) |
Validation failed because lock does not allow the specified mosaic.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Expired | , |
4 | |||
) |
Validation failed because the parent is expired.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Id_Mismatch | , |
6 | |||
) |
Validation failed because the id is not the expected id generated from signer and nonce.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Divisibility | , |
103 | |||
) |
Validation failed because the mosaic divisibility is invalid.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Duration | , |
1 | |||
) |
Validation failed because the duration has an invalid value.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Flags | , |
102 | |||
) |
Validation failed because the mosaic flags are invalid.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Id | , |
106 | |||
) |
Validation failed because the mosaic id is invalid.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Name | , |
2 | |||
) |
Validation failed because the name is invalid.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Property | , |
101 | |||
) |
Validation failed because a mosaic property is invalid.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Supply_Change_Amount | , |
105 | |||
) |
Validation failed because the mosaic supply change amount is invalid.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Invalid_Supply_Change_Direction | , |
104 | |||
) |
Validation failed because the mosaic supply change direction is invalid.
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.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Modification_Disallowed | , |
107 | |||
) |
Validation failed because mosaic modification is not allowed.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Modification_No_Changes | , |
108 | |||
) |
Validation failed because mosaic modification would not result in any changes.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Name_Id_Mismatch | , |
3 | |||
) |
Validation failed because the name and id don't match.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Non_Transferable | , |
112 | |||
) |
Validation failed because the mosaic is not transferable.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Owner_Conflict | , |
5 | |||
) |
Validation failed because the parent owner conflicts with the child owner.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Parent_Id_Conflict | , |
100 | |||
) |
Validation failed because the existing parent id does not match the supplied parent id.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Supply_Exceeded | , |
111 | |||
) |
Validation failed because the resulting mosaic supply exceeds the maximum allowed value.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Supply_Immutable | , |
109 | |||
) |
Validation failed because the mosaic supply is immutable.
catapult::validators::DEFINE_MOSAIC_RESULT | ( | Supply_Negative | , |
110 | |||
) |
Validation failed because the resulting mosaic supply is negative.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Account_In_Both_Sets | , |
1 | |||
) |
Validation failed because account is specified to be both added and removed.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Already_A_Cosigner | , |
6 | |||
) |
Validation failed because account to be added is already a cosignatory.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Loop | , |
12 | |||
) |
Validation failed because a multisig loop is created.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Max_Cosigned_Accounts | , |
10 | |||
) |
Validation failed because the cosignatory already cosigns the maximum number of accounts.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Max_Cosigners | , |
11 | |||
) |
Validation failed because the multisig account already has the maximum number of cosignatories.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Max_Multisig_Depth | , |
13 | |||
) |
Validation failed because the max multisig depth is exceeded.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Min_Setting_Larger_Than_Num_Cosignatories | , |
8 | |||
) |
Validation failed because min settings are larger than number of cosignatories.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Min_Setting_Out_Of_Range | , |
7 | |||
) |
Validation failed because new minimum settings are out of range.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Multiple_Deletes | , |
2 | |||
) |
Validation failed because multiple removals are present.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Not_A_Cosigner | , |
5 | |||
) |
Validation failed because account to be removed is not present.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Redundant_Modifications | , |
3 | |||
) |
Validation failed because redundant modifications are present.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Unknown_Multisig_Account | , |
4 | |||
) |
Validation failed because account is not in multisig cache.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Modify_Unsupported_Modification_Type | , |
9 | |||
) |
Validation failed because the modification type is unsupported.
catapult::validators::DEFINE_MULTISIG_RESULT | ( | Operation_Not_Permitted_By_Account | , |
14 | |||
) |
Validation failed because an operation is not permitted by a multisig account.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Already_Exists | , |
110 | |||
) |
Validation failed because namespace is already linked to an alias.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Does_Not_Exist | , |
111 | |||
) |
Validation failed because namespace is not linked to an alias.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Invalid_Action | , |
108 | |||
) |
Validation failed because alias action is invalid.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Invalid_Address | , |
115 | |||
) |
Validation failed because aliased address is invalid.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Namespace_Unknown | , |
109 | |||
) |
Validation failed because namespace does not exist.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Owner_Conflict | , |
112 | |||
) |
Validation failed because namespace has different owner.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Unlink_Data_Inconsistency | , |
114 | |||
) |
Validation failed because unlink data is not consistent with existing alias.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Alias_Unlink_Type_Inconsistency | , |
113 | |||
) |
Validation failed because unlink type is not consistent with existing alias.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Already_Active | , |
105 | |||
) |
Validation failed because the namespace is already active.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Already_Exists | , |
104 | |||
) |
Validation failed because the namespace already exists.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Eternal_After_Nemesis_Block | , |
106 | |||
) |
Validation failed because an eternal namespace was received after the nemesis block.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Expired | , |
4 | |||
) |
Validation failed because the parent is expired.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Id_Mismatch | , |
6 | |||
) |
Validation failed because the id is not the expected id generated from signer and nonce.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Invalid_Duration | , |
1 | |||
) |
Validation failed because the duration has an invalid value.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Invalid_Name | , |
2 | |||
) |
Validation failed because the name is invalid.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Invalid_Namespace_Type | , |
100 | |||
) |
Validation failed because the namespace type is invalid.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Max_Children_Exceeded | , |
107 | |||
) |
Validation failed because the maximum number of children for a root namespace was exceeded.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Name_Id_Mismatch | , |
3 | |||
) |
Validation failed because the name and id don't match.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Owner_Conflict | , |
5 | |||
) |
Validation failed because the parent owner conflicts with the child owner.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Parent_Unknown | , |
103 | |||
) |
Validation failed because the namespace parent is unknown.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Root_Name_Reserved | , |
101 | |||
) |
Validation failed because the root namespace has a reserved name.
catapult::validators::DEFINE_NAMESPACE_RESULT | ( | Too_Deep | , |
102 | |||
) |
Validation failed because the resulting namespace would exceed the maximum allowed namespace depth.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Invalid_Restriction_Type | , |
1 | |||
) |
Validation failed because the account restriction type is invalid.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Modification_Address_Invalid | , |
3 | |||
) |
Validation failed because a modification address is invalid.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Modification_Count_Exceeded | , |
8 | |||
) |
Validation failed because the transaction has too many modifications.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Modification_Not_Allowed | , |
7 | |||
) |
Validation failed because a value is not in the container.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Modification_Operation_Type_Incompatible | , |
4 | |||
) |
Validation failed because the operation type is incompatible.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Modification_Redundant | , |
6 | |||
) |
Validation failed because a modification is redundant.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Modification_Type_Invalid | , |
2 | |||
) |
Validation failed because a modification type is invalid.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Modify_Unsupported_Modification_Type | , |
5 | |||
) |
Validation failed because the modification type is unsupported.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Mosaic_Transfer_Not_Allowed | , |
12 | |||
) |
Validation failed because the mosaic transfer is prohibited by the recipient.
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.
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.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Value_Invalid | , |
10 | |||
) |
Validation failed because the account restriction value is invalid.
catapult::validators::DEFINE_RESTRICTION_ACCOUNT_RESULT | ( | Values_Count_Exceeded | , |
9 | |||
) |
Validation failed because the resulting account restriction has too many values.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Hash_Algorithm_Mismatch | , |
8 | |||
) |
Validation failed because hash algorithm does not match.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Hash_Exists | , |
2 | |||
) |
Validation failed because hash is already present in cache.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Hash_Not_Implemented | , |
3 | |||
) |
Validation failed because hash is not implemented yet.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Inactive_Secret | , |
7 | |||
) |
Validation failed because secret is inactive.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Invalid_Duration | , |
9 | |||
) |
Validation failed because duration is too long.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Invalid_Hash_Algorithm | , |
1 | |||
) |
Validation failed because hash algorithm for lock type secret is invalid.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Proof_Size_Out_Of_Bounds | , |
4 | |||
) |
Validation failed because proof is too small or too large.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Secret_Mismatch | , |
5 | |||
) |
Validation failed because secret does not match proof.
catapult::validators::DEFINE_SECRET_LOCK_RESULT | ( | Unknown_Composite_Key | , |
6 | |||
) |
Validation failed because composite key is unknown.
catapult::validators::DEFINE_SIGNATURE_RESULT | ( | Not_Verifiable | , |
1 | |||
) |
Validation failed because the verification of the signature failed.
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | AccountLinkAvailability | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | AccountOperationRestrictionNoSelfBlocking | , |
[] (const auto ¬ification, const ValidatorContext &context) { return Validate(notification, context) ? ValidationResult::Success :Failure_RestrictionAccount_Modification_Not_Allowed;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | AddressInteraction | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | AliasAvailability | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | ChildNamespaceAvailability | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | EligibleHarvester | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | ModifyMultisigInvalidCosigners | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | ModifyMultisigInvalidSettings | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | MosaicAvailability | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | MosaicRecipient | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | MultisigAggregateEligibleCosigners | , |
[] (const auto ¬ification, const ValidatorContext &context) { AggregateCosignaturesChecker checker(notification, context.Cache.sub< cache::MultisigCache >());return checker.hasIneligibleCosigners() ? Failure_Aggregate_Ineligible_Cosigners :ValidationResult::Success;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | MultisigAggregateSufficientCosigners | , |
[] (const auto ¬ification, const ValidatorContext &context) { AggregateCosignaturesChecker checker(notification, context.Cache.sub< cache::MultisigCache >());return checker.hasSufficientCosigners() ? ValidationResult::Success :Failure_Aggregate_Missing_Cosigners;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | MultisigPermittedOperation | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | NemesisSink | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | NewRemoteAccountAvailability | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | ProperMosaic | , |
[] (const auto ¬ification, 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);} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | RemoteInteraction | , |
([](const auto ¬ification, 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;}) | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | RemoteSender | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | RootNamespaceAvailability | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | Transaction | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATEFUL_VALIDATOR | ( | UniqueTransactionHash | , |
[] (const auto ¬ification, 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;} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | AccountLinkAction | , |
[] (const auto ¬ification) { return ValidateLessThanOrEqual(notification.LinkAction, model::AccountLinkAction::Unlink, Failure_AccountLink_Invalid_Action);} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | AccountOperationRestrictionModificationValues | , |
[] (const auto ¬ification) { return AreAllAccountRestrictionValuesValid(notification.ModificationsPtr, notification.ModificationsCount) ? ValidationResult::Success :Failure_RestrictionAccount_Value_Invalid;} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | AccountRestrictionType | , |
[] (const auto ¬ification) { return IsValidAccountRestrictionType(notification.AccountRestrictionType) ? ValidationResult::Success :Failure_RestrictionAccount_Invalid_Restriction_Type;} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | AliasAction | , |
[] (const auto ¬ification) { return ValidateLessThanOrEqual(notification.AliasAction, model::AliasAction::Unlink, Failure_Namespace_Alias_Invalid_Action);} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | ModifyMultisigCosigners | , |
[] (const auto ¬ification) { 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;} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | MosaicSupplyChange | , |
[] (const auto ¬ification) { if(!IsValidDirection(notification.Direction)) return Failure_Mosaic_Invalid_Supply_Change_Direction;return Amount()==notification.Delta ? Failure_Mosaic_Invalid_Supply_Change_Amount :ValidationResult::Success;} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | NamespaceType | , |
[] (const auto ¬ification) { return ValidateLessThanOrEqual(notification.NamespaceType, model::NamespaceType::Child, Failure_Namespace_Invalid_Namespace_Type);} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | SecretLockHashAlgorithm | , |
[] (const auto ¬ification) { return ValidateLessThanOrEqual(notification.HashAlgorithm, model::LockHashAlgorithm::Op_Hash_256, Failure_LockSecret_Invalid_Hash_Algorithm);} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | StrictAggregateCosignatures | , |
[] (const auto ¬ification) { utils::ArrayPointerFlagMap< Key > cosigners;cosigners.emplace(¬ification.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;} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | TransactionFee | , |
[] (const auto ¬ification) { 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;} | |||
) |
catapult::validators::DEFINE_STATELESS_VALIDATOR | ( | TransferMosaics | , |
[] (const auto ¬ification) { 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;} | |||
) |
catapult::validators::DEFINE_TRANSFER_RESULT | ( | Message_Too_Large | , |
1 | |||
) |
Validation failed because the message is too large.
catapult::validators::DEFINE_TRANSFER_RESULT | ( | Out_Of_Order_Mosaics | , |
2 | |||
) |
Validation failed because mosaics are out of order.
catapult::validators::DEFINE_VALIDATION_RESULT | ( | Failure | , |
Hash | , | ||
Exists | , | ||
1 | , | ||
Verbose | |||
) |
Validation failed because the entity hash is already known.
|
constexpr |
Extracts the encoded result severity from result.
|
constexpr |
Checks if result has all flags set.
|
constexpr |
Returns a value indicating whether the validation result is a failure.
|
constexpr |
Returns a value indicating whether the validation result is a success.
|
constexpr |
Makes a validation result given severity, facility, code and flags.
|
constexpr |
Maps validation result to an appropriate logging level.
std::ostream & catapult::validators::operator<< | ( | std::ostream & | out, |
ValidationResult | result | ||
) |
Insertion operator for outputting result to out.
|
constexpr |
Validates that value is less than or equal to maxValue and returns failureResult on failure.
Amount catapult::validators::lockedFundsPerAggregate |
for (const auto& name : reservedRootNamespaceNames) reservedRootIds.emplace(model return catapult::validators::MAKE_STATELESS_VALIDATOR(NamespaceName,([maxNameSize, reservedRootIds](const auto ¬ification) { 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; })) |
uint8_t catapult::validators::maxCosignatures |
BlockDuration catapult::validators::maxMosaicDuration |
uint16_t catapult::validators::maxProofSize |
const std::unordered_set< std::string > & catapult::validators::reservedRootNamespaceNames |
catapult::validators::UnresolvedMosaicId |