CatapultServer  v0.5.0.1 (Elephant)
catapult::builders::HashLockBuilder Class Reference

Builder for a hash lock transaction. More...

Inheritance diagram for catapult::builders::HashLockBuilder:
Collaboration diagram for catapult::builders::HashLockBuilder:

Public Types

using Transaction = model::HashLockTransaction
 
using EmbeddedTransaction = model::EmbeddedHashLockTransaction
 

Public Member Functions

 HashLockBuilder (model::NetworkIdentifier networkIdentifier, const Key &signer)
 
void setMosaic (const model::UnresolvedMosaic &mosaic)
 Sets the lock mosaic to mosaic. More...
 
void setDuration (BlockDuration duration)
 Sets the number of blocks for which a lock should be valid to duration. More...
 
void setHash (const Hash256 &hash)
 Sets the lock hash to hash. More...
 
size_t size () const
 
std::unique_ptr< Transactionbuild () const
 Builds a new hash lock transaction. More...
 
std::unique_ptr< EmbeddedTransactionbuildEmbedded () const
 Builds a new embedded hash lock transaction. More...
 
- Public Member Functions inherited from catapult::builders::TransactionBuilder
 TransactionBuilder (model::NetworkIdentifier networkIdentifier, const Key &signer)
 Creates a transaction builder with networkIdentifier and signer. More...
 
const Keysigner () const
 Returns signer. More...
 
void setDeadline (catapult::Timestamp deadline)
 Sets transaction deadline. More...
 
void setMaxFee (catapult::Amount fee)
 Sets maximum transaction fee. More...
 

Private Member Functions

template<typename TTransaction >
size_t sizeImpl () const
 
template<typename TTransaction >
std::unique_ptr< TTransaction > buildImpl () const
 
template<typename TransactionType >
std::unique_ptr< TransactionTypebuildImpl () const
 

Private Attributes

model::UnresolvedMosaic m_mosaic
 
BlockDuration m_duration
 
Hash256 m_hash
 

Additional Inherited Members

- Protected Member Functions inherited from catapult::builders::TransactionBuilder
template<typename TTransaction >
std::unique_ptr< TTransaction > createTransaction (size_t size) const
 
- Static Protected Member Functions inherited from catapult::builders::TransactionBuilder
template<typename T , typename Predicate >
static void InsertSorted (std::vector< T > &vector, const T &element, Predicate orderPredicate)
 

Detailed Description

Builder for a hash lock transaction.

Member Typedef Documentation

◆ EmbeddedTransaction

using catapult::builders::HashLockBuilder::EmbeddedTransaction = model::EmbeddedHashLockTransaction

◆ Transaction

using catapult::builders::HashLockBuilder::Transaction = model::HashLockTransaction

Constructor & Destructor Documentation

◆ HashLockBuilder()

catapult::builders::HashLockBuilder::HashLockBuilder ( model::NetworkIdentifier  networkIdentifier,
const Key signer 
)

Creates a hash lock builder for building a hash lock transaction from signer for the network specified by networkIdentifier.

Member Function Documentation

◆ build()

std::unique_ptr< HashLockBuilder::Transaction > catapult::builders::HashLockBuilder::build ( ) const

Builds a new hash lock transaction.

◆ buildEmbedded()

std::unique_ptr< HashLockBuilder::EmbeddedTransaction > catapult::builders::HashLockBuilder::buildEmbedded ( ) const

Builds a new embedded hash lock transaction.

◆ buildImpl() [1/2]

template<typename TTransaction >
std::unique_ptr<TTransaction> catapult::builders::HashLockBuilder::buildImpl ( ) const
private

◆ buildImpl() [2/2]

template<typename TransactionType >
std::unique_ptr<TransactionType> catapult::builders::HashLockBuilder::buildImpl ( ) const
private

◆ setDuration()

void catapult::builders::HashLockBuilder::setDuration ( BlockDuration  duration)

Sets the number of blocks for which a lock should be valid to duration.

◆ setHash()

void catapult::builders::HashLockBuilder::setHash ( const Hash256 hash)

Sets the lock hash to hash.

◆ setMosaic()

void catapult::builders::HashLockBuilder::setMosaic ( const model::UnresolvedMosaic mosaic)

Sets the lock mosaic to mosaic.

◆ size()

size_t catapult::builders::HashLockBuilder::size ( ) const

Returns size of hash lock transaction.

Note
This returns size of a normal transaction not embedded transaction.
Here is the caller graph for this function:

◆ sizeImpl()

template<typename TransactionType >
size_t catapult::builders::HashLockBuilder::sizeImpl ( ) const
private
Here is the call graph for this function:

Member Data Documentation

◆ m_duration

BlockDuration catapult::builders::HashLockBuilder::m_duration
private

◆ m_hash

Hash256 catapult::builders::HashLockBuilder::m_hash
private

◆ m_mosaic

model::UnresolvedMosaic catapult::builders::HashLockBuilder::m_mosaic
private

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