CatapultServer  v0.5.0.1 (Elephant)
PruningBoundary.h
Go to the documentation of this file.
1 
21 #pragma once
22 
23 namespace catapult { namespace deltaset {
24 
26  template<typename T>
28  public:
30  constexpr PruningBoundary() : m_isSet(false), m_value()
31  {}
32 
34  constexpr PruningBoundary(const T& value) : m_isSet(true), m_value(value)
35  {}
36 
37  public:
39  constexpr bool isSet() const {
40  return m_isSet;
41  }
42 
44  constexpr const T& value() const {
45  return m_value;
46  }
47 
48  private:
49  bool m_isSet;
51  };
52 }}
catapult::validators::DEFINE_STATEFUL_VALIDATOR
DEFINE_STATEFUL_VALIDATOR(EligibleHarvester, [](const auto &notification, const auto &context) { cache::ImportanceView view(context.Cache.template sub< cache::AccountStateCache >());return view.canHarvest(notification.Signer, context.Height) ? ValidationResult::Success :Failure_Core_Block_Harvester_Ineligible;})
catapult::deltaset::PruningBoundary::value
constexpr const T & value() const
Returns the pruning boundary value.
Definition: PruningBoundary.h:44
ValidatorContext.h
LockStatusAccountBalanceObserver.h
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
catapult::observers::DEFINE_OBSERVER
DEFINE_OBSERVER(AccountAddress, model::AccountAddressNotification, [](const auto &notification, const auto &context) { DefaultAccountVisitor visitor(context);visitor.visit(notification.Address);})
ValidatorUtils.h
Observers.h
catapult::validators::ActiveMosaicView::FindIterator
cache::MosaicCacheTypes::CacheReadOnlyType::ReadOnlyFindIterator< cache::MosaicCacheView::const_iterator, cache::MosaicCacheDelta::const_iterator > FindIterator
Iterator type returned by tryGet.
Definition: ActiveMosaicView.h:44
catapult::deltaset::PruningBoundary::m_isSet
bool m_isSet
Definition: PruningBoundary.h:49
LockHashUtils.h
catapult::observers::Notification
model::TransactionNotification Notification
Definition: CompletedAggregateObserver.cpp:29
SecretLockReceiptType.h
catapult::validators::ValidateLessThanOrEqual
constexpr ValidationResult ValidateLessThanOrEqual(TValue value, TValue maxValue, ValidationResult failureResult)
Validates that value is less than or equal to maxValue and returns failureResult on failure.
Definition: ValidatorUtils.h:28
catapult::deltaset::PruningBoundary::PruningBoundary
constexpr PruningBoundary(const T &value)
Creates a pruning boundary around value.
Definition: PruningBoundary.h:34
catapult::validators::MAKE_STATELESS_VALIDATOR
for(const auto &name :reservedRootNamespaceNames) reservedRootIds.emplace(model return MAKE_STATELESS_VALIDATOR(NamespaceName,([maxNameSize, reservedRootIds](const auto &notification) { if(maxNameSize< notification.NameSize||!model::IsValidName(notification.NamePtr, notification.NameSize)) return Failure_Namespace_Invalid_Name;auto name=utils::RawString(reinterpret_cast< const char * >(notification.NamePtr), notification.NameSize);if(notification.NamespaceId !=model::GenerateNamespaceId(notification.ParentId, name)) return Failure_Namespace_Name_Id_Mismatch;auto namespaceId=Namespace_Base_Id==notification.ParentId ? notification.NamespaceId :notification.ParentId;if(reservedRootIds.cend() !=reservedRootIds.find(namespaceId)) return Failure_Namespace_Root_Name_Reserved;return ValidationResult::Success;}))
Definition: NamespaceNameValidator.cpp:36
catapult::validators::maxProofSize
uint16_t maxProofSize
Definition: ProofSecretValidator.cpp:38
catapult::model::CalculateSecretLockInfoHash
Hash256 CalculateSecretLockInfoHash(const Hash256 &secret, const Address &recipient)
Calculates the secret lock info hash from secret and recipient.
Definition: LockHashUtils.cpp:64
catapult::deltaset::PruningBoundary::m_value
T m_value
Definition: PruningBoundary.h:50
catapult::model::CalculateHash
Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer &data)
Calculates hashAlgorithm hash of data.
Definition: LockHashUtils.cpp:46
catapult::deltaset::PruningBoundary::isSet
constexpr bool isSet() const
Returns true if the pruning boundary value is set.
Definition: PruningBoundary.h:39
catapult::deltaset::PruningBoundary::PruningBoundary
constexpr PruningBoundary()
Creates a null pruning boundary.
Definition: PruningBoundary.h:30
Receipt_Type
static constexpr auto Receipt_Type
Definition: ProofObserver.cpp:35
catapult::model::LockHashAlgorithm::Op_Hash_256
Input is hashed twice with SHA-256.
catapult::validators::ResultSeverity::Failure
Validation result is failure.
catapult::validators::ValidationResult::Success
Validation succeeded.
catapult::validators::DECLARE_STATELESS_VALIDATOR
DECLARE_STATELESS_VALIDATOR(MaxTransactions, Notification)(uint32_t maxTransactions)
Definition: MaxTransactionsValidator.cpp:27
catapult::deltaset::PruningBoundary
Represents an optional pruning boundary.
Definition: PruningBoundary.h:27
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::AccountAddressNotification
Notification of use of an account address.
Definition: Notifications.h:57
ActiveMosaicView.h
Validators.h
catapult::model::LockHashAlgorithm
LockHashAlgorithm
Lock secret hash algorithm.
Definition: LockHashAlgorithm.h:27
SecretLockInfoCache.h
Validators.h