rippled
STTx.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <ripple/basics/Log.h>
21 #include <ripple/basics/StringUtilities.h>
22 #include <ripple/basics/contract.h>
23 #include <ripple/basics/safe_cast.h>
24 #include <ripple/json/to_string.h>
25 #include <ripple/protocol/Feature.h>
26 #include <ripple/protocol/HashPrefix.h>
27 #include <ripple/protocol/Protocol.h>
28 #include <ripple/protocol/PublicKey.h>
29 #include <ripple/protocol/STAccount.h>
30 #include <ripple/protocol/STArray.h>
31 #include <ripple/protocol/STTx.h>
32 #include <ripple/protocol/Sign.h>
33 #include <ripple/protocol/TxFlags.h>
34 #include <ripple/protocol/UintTypes.h>
35 #include <ripple/protocol/jss.h>
36 #include <boost/format.hpp>
37 #include <array>
38 #include <memory>
39 #include <type_traits>
40 #include <utility>
41 
42 namespace ripple {
43 
44 static auto
46 {
47  auto format = TxFormats::getInstance().findByType(type);
48 
49  if (format == nullptr)
50  {
51  Throw<std::runtime_error>(
52  "Invalid transaction type " +
54  }
55 
56  return format;
57 }
58 
59 STTx::STTx(STObject&& object) noexcept(false) : STObject(std::move(object))
60 {
61  tx_type_ = safe_cast<TxType>(getFieldU16(sfTransactionType));
62  applyTemplate(getTxFormat(tx_type_)->getSOTemplate()); // may throw
63  tid_ = getHash(HashPrefix::transactionID);
64 }
65 
66 STTx::STTx(SerialIter& sit) noexcept(false) : STObject(sfTransaction)
67 {
68  int length = sit.getBytesLeft();
69 
70  if ((length < txMinSizeBytes) || (length > txMaxSizeBytes))
71  Throw<std::runtime_error>("Transaction length invalid");
72 
73  if (set(sit))
74  Throw<std::runtime_error>("Transaction contains an object terminator");
75 
76  tx_type_ = safe_cast<TxType>(getFieldU16(sfTransactionType));
77 
78  applyTemplate(getTxFormat(tx_type_)->getSOTemplate()); // May throw
79  tid_ = getHash(HashPrefix::transactionID);
80 }
81 
82 STTx::STTx(TxType type, std::function<void(STObject&)> assembler)
84 {
85  auto format = getTxFormat(type);
86 
87  set(format->getSOTemplate());
88  setFieldU16(sfTransactionType, format->getType());
89 
90  assembler(*this);
91 
92  tx_type_ = safe_cast<TxType>(getFieldU16(sfTransactionType));
93 
94  if (tx_type_ != type)
95  LogicError("Transaction type was mutated during assembly");
96 
98 }
99 
102 {
103  std::string ret = "\"";
104  ret += to_string(getTransactionID());
105  ret += "\" = {";
106  ret += STObject::getFullText();
107  ret += "}";
108  return ret;
109 }
110 
111 boost::container::flat_set<AccountID>
113 {
114  boost::container::flat_set<AccountID> list;
115 
116  for (auto const& it : *this)
117  {
118  if (auto sacc = dynamic_cast<STAccount const*>(&it))
119  {
120  assert(!sacc->isDefault());
121  if (!sacc->isDefault())
122  list.insert(sacc->value());
123  }
124  else if (auto samt = dynamic_cast<STAmount const*>(&it))
125  {
126  auto const& issuer = samt->getIssuer();
127  if (!isXRP(issuer))
128  list.insert(issuer);
129  }
130  }
131 
132  return list;
133 }
134 
135 static Blob
136 getSigningData(STTx const& that)
137 {
138  Serializer s;
140  that.addWithoutSigningFields(s);
141  return s.getData();
142 }
143 
144 uint256
146 {
148 }
149 
150 Blob
152 {
153  try
154  {
155  return getFieldVL(sfTxnSignature);
156  }
157  catch (std::exception const&)
158  {
159  return Blob();
160  }
161 }
162 
163 SeqProxy
165 {
167  if (seq != 0)
168  return SeqProxy::sequence(seq);
169 
171  if (!ticketSeq)
172  // No TicketSequence specified. Return the Sequence, whatever it is.
173  return SeqProxy::sequence(seq);
174 
175  return SeqProxy{SeqProxy::ticket, *ticketSeq};
176 }
177 
178 void
179 STTx::sign(PublicKey const& publicKey, SecretKey const& secretKey)
180 {
181  auto const data = getSigningData(*this);
182 
183  auto const sig = ripple::sign(publicKey, secretKey, makeSlice(data));
184 
187 }
188 
190 STTx::checkSign(RequireFullyCanonicalSig requireCanonicalSig) const
191 {
192  std::pair<bool, std::string> ret{false, ""};
193  try
194  {
195  // Determine whether we're single- or multi-signing by looking
196  // at the SigningPubKey. If it's empty we must be
197  // multi-signing. Otherwise we're single-signing.
198  Blob const& signingPubKey = getFieldVL(sfSigningPubKey);
199  ret = signingPubKey.empty() ? checkMultiSign(requireCanonicalSig)
200  : checkSingleSign(requireCanonicalSig);
201  }
202  catch (std::exception const&)
203  {
204  ret = {false, "Internal signature check failure."};
205  }
206  return ret;
207 }
208 
210 {
212  ret[jss::hash] = to_string(getTransactionID());
213  return ret;
214 }
215 
217 STTx::getJson(JsonOptions options, bool binary) const
218 {
219  if (binary)
220  {
221  Json::Value ret;
223  ret[jss::tx] = strHex(s.peekData());
224  ret[jss::hash] = to_string(getTransactionID());
225  return ret;
226  }
227  return getJson(options);
228 }
229 
230 std::string const&
232 {
233  static std::string const sql =
234  "INSERT OR REPLACE INTO Transactions "
235  "(TransID, TransType, FromAcct, FromSeq, LedgerSeq, Status, RawTxn, "
236  "TxnMeta)"
237  " VALUES ";
238 
239  return sql;
240 }
241 
243 STTx::getMetaSQL(std::uint32_t inLedger, std::string const& escapedMetaData)
244  const
245 {
246  Serializer s;
247  add(s);
248  return getMetaSQL(s, inLedger, txnSqlValidated, escapedMetaData);
249 }
250 
251 // VFALCO This could be a free function elsewhere
254  Serializer rawTxn,
255  std::uint32_t inLedger,
256  char status,
257  std::string const& escapedMetaData) const
258 {
259  static boost::format bfTrans(
260  "('%s', '%s', '%s', '%d', '%d', '%c', %s, %s)");
261  std::string rTxn = sqlBlobLiteral(rawTxn.peekData());
262 
263  auto format = TxFormats::getInstance().findByType(tx_type_);
264  assert(format != nullptr);
265 
266  return str(
267  boost::format(bfTrans) % to_string(getTransactionID()) %
268  format->getName() % toBase58(getAccountID(sfAccount)) %
269  getFieldU32(sfSequence) % inLedger % status % rTxn % escapedMetaData);
270 }
271 
274 {
275  // We don't allow both a non-empty sfSigningPubKey and an sfSigners.
276  // That would allow the transaction to be signed two ways. So if both
277  // fields are present the signature is invalid.
279  return {false, "Cannot both single- and multi-sign."};
280 
281  bool validSig = false;
282  try
283  {
284  bool const fullyCanonical = (getFlags() & tfFullyCanonicalSig) ||
285  (requireCanonicalSig == RequireFullyCanonicalSig::yes);
286 
287  auto const spk = getFieldVL(sfSigningPubKey);
288 
289  if (publicKeyType(makeSlice(spk)))
290  {
291  Blob const signature = getFieldVL(sfTxnSignature);
292  Blob const data = getSigningData(*this);
293 
294  validSig = verify(
295  PublicKey(makeSlice(spk)),
296  makeSlice(data),
297  makeSlice(signature),
299  }
300  }
301  catch (std::exception const&)
302  {
303  // Assume it was a signature failure.
304  validSig = false;
305  }
306  if (validSig == false)
307  return {false, "Invalid signature."};
308 
309  return {true, ""};
310 }
311 
314 {
315  // Make sure the MultiSigners are present. Otherwise they are not
316  // attempting multi-signing and we just have a bad SigningPubKey.
318  return {false, "Empty SigningPubKey."};
319 
320  // We don't allow both an sfSigners and an sfTxnSignature. Both fields
321  // being present would indicate that the transaction is signed both ways.
323  return {false, "Cannot both single- and multi-sign."};
324 
325  STArray const& signers{getFieldArray(sfSigners)};
326 
327  // There are well known bounds that the number of signers must be within.
328  if (signers.size() < minMultiSigners || signers.size() > maxMultiSigners)
329  return {false, "Invalid Signers array size."};
330 
331  // We can ease the computational load inside the loop a bit by
332  // pre-constructing part of the data that we hash. Fill a Serializer
333  // with the stuff that stays constant from signature to signature.
334  Serializer const dataStart{startMultiSigningData(*this)};
335 
336  // We also use the sfAccount field inside the loop. Get it once.
337  auto const txnAccountID = getAccountID(sfAccount);
338 
339  // Determine whether signatures must be full canonical.
340  bool const fullyCanonical = (getFlags() & tfFullyCanonicalSig) ||
341  (requireCanonicalSig == RequireFullyCanonicalSig::yes);
342 
343  // Signers must be in sorted order by AccountID.
344  AccountID lastAccountID(beast::zero);
345 
346  for (auto const& signer : signers)
347  {
348  auto const accountID = signer.getAccountID(sfAccount);
349 
350  // The account owner may not multisign for themselves.
351  if (accountID == txnAccountID)
352  return {false, "Invalid multisigner."};
353 
354  // No duplicate signers allowed.
355  if (lastAccountID == accountID)
356  return {false, "Duplicate Signers not allowed."};
357 
358  // Accounts must be in order by account ID. No duplicates allowed.
359  if (lastAccountID > accountID)
360  return {false, "Unsorted Signers array."};
361 
362  // The next signature must be greater than this one.
363  lastAccountID = accountID;
364 
365  // Verify the signature.
366  bool validSig = false;
367  try
368  {
369  Serializer s = dataStart;
370  finishMultiSigningData(accountID, s);
371 
372  auto spk = signer.getFieldVL(sfSigningPubKey);
373 
374  if (publicKeyType(makeSlice(spk)))
375  {
376  Blob const signature = signer.getFieldVL(sfTxnSignature);
377 
378  validSig = verify(
379  PublicKey(makeSlice(spk)),
380  s.slice(),
381  makeSlice(signature),
383  }
384  }
385  catch (std::exception const&)
386  {
387  // We assume any problem lies with the signature.
388  validSig = false;
389  }
390  if (!validSig)
391  return {
392  false,
393  std::string("Invalid signature on account ") +
394  toBase58(accountID) + "."};
395  }
396 
397  // All signatures verified.
398  return {true, ""};
399 }
400 
401 //------------------------------------------------------------------------------
402 
403 static bool
404 isMemoOkay(STObject const& st, std::string& reason)
405 {
406  if (!st.isFieldPresent(sfMemos))
407  return true;
408 
409  auto const& memos = st.getFieldArray(sfMemos);
410 
411  // The number 2048 is a preallocation hint, not a hard limit
412  // to avoid allocate/copy/free's
413  Serializer s(2048);
414  memos.add(s);
415 
416  // FIXME move the memo limit into a config tunable
417  if (s.getDataLength() > 1024)
418  {
419  reason = "The memo exceeds the maximum allowed size.";
420  return false;
421  }
422 
423  for (auto const& memo : memos)
424  {
425  auto memoObj = dynamic_cast<STObject const*>(&memo);
426 
427  if (!memoObj || (memoObj->getFName() != sfMemo))
428  {
429  reason = "A memo array may contain only Memo objects.";
430  return false;
431  }
432 
433  for (auto const& memoElement : *memoObj)
434  {
435  auto const& name = memoElement.getFName();
436 
437  if (name != sfMemoType && name != sfMemoData &&
438  name != sfMemoFormat)
439  {
440  reason =
441  "A memo may contain only MemoType, MemoData or "
442  "MemoFormat fields.";
443  return false;
444  }
445 
446  // The raw data is stored as hex-octets, which we want to decode.
447  auto optData = strUnHex(memoElement.getText());
448 
449  if (!optData)
450  {
451  reason =
452  "The MemoType, MemoData and MemoFormat fields may "
453  "only contain hex-encoded data.";
454  return false;
455  }
456 
457  if (name == sfMemoData)
458  continue;
459 
460  // The only allowed characters for MemoType and MemoFormat are the
461  // characters allowed in URLs per RFC 3986: alphanumerics and the
462  // following symbols: -._~:/?#[]@!$&'()*+,;=%
463  static std::array<char, 256> const allowedSymbols = [] {
465  a.fill(0);
466 
467  std::string symbols(
468  "0123456789"
469  "-._~:/?#[]@!$&'()*+,;=%"
470  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
471  "abcdefghijklmnopqrstuvwxyz");
472 
473  for (char c : symbols)
474  a[c] = 1;
475  return a;
476  }();
477 
478  for (auto c : *optData)
479  {
480  if (!allowedSymbols[c])
481  {
482  reason =
483  "The MemoType and MemoFormat fields may only "
484  "contain characters that are allowed in URLs "
485  "under RFC 3986.";
486  return false;
487  }
488  }
489  }
490  }
491 
492  return true;
493 }
494 
495 // Ensure all account fields are 160-bits
496 static bool
498 {
499  for (int i = 0; i < st.getCount(); ++i)
500  {
501  auto t = dynamic_cast<STAccount const*>(st.peekAtPIndex(i));
502  if (t && t->isDefault())
503  return false;
504  }
505 
506  return true;
507 }
508 
509 bool
511 {
512  if (!isMemoOkay(st, reason))
513  return false;
514 
515  if (!isAccountFieldOkay(st))
516  {
517  reason = "An account field is invalid.";
518  return false;
519  }
520 
521  if (isPseudoTx(st))
522  {
523  reason = "Cannot submit pseudo transactions.";
524  return false;
525  }
526  return true;
527 }
528 
530 sterilize(STTx const& stx)
531 {
532  Serializer s;
533  stx.add(s);
534  SerialIter sit(s.slice());
535  return std::make_shared<STTx const>(std::ref(sit));
536 }
537 
538 bool
540 {
541  auto t = tx[~sfTransactionType];
542  if (!t)
543  return false;
544  auto tt = safe_cast<TxType>(*t);
545  return tt == ttAMENDMENT || tt == ttFEE || tt == ttUNL_MODIFY;
546 }
547 
548 } // namespace ripple
ripple::getTxFormat
static auto getTxFormat(TxType type)
Definition: STTx.cpp:45
ripple::isAccountFieldOkay
static bool isAccountFieldOkay(STObject const &st)
Definition: STTx.cpp:497
ripple::STTx::checkMultiSign
std::pair< bool, std::string > checkMultiSign(RequireFullyCanonicalSig requireCanonicalSig) const
Definition: STTx.cpp:313
ripple::STObject::getFieldArray
const STArray & getFieldArray(SField const &field) const
Definition: STObject.cpp:597
ripple::Blob
std::vector< unsigned char > Blob
Storage for linear binary data.
Definition: Blob.h:30
ripple::STTx::getMetaSQL
std::string getMetaSQL(std::uint32_t inLedger, std::string const &escapedMetaData) const
Definition: STTx.cpp:243
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:240
std::string
STL class.
std::shared_ptr
STL class.
ripple::sfSigners
const SField sfSigners
ripple::STTx::checkSign
std::pair< bool, std::string > checkSign(RequireFullyCanonicalSig requireCanonicalSig) const
Definition: STTx.cpp:190
utility
ripple::SeqProxy::ticket
@ ticket
Definition: SeqProxy.h:58
std::exception
STL class.
ripple::STObject::setFieldU16
void setFieldU16(SField const &field, std::uint16_t)
Definition: STObject.cpp:626
ripple::JsonOptions
JsonOptions
Definition: STBase.h:34
std::pair
ripple::sfSequence
const SF_UINT32 sfSequence
ripple::txMinSizeBytes
constexpr std::size_t txMinSizeBytes
Protocol specific constants, types, and data.
Definition: Protocol.h:39
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:268
std::vector< unsigned char >
ripple::sfSigningPubKey
const SF_VL sfSigningPubKey
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:29
ripple::STObject::getSerializer
Serializer getSerializer() const
Definition: STObject.h:367
ripple::SeqProxy::sequence
static constexpr SeqProxy sequence(std::uint32_t v)
Factory function to return a sequence-based SeqProxy.
Definition: SeqProxy.h:76
ripple::STTx::getSigningHash
uint256 getSigningHash() const
Definition: STTx.cpp:145
ripple::STTx::getSeqProxy
SeqProxy getSeqProxy() const
Definition: STTx.cpp:164
ripple::sfTicketSequence
const SF_UINT32 sfTicketSequence
ripple::STTx::getMetaSQLInsertReplaceHeader
static std::string const & getMetaSQLInsertReplaceHeader()
Definition: STTx.cpp:231
std::function
ripple::STObject::setFieldVL
void setFieldVL(SField const &field, Blob const &)
Definition: STObject.cpp:668
ripple::STObject::getFieldVL
Blob getFieldVL(SField const &field) const
Definition: STObject.cpp:568
ripple::STObject::peekAtPIndex
const STBase * peekAtPIndex(int offset) const
Definition: STObject.h:419
ripple::ECDSACanonicality::fullyCanonical
@ fullyCanonical
ripple::finishMultiSigningData
void finishMultiSigningData(AccountID const &signingID, Serializer &s)
Definition: Sign.h:85
std::array::fill
T fill(T... args)
ripple::STObject::getFullText
virtual std::string getFullText() const override
Definition: STObject.cpp:227
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:526
std::underlying_type_t
ripple::ttFEE
@ ttFEE
Definition: TxFormats.h:62
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:203
ripple::Serializer::getDataLength
int getDataLength() const
Definition: Serializer.h:184
ripple::base_uint< 160, detail::AccountIDTag >
ripple::sfTransactionType
const SF_UINT16 sfTransactionType
ripple::isPseudoTx
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.
Definition: STTx.cpp:539
ripple::getSigningData
static Blob getSigningData(STTx const &that)
Definition: STTx.cpp:136
ripple::sfMemos
const SField sfMemos
ripple::passesLocalChecks
bool passesLocalChecks(STObject const &st, std::string &reason)
Definition: STTx.cpp:510
ripple::TxFormats::getInstance
static TxFormats const & getInstance()
Definition: TxFormats.cpp:277
ripple::PublicKey
A public key.
Definition: PublicKey.h:59
ripple::STObject::getAccountID
AccountID getAccountID(SField const &field) const
Definition: STObject.cpp:562
ripple::JsonOptions::none
@ none
ripple::STTx::getFullText
std::string getFullText() const override
Definition: STTx.cpp:101
ripple::safe_cast
constexpr std::enable_if_t< std::is_same_v< typename Dest::unit_type, typename Src::unit_type > &&std::is_integral_v< typename Dest::value_type > &&std::is_integral_v< typename Src::value_type >, Dest > safe_cast(Src s) noexcept
Definition: FeeUnits.h:537
ripple::KnownFormats::findByType
Item const * findByType(KeyType type) const
Retrieve a format based on its type.
Definition: KnownFormats.h:125
ripple::startMultiSigningData
Serializer startMultiSigningData(STObject const &obj)
Break the multi-signing hash computation into 2 parts for optimization.
Definition: Sign.cpp:95
ripple::STArray
Definition: STArray.h:28
std::to_string
T to_string(T... args)
ripple::isMemoOkay
static bool isMemoOkay(STObject const &st, std::string &reason)
Definition: STTx.cpp:404
ripple::tfFullyCanonicalSig
const std::uint32_t tfFullyCanonicalSig
Definition: TxFlags.h:48
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:313
array
ripple::STAmount
Definition: STAmount.h:43
ripple::Serializer::slice
Slice slice() const noexcept
Definition: Serializer.h:63
ripple::txnSqlValidated
@ txnSqlValidated
Definition: STTx.h:37
ripple::STObject::getFlags
std::uint32_t getFlags() const
Definition: STObject.cpp:454
ripple::STTx
Definition: STTx.h:42
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:89
ripple::SerialIter
Definition: Serializer.h:310
ripple::HashPrefix::transactionID
@ transactionID
transaction plus signature to give transaction ID
std::uint32_t
ripple::STTx::checkSingleSign
std::pair< bool, std::string > checkSingleSign(RequireFullyCanonicalSig requireCanonicalSig) const
Definition: STTx.cpp:273
ripple::SecretKey
A secret key.
Definition: SecretKey.h:36
ripple::STObject::addWithoutSigningFields
void addWithoutSigningFields(Serializer &s) const
Definition: STObject.h:358
ripple::txMaxSizeBytes
constexpr std::size_t txMaxSizeBytes
Largest legal byte size of a transaction.
Definition: Protocol.h:42
ripple::ttAMENDMENT
@ ttAMENDMENT
Definition: TxFormats.h:61
ripple::STTx::sign
void sign(PublicKey const &publicKey, SecretKey const &secretKey)
Definition: STTx.cpp:179
ripple::STObject::getFieldU16
std::uint16_t getFieldU16(SField const &field) const
Definition: STObject.cpp:526
ripple::STTx::getJson
Json::Value getJson(JsonOptions options) const override
Definition: STTx.cpp:209
memory
ripple::STTx::getTransactionID
uint256 getTransactionID() const
Definition: STTx.h:117
ripple::Serializer
Definition: Serializer.h:39
ripple::STAccount
Definition: STAccount.h:29
ripple::sfMemoData
const SF_VL sfMemoData
ripple::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:33
ripple::sfTxnSignature
const SF_VL sfTxnSignature
ripple::STObject
Definition: STObject.h:51
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::sterilize
std::shared_ptr< STTx const > sterilize(STTx const &stx)
Sterilize a transaction.
Definition: STTx.cpp:530
ripple::STTx::maxMultiSigners
static const std::size_t maxMultiSigners
Definition: STTx.h:46
ripple::STObject::getSigningHash
uint256 getSigningHash(HashPrefix prefix) const
Definition: STObject.cpp:321
ripple::STTx::RequireFullyCanonicalSig::yes
@ yes
ripple::STObject::add
virtual void add(Serializer &s) const override
Definition: STObject.h:352
ripple::STTx::STTx
STTx()=delete
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &m)
Generate a signature for a message.
Definition: SecretKey.cpp:238
ripple::STTx::getSignature
Blob getSignature() const
Definition: STTx.cpp:151
std
STL namespace.
ripple::LogicError
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Definition: contract.cpp:48
ripple::STObject::isFieldPresent
bool isFieldPresent(SField const &field) const
Definition: STObject.cpp:401
ripple::STTx::tid_
uint256 tid_
Definition: STTx.h:159
ripple::Serializer::peekData
Blob const & peekData() const
Definition: Serializer.h:168
ripple::STTx::getMentionedAccounts
boost::container::flat_set< AccountID > getMentionedAccounts() const
Definition: STTx.cpp:112
ripple::SeqProxy
A type that represents either a sequence value or a ticket value.
Definition: SeqProxy.h:55
std::vector::empty
T empty(T... args)
ripple::STTx::minMultiSigners
static const std::size_t minMultiSigners
Definition: STTx.h:45
ripple::ttUNL_MODIFY
@ ttUNL_MODIFY
Definition: TxFormats.h:63
std::optional< std::uint32_t >
ripple::STObject::getCount
int getCount() const
Definition: STObject.h:392
ripple::to_string
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Definition: app/misc/impl/Manifest.cpp:39
ripple::sfMemo
const SField sfMemo
ripple::sfAccount
const SF_ACCOUNT sfAccount
ripple::Serializer::add32
int add32(std::uint32_t i)
Definition: Serializer.cpp:38
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:45
ripple::Serializer::getData
Blob getData() const
Definition: Serializer.h:173
ripple::HashPrefix::txSign
@ txSign
inner transaction to sign
ripple::STObject::operator[]
T::value_type operator[](TypedField< T > const &f) const
Get the value of a field.
Definition: STObject.h:980
ripple::STObject::getFieldU32
std::uint32_t getFieldU32(SField const &field) const
Definition: STObject.cpp:532
ripple::STObject::getJson
virtual Json::Value getJson(JsonOptions options) const override
Definition: STObject.cpp:698
ripple::strUnHex
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
Definition: StringUtilities.h:49
ripple::STObject::set
void set(const SOTemplate &)
Definition: STObject.cpp:73
ripple::STTx::RequireFullyCanonicalSig
RequireFullyCanonicalSig
Check the signature.
Definition: STTx.h:133
type_traits
ripple::sfTransaction
const SField sfTransaction
ripple::sqlBlobLiteral
std::string sqlBlobLiteral(Blob const &blob)
Format arbitrary binary data as an SQLite "blob literal".
Definition: StringUtilities.cpp:33
std::ref
T ref(T... args)
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::STTx::tx_type_
TxType tx_type_
Definition: STTx.h:160
ripple::STObject::getHash
uint256 getHash(HashPrefix prefix) const
Definition: STObject.cpp:312
ripple::sfMemoFormat
const SF_VL sfMemoFormat
ripple::sfMemoType
const SF_VL sfMemoType