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

Builder for a secret lock transaction. More...

Inheritance diagram for catapult::builders::SecretLockBuilder:
Collaboration diagram for catapult::builders::SecretLockBuilder:

Public Types

using Transaction = model::SecretLockTransaction
 
using EmbeddedTransaction = model::EmbeddedSecretLockTransaction
 

Public Member Functions

 SecretLockBuilder (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 setHashAlgorithm (model::LockHashAlgorithm hashAlgorithm)
 Sets the hash alghoritm to hashAlgorithm. More...
 
void setSecret (const Hash256 &secret)
 Sets the secret to secret. More...
 
void setRecipient (const UnresolvedAddress &recipient)
 Sets the recipient of the locked mosaic to recipient. More...
 
size_t size () const
 
std::unique_ptr< Transactionbuild () const
 Builds a new secret lock transaction. More...
 
std::unique_ptr< EmbeddedTransactionbuildEmbedded () const
 Builds a new embedded secret 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
 
model::LockHashAlgorithm m_hashAlgorithm
 
Hash256 m_secret
 
UnresolvedAddress m_recipient
 

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 secret lock transaction.

Member Typedef Documentation

◆ EmbeddedTransaction

using catapult::builders::SecretLockBuilder::EmbeddedTransaction = model::EmbeddedSecretLockTransaction

◆ Transaction

using catapult::builders::SecretLockBuilder::Transaction = model::SecretLockTransaction

Constructor & Destructor Documentation

◆ SecretLockBuilder()

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

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

Member Function Documentation

◆ build()

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

Builds a new secret lock transaction.

◆ buildEmbedded()

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

Builds a new embedded secret lock transaction.

◆ buildImpl() [1/2]

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

◆ buildImpl() [2/2]

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

◆ setDuration()

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

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

◆ setHashAlgorithm()

void catapult::builders::SecretLockBuilder::setHashAlgorithm ( model::LockHashAlgorithm  hashAlgorithm)

Sets the hash alghoritm to hashAlgorithm.

◆ setMosaic()

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

Sets the lock mosaic to mosaic.

◆ setRecipient()

void catapult::builders::SecretLockBuilder::setRecipient ( const UnresolvedAddress recipient)

Sets the recipient of the locked mosaic to recipient.

◆ setSecret()

void catapult::builders::SecretLockBuilder::setSecret ( const Hash256 secret)

Sets the secret to secret.

◆ size()

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

Returns size of secret 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::SecretLockBuilder::sizeImpl ( ) const
private
Here is the call graph for this function:

Member Data Documentation

◆ m_duration

BlockDuration catapult::builders::SecretLockBuilder::m_duration
private

◆ m_hashAlgorithm

model::LockHashAlgorithm catapult::builders::SecretLockBuilder::m_hashAlgorithm
private

◆ m_mosaic

model::UnresolvedMosaic catapult::builders::SecretLockBuilder::m_mosaic
private

◆ m_recipient

UnresolvedAddress catapult::builders::SecretLockBuilder::m_recipient
private

◆ m_secret

Hash256 catapult::builders::SecretLockBuilder::m_secret
private

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