CatapultServer  v0.5.0.1 (Elephant)
AggregateTransactionBuilder.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "TransactionBuilder.h"
24 #include <vector>
25 
26 namespace catapult { namespace builders {
27 
30  public:
31  using EmbeddedTransactionPointer = std::unique_ptr<model::EmbeddedTransaction>;
32 
35 
36  public:
38  void addTransaction(EmbeddedTransactionPointer&& pTransaction);
39 
40  public:
42  size_t size() const;
43 
45  std::unique_ptr<model::AggregateTransaction> build() const;
46 
47  private:
48  std::vector<EmbeddedTransactionPointer> m_pTransactions;
49  };
50 
53  public:
57  const GenerationHash& generationHash,
58  std::unique_ptr<model::AggregateTransaction>&& pAggregateTransaction);
59 
60  public:
62  void cosign(const crypto::KeyPair& cosigner);
63 
65  std::unique_ptr<model::AggregateTransaction> build() const;
66 
67  private:
69  std::unique_ptr<model::AggregateTransaction> m_pAggregateTransaction;
71  std::vector<model::Cosignature> m_cosignatures;
72  };
73 }}
catapult::builders::AggregateTransactionBuilder
Builder for an aggregate transaction.
Definition: AggregateTransactionBuilder.h:29
catapult::model::Cosignature
A cosignature.
Definition: Cosignature.h:29
catapult::builders::AggregateCosignatureAppender::cosign
void cosign(const crypto::KeyPair &cosigner)
Cosigns an aggregate transaction using cosigner key pair.
Definition: AggregateTransactionBuilder.cpp:77
catapult::builders::AggregateCosignatureAppender::m_cosignatures
std::vector< model::Cosignature > m_cosignatures
Definition: AggregateTransactionBuilder.h:71
catapult::builders::TransactionBuilder::signer
const Key & signer() const
Returns signer.
Definition: TransactionBuilder.h:41
catapult::builders::AggregateTransactionBuilder::build
std::unique_ptr< model::AggregateTransaction > build() const
Builds a new aggregate transaction.
Definition: AggregateTransactionBuilder.cpp:43
catapult::builders::AggregateCosignatureAppender::m_generationHash
GenerationHash m_generationHash
Definition: AggregateTransactionBuilder.h:68
AggregateTransaction.h
catapult::builders::AggregateCosignatureAppender::m_pAggregateTransaction
std::unique_ptr< model::AggregateTransaction > m_pAggregateTransaction
Definition: AggregateTransactionBuilder.h:69
catapult::builders::AggregateCosignatureAppender
Helper to add cosignatures to an aggregate transaction.
Definition: AggregateTransactionBuilder.h:52
catapult::builders::AggregateTransactionBuilder::addTransaction
void addTransaction(EmbeddedTransactionPointer &&pTransaction)
Adds a transaction.
Definition: AggregateTransactionBuilder.cpp:34
catapult::model::VerifiableEntityHeader::Header_Size
static constexpr size_t Header_Size
Size of the VerifiableEntity part that can be skipped when signing/verifying.
Definition: VerifiableEntity.h:38
catapult::utils::Sum
auto Sum(const TContainer &container, TFunction accessor)
Definition: Functional.h:39
AggregateTransactionBuilder.h
catapult::builders::AggregateTransactionBuilder::m_pTransactions
std::vector< EmbeddedTransactionPointer > m_pTransactions
Definition: AggregateTransactionBuilder.h:48
catapult::crypto::KeyPair
Represents a pair of private key with associated public key.
Definition: KeyPair.h:33
catapult::builders::AggregateCosignatureAppender::AggregateCosignatureAppender
AggregateCosignatureAppender(const GenerationHash &generationHash, std::unique_ptr< model::AggregateTransaction > &&pAggregateTransaction)
Definition: AggregateTransactionBuilder.cpp:70
Functional.h
Signer.h
TransactionBuilder.h
catapult::model::CalculateHash
Hash256 CalculateHash(LockHashAlgorithm hashAlgorithm, const RawBuffer &data)
Calculates hashAlgorithm hash of data.
Definition: LockHashUtils.cpp:46
size
uint64_t size
Definition: MemoryCounters.cpp:65
catapult::builders::AggregateCosignatureAppender::build
std::unique_ptr< model::AggregateTransaction > build() const
Builds an aggregate transaction with cosigatures appended.
Definition: AggregateTransactionBuilder.cpp:91
catapult::model::AggregateTransactionHeader::PayloadSize
uint32_t PayloadSize
Definition: AggregateTransaction.h:40
catapult::model::NetworkIdentifier
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
catapult::builders::AggregateTransactionBuilder::AggregateTransactionBuilder
AggregateTransactionBuilder(model::NetworkIdentifier networkIdentifier, const Key &signer)
Creates an aggregate transaction builder using signer for the network specified by networkIdentifier.
Definition: AggregateTransactionBuilder.cpp:30
catapult::builders::TransactionBuilder
Base transaction builder.
Definition: TransactionBuilder.h:31
catapult::builders::AggregateCosignatureAppender::m_transactionHash
Hash256 m_transactionHash
Definition: AggregateTransactionBuilder.h:70
catapult::crypto::KeyPair::publicKey
const auto & publicKey() const
Returns a public key of a key pair.
Definition: KeyPair.h:56
catapult::builders::AggregateTransactionBuilder::EmbeddedTransactionPointer
std::unique_ptr< model::EmbeddedTransaction > EmbeddedTransactionPointer
Definition: AggregateTransactionBuilder.h:31
catapult
Definition: AddressExtractionExtension.cpp:28
EntityHasher.h
m_generationHash
GenerationHash m_generationHash
Definition: HashCalculatorConsumer.cpp:67
catapult::utils::ByteArray< Key_Size, Key_tag >
catapult::builders::AggregateTransactionBuilder::size
size_t size() const
Returns size of aggregate transaction.
Definition: AggregateTransactionBuilder.cpp:38
catapult::crypto::Sign
void Sign(const KeyPair &keyPair, const RawBuffer &dataBuffer, Signature &computedSignature)
Definition: Signer.cpp:82
catapult::builders::TransactionType
model::AggregateTransaction TransactionType
Definition: AggregateTransactionBuilder.cpp:28
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
catapult::model::AggregateTransaction
Binary layout for an aggregate transaction.
Definition: AggregateTransaction.h:47