CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 namespace catapult {
namespace extensions {
31 using Blocks = std::map<Height, std::shared_ptr<model::Block>>;
32 using BlockElements = std::map<Height, std::shared_ptr<model::BlockElement>>;
33 using BlockStatements = std::map<Height, std::shared_ptr<const model::BlockStatement>>;
47 std::shared_ptr<const model::Block>
loadBlock(
Height height)
const override;
52 void purge()
override;
void dropBlocksAfter(Height height) override
Drops all blocks after height.
Definition: MemoryBlockStorage.cpp:111
std::vector< uint8_t > & m_buffer
Definition: MemoryBlockStorage.cpp:161
Notification validator that wraps a function.
Definition: FunctionalNotificationValidator.h:29
utils::ByteArray< Address_Decoded_Size, UnresolvedAddress_tag > UnresolvedAddress
Definition: src/catapult/types.h:66
size_t NumAdds
Definition: MaxAccountRestrictionValuesValidator.cpp:30
std::shared_ptr< const model::BlockElement > loadBlockElement(Height height) const override
Returns the block element (owning a block) at height.
Definition: MemoryBlockStorage.cpp:137
Blocks m_blocks
Definition: MemoryBlockStorage.h:58
utils::BaseValue< uint64_t, Amount_tag > Amount
Definition: src/catapult/types.h:76
void requireHeight(Height height, const char *description) const
Definition: MemoryBlockStorage.cpp:192
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
DEFINE_ACCOUNT_RESTRICTION_MAX_VALUES_VALIDATOR(MaxAccountAddressRestrictionValues, model::ModifyAccountAddressRestrictionNotification, UnresolvedAddress) DEFINE_ACCOUNT_RESTRICTION_MAX_VALUES_VALIDATOR(MaxAccountMosaicRestrictionValues
ValidationResult
Enumeration of all possible validation results.
Definition: ValidationResult.h:51
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
EntityType
Enumeration of entity types.
Definition: EntityType.h:43
#define CATAPULT_THROW_FILE_IO_ERROR(MESSAGE)
Macro used to throw a catapult file io error.
Definition: exceptions.h:195
const model::Block & Block
Block entity.
Definition: Elements.h:63
BlockStatements m_blockStatements
Definition: MemoryBlockStorage.h:60
BlockElements m_blockElements
Definition: MemoryBlockStorage.h:59
ModifyAccountRestrictionNotification< EntityType, RestrictionAccount_Operation_Modifications_Notification > ModifyAccountOperationRestrictionNotification
Definition: AccountRestrictionNotifications.h:168
Interface that allows saving, loading and pruning blocks.
Definition: BlockStorage.h:63
std::pair< std::vector< uint8_t >, bool > loadBlockStatementData(Height height) const override
Returns the optional block statement data at height.
Definition: MemoryBlockStorage.cpp:165
Represents a range of entities.
Definition: EntityRange.h:31
A memory-based block storage that loads and saves blocks in memory.
Definition: MemoryBlockStorage.h:29
Notifies a balance transfer from sender to recipient.
Definition: Notifications.h:120
DECLARE_STATEFUL_VALIDATOR(Address, Notification)(model
Definition: AddressValidator.cpp:29
Notification of a mosaic supply change.
Definition: MosaicNotifications.h:143
void WriteBlockStatement(const model::BlockStatement &blockStatement, OutputStream &outputStream)
Writes blockStatement into outputStream.
Definition: BlockStatementSerializer.cpp:65
ModifyAccountRestrictionNotification< UnresolvedMosaicId, RestrictionAccount_Mosaic_Modifications_Notification > ModifyAccountMosaicRestrictionNotification
Definition: AccountRestrictionNotifications.h:165
void saveBlock(const model::BlockElement &blockElement) override
Saves blockElement.
Definition: MemoryBlockStorage.cpp:93
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;}))
Definition: NamespaceNameValidator.cpp:36
static EntityRange PrepareFixed(size_t numElements, uint8_t **ppRangeData=nullptr)
Definition: EntityRange.h:265
Hash256 EntityHash
Entity hash.
Definition: Elements.h:44
std::map< Height, std::shared_ptr< const model::BlockStatement > > BlockStatements
Definition: MemoryBlockStorage.h:33
MemoryBlockStorage(const model::BlockElement &nemesisBlockElement)
Creates a memory-based block storage around nemesisBlockElement.
Definition: MemoryBlockStorage.cpp:30
Hash256 MerkleComponentHash
Modified hash that should be used as a hash in the merkle tree.
Definition: Elements.h:47
ModifyAccountRestrictionNotification< UnresolvedAddress, RestrictionAccount_Address_Modifications_Notification > ModifyAccountAddressRestrictionNotification
Definition: AccountRestrictionNotifications.h:162
size_t NumDeletes
Definition: MaxAccountRestrictionValuesValidator.cpp:31
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
EntityRange< Hash256 > HashRange
An entity range composed of hashes.
Definition: RangeTypes.h:35
Processing element for a transaction composed of a transaction and metadata.
Definition: Elements.h:33
Processing element for a block composed of a block and metadata.
Definition: Elements.h:55
Binary layout for a block.
Definition: Block.h:69
DECLARE_STATELESS_VALIDATOR(MaxTransactions, Notification)(uint32_t maxTransactions)
Definition: MaxTransactionsValidator.cpp:27
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
Height chainHeight() const override
Gets the number of blocks.
Definition: MemoryBlockStorage.cpp:38
Definition: AddressExtractionExtension.cpp:28
Notification of use of an account address.
Definition: Notifications.h:57
Height m_height
Definition: MemoryBlockStorage.h:61
std::map< Height, std::shared_ptr< model::BlockElement > > BlockElements
Definition: MemoryBlockStorage.h:32
void DeepCopyTo(BlockStatement &destination, const BlockStatement &source)
Creates a deep copy of source into destination.
Definition: BlockStatement.cpp:101
std::shared_ptr< const model::Block > loadBlock(Height height) const override
Returns the block at height.
Definition: MemoryBlockStorage.cpp:128
model::HashRange loadHashesFrom(Height height, size_t maxHashes) const override
Returns a range of at most maxHashes hashes starting at height.
Definition: MemoryBlockStorage.cpp:42
Writer interface.
Definition: Stream.h:41
std::map< Height, std::shared_ptr< model::Block > > Blocks
Definition: MemoryBlockStorage.h:31
void purge() override
Purges all blocks from storage.
Definition: MemoryBlockStorage.cpp:181
uint32_t Size
Entity size.
Definition: SizePrefixedEntity.h:33
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
UnresolvedMosaicId
Definition: AccountRestrictionRedundantModificationValidator.cpp:78