CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace subscribers {
28 template<
typename TBlockChangeSubscriber = io::BlockChangeSubscriber>
35 this->
forEach([&blockElement](
auto& subscriber) { subscriber.notifyBlock(blockElement); });
39 this->
forEach([height](
auto& subscriber) { subscriber.notifyDropBlocksAfter(height); });
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;})
ReadOnlyArtifactCache< BasicAccountRestrictionCacheView, BasicAccountRestrictionCacheDelta, const Address &, state::AccountRestrictions > CacheReadOnlyType
Definition: AccountRestrictionCacheTypes.h:79
bool IsValidAddress(const Address &address, NetworkIdentifier networkIdentifier)
Returns a value indicating whether or not the given address is valid for the network identified by ne...
Definition: Address.cpp:70
A view on top of a catapult cache cache for retrieving a typed account restriction.
Definition: AccountRestrictionView.h:31
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
#define MAKE_STATEFUL_VALIDATOR(NAME, HANDLER)
Definition: ValidatorTypes.h:123
void notifyDropBlocksAfter(Height height) override
Indicates all blocks after height were invalidated.
Definition: AggregateBlockChangeSubscriber.h:38
DECLARE_STATEFUL_VALIDATOR(Address, Notification)(model
Definition: AddressValidator.cpp:29
Block change subscriber.
Definition: BlockChangeSubscriber.h:27
bool initialize(const Address &address)
Tries to initialize the internal iterator for account restriction with address.
Definition: AccountRestrictionView.cpp:30
typename cache::AccountRestrictionCacheTypes::CacheReadOnlyType CacheReadOnlyType
Definition: AddressInteractionValidator.cpp:30
void forEach(TAction action) const
Definition: BasicAggregateSubscriber.h:38
Address PublicKeyToAddress(const Key &publicKey, NetworkIdentifier networkIdentifier)
Creates an address from a public key (publicKey) for the network identified by networkIdentifier.
Definition: Address.cpp:50
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
Basic aggregate subscriber.
Definition: BasicAggregateSubscriber.h:29
Aggregate block change subscriber.
Definition: AggregateBlockChangeSubscriber.h:29
Processing element for a block composed of a block and metadata.
Definition: Elements.h:55
bool isAllowed(model::AccountRestrictionType restrictionType, const TRestrictionValue &value)
Returns true if value is allowed.
Definition: AccountRestrictionView.h:50
void notifyBlock(const model::BlockElement &blockElement) override
Indicates blockElement was saved.
Definition: AggregateBlockChangeSubscriber.h:34
Definition: AddressExtractionExtension.cpp:28
Notification of use of an account address.
Definition: Notifications.h:57
Account restriction type is an address.
A read-only overlay on top of a catapult cache.
Definition: ReadOnlyCatapultCache.h:27