CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
28 namespace catapult {
namespace builders {
66 template<
typename TTransaction>
68 auto pTransaction = utils::MakeUniqueWithSize<TTransaction>(
size);
69 std::memset(static_cast<void*>(pTransaction.get()), 0,
sizeof(TTransaction));
72 pTransaction->Size = utils::checked_cast<size_t, uint32_t>(
size);
73 pTransaction->Type = TTransaction::Entity_Type;
82 template<
typename T,
typename Predicate>
83 static void InsertSorted(std::vector<T>& vector,
const T& element, Predicate orderPredicate) {
84 auto iter = std::upper_bound(vector.begin(), vector.end(), element, orderPredicate);
85 if (iter != vector.begin() && !orderPredicate(*(iter - 1), element) && !orderPredicate(element, *(iter - 1)))
88 vector.insert(iter, element);
const Key & signer() const
Returns signer.
Definition: TransactionBuilder.h:41
void setMaxFee(catapult::Amount fee)
Sets maximum transaction fee.
Definition: TransactionBuilder.h:52
void setAdditionalFields(model::EmbeddedTransaction &) const
Definition: TransactionBuilder.h:57
Amount m_maxFee
Definition: TransactionBuilder.h:96
void setDeadline(catapult::Timestamp deadline)
Sets transaction deadline.
Definition: TransactionBuilder.h:47
TransactionBuilder(model::NetworkIdentifier networkIdentifier, const Key &signer)
Creates a transaction builder with networkIdentifier and signer.
Definition: TransactionBuilder.h:34
Amount MaxFee
Definition: Transaction.h:35
uint64_t size
Definition: MemoryCounters.cpp:65
const model::NetworkIdentifier m_networkIdentifier
Definition: TransactionBuilder.h:92
std::unique_ptr< TTransaction > createTransaction(size_t size) const
Definition: TransactionBuilder.h:67
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
Base transaction builder.
Definition: TransactionBuilder.h:31
const Key & m_signer
Definition: TransactionBuilder.h:93
Binary layout for an embedded transaction (non-verifiable).
Definition: EmbeddedTransaction.h:38
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
Timestamp Deadline
Transaction deadline.
Definition: Transaction.h:38
void setAdditionalFields(model::Transaction &transaction) const
Definition: TransactionBuilder.h:60
Definition: AddressExtractionExtension.cpp:28
Timestamp m_deadline
Definition: TransactionBuilder.h:95
constexpr uint16_t MakeVersion(NetworkIdentifier networkIdentifier, uint8_t version) noexcept
Creates a version field out of given entity version and networkIdentifier.
Definition: EntityBody.h:58
Binary layout for a transaction.
Definition: Transaction.h:32
static void InsertSorted(std::vector< T > &vector, const T &element, Predicate orderPredicate)
Definition: TransactionBuilder.h:83