CatapultServer  v0.5.0.1 (Elephant)
Elements.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Block.h"
23 #include "BlockStatement.h"
24 #include "ContainerTypes.h"
25 #include "EntityInfo.h"
26 #include "WeakEntityInfo.h"
27 #include "catapult/functions.h"
28 #include <unordered_set>
29 
30 namespace catapult { namespace model {
31 
34  public:
36  explicit TransactionElement(const model::Transaction& transaction) : Transaction(transaction)
37  {}
38 
39  public:
42 
45 
48 
51  std::shared_ptr<const UnresolvedAddressSet> OptionalExtractedAddresses;
52  };
53 
55  struct BlockElement {
56  public:
58  explicit BlockElement(const model::Block& block) : Block(block)
59  {}
60 
61  public:
64 
67 
70 
72  std::vector<Hash256> SubCacheMerkleRoots;
73 
75  std::vector<TransactionElement> Transactions;
76 
79  std::shared_ptr<const BlockStatement> OptionalStatement;
80  };
81 
84 
87  const std::vector<BlockElement>& elements,
88  WeakEntityInfos& entityInfos,
90 
92  void ExtractEntityInfos(const BlockElement& element, WeakEntityInfos& entityInfos);
93 
96  void ExtractTransactionInfos(std::vector<TransactionInfo>& transactionInfos, const std::shared_ptr<const BlockElement>& pBlockElement);
97 
100  const std::shared_ptr<const Transaction>& pTransaction,
101  const TransactionElement& transactionElement);
102 }}
Block.h
catapult::model::MakeTransactionInfo
TransactionInfo MakeTransactionInfo(const std::shared_ptr< const Transaction > &pTransaction, const TransactionElement &transactionElement)
Makes a transaction info by merging pTransaction and transactionElement.
Definition: Elements.cpp:103
catapult::predicate
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
catapult::model::BlockElement::EntityHash
Hash256 EntityHash
Entity hash.
Definition: Elements.h:66
WeakEntityInfo.h
catapult::model::BlockElement::Block
const model::Block & Block
Block entity.
Definition: Elements.h:63
functions.h
catapult::model::ExtractEntityInfos
void ExtractEntityInfos(const BlockElement &element, WeakEntityInfos &entityInfos)
Extracts all entity infos from element into entityInfos.
Definition: Elements.cpp:88
catapult::model::TransactionInfo::MerkleComponentHash
Hash256 MerkleComponentHash
Modified hash that should be used as a hash in the merkle tree.
Definition: EntityInfo.h:131
catapult::model::ToBasicEntityType
constexpr BasicEntityType ToBasicEntityType(EntityType type)
Converts an entity type into a basic entity type.
Definition: EntityType.h:70
catapult::model::BlockElement::GenerationHash
catapult::GenerationHash GenerationHash
Generation hash of the block.
Definition: Elements.h:69
catapult::model::TransactionElement::Transaction
const model::Transaction & Transaction
Transaction entity.
Definition: Elements.h:41
catapult::model::TransactionElement::OptionalExtractedAddresses
std::shared_ptr< const UnresolvedAddressSet > OptionalExtractedAddresses
Definition: Elements.h:51
catapult::model::BlockElement::SubCacheMerkleRoots
std::vector< Hash256 > SubCacheMerkleRoots
Merkle roots for all sub caches at the current block.
Definition: Elements.h:72
catapult::model::TransactionInfo
A transaction and its associated metadata.
Definition: EntityInfo.h:104
Elements.h
catapult::model::BlockElement::Transactions
std::vector< TransactionElement > Transactions
Transaction elements.
Definition: Elements.h:75
catapult::model::BlockElement::BlockElement
BlockElement(const model::Block &block)
Creates a block element around block.
Definition: Elements.h:58
catapult::model::ExtractTransactionInfos
void ExtractTransactionInfos(std::vector< TransactionInfo > &transactionInfos, const std::shared_ptr< const BlockElement > &pBlockElement)
Definition: Elements.cpp:93
catapult::model::MatchingEntityPredicate
predicate< BasicEntityType, Timestamp, const Hash256 & > MatchingEntityPredicate
Predicate for evaluating a timestamp, a hash and an entity type.
Definition: Elements.h:83
catapult::model::ExtractMatchingEntityInfos
void ExtractMatchingEntityInfos(const std::vector< BlockElement > &elements, WeakEntityInfos &entityInfos, const MatchingEntityPredicate &predicate)
Extracts all entity infos for which predicate returns true from elements into entityInfos.
Definition: Elements.cpp:79
m_pActiveBlockHeader
const BlockHeader * m_pActiveBlockHeader
Definition: Elements.cpp:66
catapult::model::TransactionElement::EntityHash
Hash256 EntityHash
Entity hash.
Definition: Elements.h:44
catapult::model::DetachedTransactionInfo::OptionalExtractedAddresses
std::shared_ptr< const UnresolvedAddressSet > OptionalExtractedAddresses
Extracted addresses (optional).
Definition: EntityInfo.h:100
catapult::model::TransactionElement::MerkleComponentHash
Hash256 MerkleComponentHash
Modified hash that should be used as a hash in the merkle tree.
Definition: Elements.h:47
m_entityInfos
WeakEntityInfos & m_entityInfos
Definition: Elements.cpp:64
BlockStatement.h
EntityInfo.h
catapult::model::WeakEntityInfo
WeakEntityInfoT< VerifiableEntity > WeakEntityInfo
Definition: WeakEntityInfo.h:128
catapult::model::TransactionElement
Processing element for a transaction composed of a transaction and metadata.
Definition: Elements.h:33
catapult::model::BlockElement
Processing element for a block composed of a block and metadata.
Definition: Elements.h:55
catapult::model::Block
Binary layout for a block.
Definition: Block.h:69
ContainerTypes.h
catapult::Timestamp
utils::BaseValue< uint64_t, Timestamp_tag > Timestamp
Definition: src/catapult/types.h:73
catapult
Definition: AddressExtractionExtension.cpp:28
m_predicate
MatchingEntityPredicate m_predicate
Definition: Elements.cpp:65
catapult::utils::ByteArray< Hash256_Size, Hash256_tag >
catapult::model::TransactionElement::TransactionElement
TransactionElement(const model::Transaction &transaction)
Creates a transaction element around transaction.
Definition: Elements.h:36
catapult::model::WeakEntityInfos
std::vector< WeakEntityInfo > WeakEntityInfos
A container of weak entity infos.
Definition: WeakEntityInfo.h:144
catapult::model::Transaction
Binary layout for a transaction.
Definition: Transaction.h:32
catapult::model::BlockElement::OptionalStatement
std::shared_ptr< const BlockStatement > OptionalStatement
Definition: Elements.h:79