CatapultServer  v0.5.0.1 (Elephant)
Block.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Transaction.h"
23 #include "TransactionContainer.h"
24 #include "VerifiableEntity.h"
25 #include "catapult/types.h"
26 #include <memory>
27 #include <vector>
28 
29 namespace catapult { namespace model {
30 
31 #pragma pack(push, 1)
32 
34  struct BlockHeader : public VerifiableEntity {
35  public:
37  static constexpr int Current_Version = 3;
38 
39  public:
42 
45 
48 
51 
54 
57 
60 
63 
66  };
67 
69  struct Block : public TransactionContainer<BlockHeader, Transaction> {};
70 
71 #pragma pack(pop)
72 
74  size_t GetTransactionPayloadSize(const BlockHeader& header);
75 
78  bool IsSizeValid(const Block& block, const TransactionRegistry& registry);
79 }}
catapult::model::TransactionContainer::Transactions
auto Transactions(EntityContainerErrorPolicy errorPolicy=EntityContainerErrorPolicy::Throw)
Definition: TransactionContainer.h:37
Block.h
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
Transaction.h
catapult::model::BlockHeader::BlockReceiptsHash
Hash256 BlockReceiptsHash
Aggregate hash of a block's receipts.
Definition: Block.h:59
catapult::model::BlockHeader::Beneficiary
Key Beneficiary
Public key of optional beneficiary designated by harvester.
Definition: Block.h:65
catapult::model::BlockHeader::Current_Version
static constexpr int Current_Version
Block format version.
Definition: Block.h:37
colorPrint.warning
def warning(*args)
Definition: colorPrint.py:10
catapult::model::BlockHeader::Difficulty
catapult::Difficulty Difficulty
Difficulty of a block.
Definition: Block.h:47
catapult::model::BlockHeader::PreviousBlockHash
Hash256 PreviousBlockHash
Hash of the previous block.
Definition: Block.h:53
catapult::model::BlockHeader
Binary layout for a block header.
Definition: Block.h:34
catapult::model::BlockHeader::BlockTransactionsHash
Hash256 BlockTransactionsHash
Aggregate hash of a block's transactions.
Definition: Block.h:56
catapult::model::GetTransactionPayloadSize
size_t GetTransactionPayloadSize(const AggregateTransactionHeader &header)
Gets the number of bytes containing transaction data according to header.
Definition: AggregateTransaction.cpp:25
TransactionContainer.h
catapult::utils::BaseValue< uint64_t, Height_tag >
VerifiableEntity.h
catapult::model::BlockHeader::Height
catapult::Height Height
Height of a block.
Definition: Block.h:41
catapult::model::VerifiableEntity
Binary layout for a verifiable (with signature) entity.
Definition: VerifiableEntity.h:45
catapult::model::BlockHeader::FeeMultiplier
BlockFeeMultiplier FeeMultiplier
Fee multiplier applied to transactions contained in block.
Definition: Block.h:50
catapult::model::IsSizeValid
bool IsSizeValid(const AggregateTransaction &aggregate, const TransactionRegistry &registry)
Definition: AggregateTransaction.cpp:38
catapult::model::Block
Binary layout for a block.
Definition: Block.h:69
catapult::model::TransactionContainer
Definition: TransactionContainer.h:34
catapult::model::BlockHeader::Timestamp
catapult::Timestamp Timestamp
Timestamp of a block.
Definition: Block.h:44
types.h
catapult::model::EntityContainerErrorPolicy::Suppress
Do not throw when an iteration error is encountered (but error flag will still be set).
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::utils::ClampedBaseValue< uint64_t, Difficulty_tag >
catapult::model::BlockHeader::StateHash
Hash256 StateHash
Hash of the global chain state at this block.
Definition: Block.h:62
catapult::model::TransactionRegistry
A registry of transaction plugins.
Definition: TransactionPlugin.h:98
catapult::utils::ByteArray< Hash256_Size, Hash256_tag >
catapult::model::SizePrefixedEntity::Size
uint32_t Size
Entity size.
Definition: SizePrefixedEntity.h:33
catapult::model::EntityBody::Type
EntityType Type
Entity type.
Definition: EntityBody.h:42