CatapultServer  v0.5.0.1 (Elephant)
catapult::extensions::BlockExtensions Class Reference

Extensions for working with blocks. More...

Collaboration diagram for catapult::extensions::BlockExtensions:

Public Member Functions

 BlockExtensions (const GenerationHash &generationHash)
 
 BlockExtensions (const GenerationHash &generationHash, const model::TransactionRegistry &transactionRegistry)
 
void updateBlockTransactionsHash (model::Block &block) const
 
void calculateBlockTransactionsHash (const model::Block &block, Hash256 &blockTransactionsHash) const
 
void signFullBlock (const crypto::KeyPair &signer, model::Block &block) const
 Cryptographically signs a full block with signer. More...
 
VerifyFullBlockResult verifyFullBlock (const model::Block &block) const
 Cryptographically verifies a full block by checking all signatures and hashes. More...
 
model::BlockElement convertBlockToBlockElement (const model::Block &block, const GenerationHash &generationHash) const
 

Private Attributes

GenerationHash m_generationHash
 
std::function< Hash256(const model::Transaction &)> m_calculateTransactionEntityHash
 
std::function< Hash256(const model::Transaction &, const Hash256 &)> m_calculateTransactionMerkleComponentHash
 

Detailed Description

Extensions for working with blocks.

Constructor & Destructor Documentation

◆ BlockExtensions() [1/2]

catapult::extensions::BlockExtensions::BlockExtensions ( const GenerationHash generationHash)
explicit

Creates extensions for blocks containing only basic transactions for the network with the specified generation hash (generationHash).

Here is the call graph for this function:

◆ BlockExtensions() [2/2]

catapult::extensions::BlockExtensions::BlockExtensions ( const GenerationHash generationHash,
const model::TransactionRegistry transactionRegistry 
)

Creates extensions for blocks containing transactions registered in transactionRegistry for the network with the specified generation hash (generationHash).

Here is the call graph for this function:

Member Function Documentation

◆ calculateBlockTransactionsHash()

void catapult::extensions::BlockExtensions::calculateBlockTransactionsHash ( const model::Block block,
Hash256 blockTransactionsHash 
) const

Calculates the block transactions hash of block into blockTransactionsHash.

Note
This function requires a full block and will calculate all transaction hashes.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertBlockToBlockElement()

model::BlockElement catapult::extensions::BlockExtensions::convertBlockToBlockElement ( const model::Block block,
const GenerationHash generationHash 
) const

Converts block to a block element with the specified block generation hash (generationHash).

Note
This function requires a full block and will calculate all block and transaction hashes.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ signFullBlock()

void catapult::extensions::BlockExtensions::signFullBlock ( const crypto::KeyPair signer,
model::Block block 
) const

Cryptographically signs a full block with signer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateBlockTransactionsHash()

void catapult::extensions::BlockExtensions::updateBlockTransactionsHash ( model::Block block) const

Calculates and updates the block transactions hash of block.

Note
This function requires a full block and will calculate all transaction hashes.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ verifyFullBlock()

VerifyFullBlockResult catapult::extensions::BlockExtensions::verifyFullBlock ( const model::Block block) const

Cryptographically verifies a full block by checking all signatures and hashes.

Here is the call graph for this function:

Member Data Documentation

◆ m_calculateTransactionEntityHash

std::function<Hash256 (const model::Transaction&)> catapult::extensions::BlockExtensions::m_calculateTransactionEntityHash
private

◆ m_calculateTransactionMerkleComponentHash

std::function<Hash256 (const model::Transaction&, const Hash256&)> catapult::extensions::BlockExtensions::m_calculateTransactionMerkleComponentHash
private

◆ m_generationHash

GenerationHash catapult::extensions::BlockExtensions::m_generationHash
private

The documentation for this class was generated from the following files: