rippled
applySteps.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/app/tx/applySteps.h>
21 #include <ripple/app/tx/impl/ApplyContext.h>
22 #include <ripple/app/tx/impl/CancelCheck.h>
23 #include <ripple/app/tx/impl/CancelOffer.h>
24 #include <ripple/app/tx/impl/CashCheck.h>
25 #include <ripple/app/tx/impl/Change.h>
26 #include <ripple/app/tx/impl/Clawback.h>
27 #include <ripple/app/tx/impl/CreateCheck.h>
28 #include <ripple/app/tx/impl/CreateOffer.h>
29 #include <ripple/app/tx/impl/CreateTicket.h>
30 #include <ripple/app/tx/impl/DeleteAccount.h>
31 #include <ripple/app/tx/impl/DepositPreauth.h>
32 #include <ripple/app/tx/impl/Escrow.h>
33 #include <ripple/app/tx/impl/NFTokenAcceptOffer.h>
34 #include <ripple/app/tx/impl/NFTokenBurn.h>
35 #include <ripple/app/tx/impl/NFTokenCancelOffer.h>
36 #include <ripple/app/tx/impl/NFTokenCreateOffer.h>
37 #include <ripple/app/tx/impl/NFTokenMint.h>
38 #include <ripple/app/tx/impl/PayChan.h>
39 #include <ripple/app/tx/impl/Payment.h>
40 #include <ripple/app/tx/impl/SetAccount.h>
41 #include <ripple/app/tx/impl/SetRegularKey.h>
42 #include <ripple/app/tx/impl/SetSignerList.h>
43 #include <ripple/app/tx/impl/SetTrust.h>
44 
45 namespace ripple {
46 
47 // Templates so preflight does the right thing with T::ConsequencesFactory.
48 //
49 // This could be done more easily using if constexpr, but Visual Studio
50 // 2017 doesn't handle if constexpr correctly. So once we're no longer
51 // building with Visual Studio 2017 we can consider replacing the four
52 // templates with a single template function that uses if constexpr.
53 //
54 // For Transactor::Normal
55 template <
56  class T,
58 TxConsequences
60 {
61  return TxConsequences(ctx.tx);
62 };
63 
64 // For Transactor::Blocker
65 template <
66  class T,
68 TxConsequences
69 consequences_helper(PreflightContext const& ctx)
70 {
71  return TxConsequences(ctx.tx, TxConsequences::blocker);
72 };
73 
74 // For Transactor::Custom
75 template <
76  class T,
78 TxConsequences
79 consequences_helper(PreflightContext const& ctx)
80 {
81  return T::makeTxConsequences(ctx);
82 };
83 
84 template <class T>
87 {
88  auto const tec = T::preflight(ctx);
89  return {
90  tec,
91  isTesSuccess(tec) ? consequences_helper<T>(ctx) : TxConsequences{tec}};
92 }
93 
96 {
97  switch (ctx.tx.getTxnType())
98  {
99  case ttACCOUNT_DELETE:
100  return invoke_preflight_helper<DeleteAccount>(ctx);
101  case ttACCOUNT_SET:
102  return invoke_preflight_helper<SetAccount>(ctx);
103  case ttCHECK_CANCEL:
104  return invoke_preflight_helper<CancelCheck>(ctx);
105  case ttCHECK_CASH:
106  return invoke_preflight_helper<CashCheck>(ctx);
107  case ttCHECK_CREATE:
108  return invoke_preflight_helper<CreateCheck>(ctx);
109  case ttDEPOSIT_PREAUTH:
110  return invoke_preflight_helper<DepositPreauth>(ctx);
111  case ttOFFER_CANCEL:
112  return invoke_preflight_helper<CancelOffer>(ctx);
113  case ttOFFER_CREATE:
114  return invoke_preflight_helper<CreateOffer>(ctx);
115  case ttESCROW_CREATE:
116  return invoke_preflight_helper<EscrowCreate>(ctx);
117  case ttESCROW_FINISH:
118  return invoke_preflight_helper<EscrowFinish>(ctx);
119  case ttESCROW_CANCEL:
120  return invoke_preflight_helper<EscrowCancel>(ctx);
121  case ttPAYCHAN_CLAIM:
122  return invoke_preflight_helper<PayChanClaim>(ctx);
123  case ttPAYCHAN_CREATE:
124  return invoke_preflight_helper<PayChanCreate>(ctx);
125  case ttPAYCHAN_FUND:
126  return invoke_preflight_helper<PayChanFund>(ctx);
127  case ttPAYMENT:
128  return invoke_preflight_helper<Payment>(ctx);
129  case ttREGULAR_KEY_SET:
130  return invoke_preflight_helper<SetRegularKey>(ctx);
131  case ttSIGNER_LIST_SET:
132  return invoke_preflight_helper<SetSignerList>(ctx);
133  case ttTICKET_CREATE:
134  return invoke_preflight_helper<CreateTicket>(ctx);
135  case ttTRUST_SET:
136  return invoke_preflight_helper<SetTrust>(ctx);
137  case ttAMENDMENT:
138  case ttFEE:
139  case ttUNL_MODIFY:
140  return invoke_preflight_helper<Change>(ctx);
141  case ttNFTOKEN_MINT:
142  return invoke_preflight_helper<NFTokenMint>(ctx);
143  case ttNFTOKEN_BURN:
144  return invoke_preflight_helper<NFTokenBurn>(ctx);
146  return invoke_preflight_helper<NFTokenCreateOffer>(ctx);
148  return invoke_preflight_helper<NFTokenCancelOffer>(ctx);
150  return invoke_preflight_helper<NFTokenAcceptOffer>(ctx);
151  case ttCLAWBACK:
152  return invoke_preflight_helper<Clawback>(ctx);
153  default:
154  assert(false);
156  }
157 }
158 
159 /* invoke_preclaim<T> uses name hiding to accomplish
160  compile-time polymorphism of (presumably) static
161  class functions for Transactor and derived classes.
162 */
163 template <class T>
164 static TER
166 {
167  // If the transactor requires a valid account and the transaction doesn't
168  // list one, preflight will have already a flagged a failure.
169  auto const id = ctx.tx.getAccountID(sfAccount);
170 
171  if (id != beast::zero)
172  {
173  TER result = T::checkSeqProxy(ctx.view, ctx.tx, ctx.j);
174 
175  if (result != tesSUCCESS)
176  return result;
177 
178  result = T::checkPriorTxAndLastLedger(ctx);
179 
180  if (result != tesSUCCESS)
181  return result;
182 
183  result = T::checkFee(ctx, calculateBaseFee(ctx.view, ctx.tx));
184 
185  if (result != tesSUCCESS)
186  return result;
187 
188  result = T::checkSign(ctx);
189 
190  if (result != tesSUCCESS)
191  return result;
192  }
193 
194  return T::preclaim(ctx);
195 }
196 
197 static TER
198 invoke_preclaim(PreclaimContext const& ctx)
199 {
200  switch (ctx.tx.getTxnType())
201  {
202  case ttACCOUNT_DELETE:
203  return invoke_preclaim<DeleteAccount>(ctx);
204  case ttACCOUNT_SET:
205  return invoke_preclaim<SetAccount>(ctx);
206  case ttCHECK_CANCEL:
207  return invoke_preclaim<CancelCheck>(ctx);
208  case ttCHECK_CASH:
209  return invoke_preclaim<CashCheck>(ctx);
210  case ttCHECK_CREATE:
211  return invoke_preclaim<CreateCheck>(ctx);
212  case ttDEPOSIT_PREAUTH:
213  return invoke_preclaim<DepositPreauth>(ctx);
214  case ttOFFER_CANCEL:
215  return invoke_preclaim<CancelOffer>(ctx);
216  case ttOFFER_CREATE:
217  return invoke_preclaim<CreateOffer>(ctx);
218  case ttESCROW_CREATE:
219  return invoke_preclaim<EscrowCreate>(ctx);
220  case ttESCROW_FINISH:
221  return invoke_preclaim<EscrowFinish>(ctx);
222  case ttESCROW_CANCEL:
223  return invoke_preclaim<EscrowCancel>(ctx);
224  case ttPAYCHAN_CLAIM:
225  return invoke_preclaim<PayChanClaim>(ctx);
226  case ttPAYCHAN_CREATE:
227  return invoke_preclaim<PayChanCreate>(ctx);
228  case ttPAYCHAN_FUND:
229  return invoke_preclaim<PayChanFund>(ctx);
230  case ttPAYMENT:
231  return invoke_preclaim<Payment>(ctx);
232  case ttREGULAR_KEY_SET:
233  return invoke_preclaim<SetRegularKey>(ctx);
234  case ttSIGNER_LIST_SET:
235  return invoke_preclaim<SetSignerList>(ctx);
236  case ttTICKET_CREATE:
237  return invoke_preclaim<CreateTicket>(ctx);
238  case ttTRUST_SET:
239  return invoke_preclaim<SetTrust>(ctx);
240  case ttAMENDMENT:
241  case ttFEE:
242  case ttUNL_MODIFY:
243  return invoke_preclaim<Change>(ctx);
244  case ttNFTOKEN_MINT:
245  return invoke_preclaim<NFTokenMint>(ctx);
246  case ttNFTOKEN_BURN:
247  return invoke_preclaim<NFTokenBurn>(ctx);
249  return invoke_preclaim<NFTokenCreateOffer>(ctx);
251  return invoke_preclaim<NFTokenCancelOffer>(ctx);
253  return invoke_preclaim<NFTokenAcceptOffer>(ctx);
254  case ttCLAWBACK:
255  return invoke_preclaim<Clawback>(ctx);
256  default:
257  assert(false);
258  return temUNKNOWN;
259  }
260 }
261 
262 static XRPAmount
263 invoke_calculateBaseFee(ReadView const& view, STTx const& tx)
264 {
265  switch (tx.getTxnType())
266  {
267  case ttACCOUNT_DELETE:
268  return DeleteAccount::calculateBaseFee(view, tx);
269  case ttACCOUNT_SET:
270  return SetAccount::calculateBaseFee(view, tx);
271  case ttCHECK_CANCEL:
272  return CancelCheck::calculateBaseFee(view, tx);
273  case ttCHECK_CASH:
274  return CashCheck::calculateBaseFee(view, tx);
275  case ttCHECK_CREATE:
276  return CreateCheck::calculateBaseFee(view, tx);
277  case ttDEPOSIT_PREAUTH:
278  return DepositPreauth::calculateBaseFee(view, tx);
279  case ttOFFER_CANCEL:
280  return CancelOffer::calculateBaseFee(view, tx);
281  case ttOFFER_CREATE:
282  return CreateOffer::calculateBaseFee(view, tx);
283  case ttESCROW_CREATE:
284  return EscrowCreate::calculateBaseFee(view, tx);
285  case ttESCROW_FINISH:
286  return EscrowFinish::calculateBaseFee(view, tx);
287  case ttESCROW_CANCEL:
288  return EscrowCancel::calculateBaseFee(view, tx);
289  case ttPAYCHAN_CLAIM:
290  return PayChanClaim::calculateBaseFee(view, tx);
291  case ttPAYCHAN_CREATE:
292  return PayChanCreate::calculateBaseFee(view, tx);
293  case ttPAYCHAN_FUND:
294  return PayChanFund::calculateBaseFee(view, tx);
295  case ttPAYMENT:
296  return Payment::calculateBaseFee(view, tx);
297  case ttREGULAR_KEY_SET:
298  return SetRegularKey::calculateBaseFee(view, tx);
299  case ttSIGNER_LIST_SET:
300  return SetSignerList::calculateBaseFee(view, tx);
301  case ttTICKET_CREATE:
302  return CreateTicket::calculateBaseFee(view, tx);
303  case ttTRUST_SET:
304  return SetTrust::calculateBaseFee(view, tx);
305  case ttAMENDMENT:
306  case ttFEE:
307  case ttUNL_MODIFY:
308  return Change::calculateBaseFee(view, tx);
309  case ttNFTOKEN_MINT:
310  return NFTokenMint::calculateBaseFee(view, tx);
311  case ttNFTOKEN_BURN:
312  return NFTokenBurn::calculateBaseFee(view, tx);
314  return NFTokenCreateOffer::calculateBaseFee(view, tx);
316  return NFTokenCancelOffer::calculateBaseFee(view, tx);
318  return NFTokenAcceptOffer::calculateBaseFee(view, tx);
319  case ttCLAWBACK:
320  return Clawback::calculateBaseFee(view, tx);
321  default:
322  assert(false);
323  return XRPAmount{0};
324  }
325 }
326 
328  : isBlocker_(false)
329  , fee_(beast::zero)
330  , potentialSpend_(beast::zero)
331  , seqProx_(SeqProxy::sequence(0))
332  , sequencesConsumed_(0)
333 {
334  assert(!isTesSuccess(pfresult));
335 }
336 
338  : isBlocker_(false)
339  , fee_(
340  tx[sfFee].native() && !tx[sfFee].negative() ? tx[sfFee].xrp()
341  : beast::zero)
342  , potentialSpend_(beast::zero)
343  , seqProx_(tx.getSeqProxy())
344  , sequencesConsumed_(tx.getSeqProxy().isSeq() ? 1 : 0)
345 {
346 }
347 
349  : TxConsequences(tx)
350 {
351  isBlocker_ = (category == blocker);
352 }
353 
355  : TxConsequences(tx)
356 {
358 }
359 
360 TxConsequences::TxConsequences(STTx const& tx, std::uint32_t sequencesConsumed)
361  : TxConsequences(tx)
362 {
364 }
365 
368 {
369  switch (ctx.tx.getTxnType())
370  {
371  case ttACCOUNT_DELETE: {
372  DeleteAccount p(ctx);
373  return p();
374  }
375  case ttACCOUNT_SET: {
376  SetAccount p(ctx);
377  return p();
378  }
379  case ttCHECK_CANCEL: {
380  CancelCheck p(ctx);
381  return p();
382  }
383  case ttCHECK_CASH: {
384  CashCheck p(ctx);
385  return p();
386  }
387  case ttCHECK_CREATE: {
388  CreateCheck p(ctx);
389  return p();
390  }
391  case ttDEPOSIT_PREAUTH: {
392  DepositPreauth p(ctx);
393  return p();
394  }
395  case ttOFFER_CANCEL: {
396  CancelOffer p(ctx);
397  return p();
398  }
399  case ttOFFER_CREATE: {
400  CreateOffer p(ctx);
401  return p();
402  }
403  case ttESCROW_CREATE: {
404  EscrowCreate p(ctx);
405  return p();
406  }
407  case ttESCROW_FINISH: {
408  EscrowFinish p(ctx);
409  return p();
410  }
411  case ttESCROW_CANCEL: {
412  EscrowCancel p(ctx);
413  return p();
414  }
415  case ttPAYCHAN_CLAIM: {
416  PayChanClaim p(ctx);
417  return p();
418  }
419  case ttPAYCHAN_CREATE: {
420  PayChanCreate p(ctx);
421  return p();
422  }
423  case ttPAYCHAN_FUND: {
424  PayChanFund p(ctx);
425  return p();
426  }
427  case ttPAYMENT: {
428  Payment p(ctx);
429  return p();
430  }
431  case ttREGULAR_KEY_SET: {
432  SetRegularKey p(ctx);
433  return p();
434  }
435  case ttSIGNER_LIST_SET: {
436  SetSignerList p(ctx);
437  return p();
438  }
439  case ttTICKET_CREATE: {
440  CreateTicket p(ctx);
441  return p();
442  }
443  case ttTRUST_SET: {
444  SetTrust p(ctx);
445  return p();
446  }
447  case ttAMENDMENT:
448  case ttFEE:
449  case ttUNL_MODIFY: {
450  Change p(ctx);
451  return p();
452  }
453  case ttNFTOKEN_MINT: {
454  NFTokenMint p(ctx);
455  return p();
456  }
457  case ttNFTOKEN_BURN: {
458  NFTokenBurn p(ctx);
459  return p();
460  }
461  case ttNFTOKEN_CREATE_OFFER: {
462  NFTokenCreateOffer p(ctx);
463  return p();
464  }
465  case ttNFTOKEN_CANCEL_OFFER: {
466  NFTokenCancelOffer p(ctx);
467  return p();
468  }
469  case ttNFTOKEN_ACCEPT_OFFER: {
470  NFTokenAcceptOffer p(ctx);
471  return p();
472  }
473  case ttCLAWBACK: {
474  Clawback p(ctx);
475  return p();
476  }
477  default:
478  assert(false);
479  return {temUNKNOWN, false};
480  }
481 }
482 
483 PreflightResult
485  Application& app,
486  Rules const& rules,
487  STTx const& tx,
488  ApplyFlags flags,
489  beast::Journal j)
490 {
491  PreflightContext const pfctx(app, tx, rules, flags, j);
492  try
493  {
494  return {pfctx, invoke_preflight(pfctx)};
495  }
496  catch (std::exception const& e)
497  {
498  JLOG(j.fatal()) << "apply: " << e.what();
499  return {pfctx, {tefEXCEPTION, TxConsequences{tx}}};
500  }
501 }
502 
503 PreclaimResult
505  PreflightResult const& preflightResult,
506  Application& app,
507  OpenView const& view)
508 {
510  if (preflightResult.rules != view.rules())
511  {
512  auto secondFlight = preflight(
513  app,
514  view.rules(),
515  preflightResult.tx,
516  preflightResult.flags,
517  preflightResult.j);
518  ctx.emplace(
519  app,
520  view,
521  secondFlight.ter,
522  secondFlight.tx,
523  secondFlight.flags,
524  secondFlight.j);
525  }
526  else
527  {
528  ctx.emplace(
529  app,
530  view,
531  preflightResult.ter,
532  preflightResult.tx,
533  preflightResult.flags,
534  preflightResult.j);
535  }
536  try
537  {
538  if (ctx->preflightResult != tesSUCCESS)
539  return {*ctx, ctx->preflightResult};
540  return {*ctx, invoke_preclaim(*ctx)};
541  }
542  catch (std::exception const& e)
543  {
544  JLOG(ctx->j.fatal()) << "apply: " << e.what();
545  return {*ctx, tefEXCEPTION};
546  }
547 }
548 
549 XRPAmount
550 calculateBaseFee(ReadView const& view, STTx const& tx)
551 {
552  return invoke_calculateBaseFee(view, tx);
553 }
554 
555 XRPAmount
556 calculateDefaultBaseFee(ReadView const& view, STTx const& tx)
557 {
558  return Transactor::calculateBaseFee(view, tx);
559 }
560 
562 doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view)
563 {
564  if (preclaimResult.view.seq() != view.seq())
565  {
566  // Logic error from the caller. Don't have enough
567  // info to recover.
568  return {tefEXCEPTION, false};
569  }
570  try
571  {
572  if (!preclaimResult.likelyToClaimFee)
573  return {preclaimResult.ter, false};
574  ApplyContext ctx(
575  app,
576  view,
577  preclaimResult.tx,
578  preclaimResult.ter,
579  calculateBaseFee(view, preclaimResult.tx),
580  preclaimResult.flags,
581  preclaimResult.j);
582  return invoke_apply(ctx);
583  }
584  catch (std::exception const& e)
585  {
586  JLOG(preclaimResult.j.fatal()) << "apply: " << e.what();
587  return {tefEXCEPTION, false};
588  }
589 }
590 
591 } // namespace ripple
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:339
ripple::STTx::getTxnType
TxType getTxnType() const
Definition: STTx.h:179
ripple::PayChanClaim
Definition: app/tx/impl/PayChan.h:72
ripple::ttNFTOKEN_CREATE_OFFER
@ ttNFTOKEN_CREATE_OFFER
This transaction creates a new offer to buy or sell an NFT.
Definition: TxFormats.h:134
ripple::consequences_helper
TxConsequences consequences_helper(PreflightContext const &ctx)
Definition: applySteps.cpp:59
ripple::Application
Definition: Application.h:116
ripple::PreclaimResult::view
ReadView const & view
From the input - the ledger view.
Definition: applySteps.h:197
ripple::ttACCOUNT_DELETE
@ ttACCOUNT_DELETE
This transaction type deletes an existing account.
Definition: TxFormats.h:122
ripple::PreclaimResult::j
const beast::Journal j
From the input - the journal.
Definition: applySteps.h:203
ripple::NFTokenMint
Definition: NFTokenMint.h:28
ripple::TxConsequences::TxConsequences
TxConsequences(NotTEC pfresult)
Definition: applySteps.cpp:327
ripple::PreclaimContext::view
ReadView const & view
Definition: Transactor.h:56
std::exception
STL class.
ripple::PreclaimContext::j
const beast::Journal j
Definition: Transactor.h:60
ripple::ttREGULAR_KEY_SET
@ ttREGULAR_KEY_SET
This transaction type sets or clears an account's "regular key".
Definition: TxFormats.h:74
ripple::ttCLAWBACK
@ ttCLAWBACK
This transaction claws back issued tokens.
Definition: TxFormats.h:143
ripple::isTesSuccess
bool isTesSuccess(TER x)
Definition: TER.h:597
ripple::ttSIGNER_LIST_SET
@ ttSIGNER_LIST_SET
This transaction type modifies the signer list associated with an account.
Definition: TxFormats.h:95
std::pair
ripple::ttESCROW_CANCEL
@ ttESCROW_CANCEL
This transaction type cancels an existing escrow.
Definition: TxFormats.h:71
ripple::Payment
Definition: Payment.h:30
ripple::OpenView
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:55
ripple::CreateCheck
Definition: CreateCheck.h:27
ripple::CancelOffer
Definition: CancelOffer.h:30
ripple::ttFEE
@ ttFEE
This system-generated transaction type is used to update the network's fee settings.
Definition: TxFormats.h:155
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:29
ripple::TxConsequences::Category
Category
Describes how the transaction affects subsequent transactions.
Definition: applySteps.h:50
ripple::ttOFFER_CANCEL
@ ttOFFER_CANCEL
This transaction type cancels existing offers to trade one asset for another.
Definition: TxFormats.h:83
ripple::SetAccount
Definition: SetAccount.h:32
ripple::DepositPreauth
Definition: DepositPreauth.h:27
ripple::EscrowCreate
Definition: Escrow.h:27
ripple::ttPAYCHAN_CREATE
@ ttPAYCHAN_CREATE
This transaction type creates a new unidirectional XRP payment channel.
Definition: TxFormats.h:98
std::optional::emplace
T emplace(T... args)
ripple::invoke_calculateBaseFee
static XRPAmount invoke_calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: applySteps.cpp:263
ripple::PreflightResult::tx
STTx const & tx
From the input - the transaction.
Definition: applySteps.h:154
ripple::preflight
PreflightResult preflight(Application &app, Rules const &rules, STTx const &tx, ApplyFlags flags, beast::Journal j)
Gate a transaction based on static information.
Definition: applySteps.cpp:484
ripple::ttNFTOKEN_ACCEPT_OFFER
@ ttNFTOKEN_ACCEPT_OFFER
This transaction accepts an existing offer to buy or sell an existing NFT.
Definition: TxFormats.h:140
ripple::Change::calculateBaseFee
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: Change.h:50
ripple::DeleteAccount
Definition: DeleteAccount.h:29
ripple::ttAMENDMENT
@ ttAMENDMENT
This system-generated transaction type is used to update the status of the various amendments.
Definition: TxFormats.h:149
ripple::PreclaimResult::likelyToClaimFee
const bool likelyToClaimFee
Success flag - whether the transaction is likely to claim a fee.
Definition: applySteps.h:209
ripple::PreclaimResult::ter
const TER ter
Intermediate transaction result.
Definition: applySteps.h:206
ripple::SetSignerList
See the README.md for an overview of the SetSignerList transaction that this class implements.
Definition: SetSignerList.h:42
ripple::ttCHECK_CANCEL
@ ttCHECK_CANCEL
This transaction type cancels an existing check.
Definition: TxFormats.h:113
ripple::ttPAYMENT
@ ttPAYMENT
This transaction type executes a payment.
Definition: TxFormats.h:59
ripple::Transactor::calculateBaseFee
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: Transactor.cpp:162
ripple::ttUNL_MODIFY
@ ttUNL_MODIFY
This system-generated transaction type is used to update the network's negative UNL.
Definition: TxFormats.h:161
ripple::doApply
std::pair< TER, bool > doApply(PreclaimResult const &preclaimResult, Application &app, OpenView &view)
Apply a prechecked transaction to an OpenView.
Definition: applySteps.cpp:562
ripple::ttCHECK_CREATE
@ ttCHECK_CREATE
This transaction type creates a new check.
Definition: TxFormats.h:107
ripple::PreflightResult
Describes the results of the preflight check.
Definition: applySteps.h:150
std::enable_if_t
ripple::TxConsequences::potentialSpend
XRPAmount const & potentialSpend() const
Potential Spend.
Definition: applySteps.h:108
ripple::PreflightResult::rules
const Rules rules
From the input - the rules.
Definition: applySteps.h:156
ripple::ttTRUST_SET
@ ttTRUST_SET
This transaction type modifies a trustline between two accounts.
Definition: TxFormats.h:119
ripple::STObject::getAccountID
AccountID getAccountID(SField const &field) const
Definition: STObject.cpp:589
ripple::TxConsequences::blocker
@ blocker
Affects the ability of subsequent transactions to claim a fee.
Definition: applySteps.h:55
ripple::PreflightResult::ter
const NotTEC ter
Intermediate transaction result.
Definition: applySteps.h:165
ripple::TERSubset< CanCvtToTER >
ripple::Change
Definition: Change.h:32
ripple::ttNFTOKEN_MINT
@ ttNFTOKEN_MINT
This transaction mints a new NFT.
Definition: TxFormats.h:128
ripple::ttESCROW_CREATE
@ ttESCROW_CREATE
This transaction type creates an escrow object.
Definition: TxFormats.h:62
ripple::SetTrust
Definition: SetTrust.h:31
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:568
ripple::ttESCROW_FINISH
@ ttESCROW_FINISH
This transaction type completes an existing escrow.
Definition: TxFormats.h:65
ripple::invoke_preflight_helper
std::pair< NotTEC, TxConsequences > invoke_preflight_helper(PreflightContext const &ctx)
Definition: applySteps.cpp:86
ripple::STTx
Definition: STTx.h:45
ripple::ApplyContext
State information when applying a tx.
Definition: ApplyContext.h:35
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::CreateOffer
Transactor specialized for creating offers in the ledger.
Definition: CreateOffer.h:34
std::uint32_t
ripple::temUNKNOWN
@ temUNKNOWN
Definition: TER.h:122
ripple::NFTokenCreateOffer
Definition: NFTokenCreateOffer.h:27
ripple::TxConsequences::isBlocker_
bool isBlocker_
Describes how the transaction affects subsequent transactions.
Definition: applySteps.h:61
ripple::PreclaimContext::tx
STTx const & tx
Definition: Transactor.h:58
ripple::ttNFTOKEN_CANCEL_OFFER
@ ttNFTOKEN_CANCEL_OFFER
This transaction cancels an existing offer to buy or sell an existing NFT.
Definition: TxFormats.h:137
ripple::ttOFFER_CREATE
@ ttOFFER_CREATE
This transaction type creates an offer to trade one asset for another.
Definition: TxFormats.h:80
ripple::invoke_apply
static std::pair< TER, bool > invoke_apply(ApplyContext &ctx)
Definition: applySteps.cpp:367
ripple::PreclaimContext
State information when determining if a tx is likely to claim a fee.
Definition: Transactor.h:52
ripple::calculateDefaultBaseFee
XRPAmount calculateDefaultBaseFee(ReadView const &view, STTx const &tx)
Return the minimum fee that an "ordinary" transaction would pay.
Definition: applySteps.cpp:556
ripple::ttACCOUNT_SET
@ ttACCOUNT_SET
This transaction type adjusts various account settings.
Definition: TxFormats.h:68
ripple::preclaim
PreclaimResult preclaim(PreflightResult const &preflightResult, Application &app, OpenView const &view)
Gate a transaction based on static ledger information.
Definition: applySteps.cpp:504
ripple::CancelCheck
Definition: CancelCheck.h:27
ripple::EscrowCancel
Definition: Escrow.h:69
ripple::TxConsequences::sequencesConsumed
std::uint32_t sequencesConsumed() const
Sequences consumed.
Definition: applySteps.h:122
ripple::ReadView
A view into a ledger.
Definition: ReadView.h:125
ripple::NFTokenCancelOffer
Definition: NFTokenCancelOffer.h:27
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::invoke_preclaim
static TER invoke_preclaim(PreclaimContext const &ctx)
Definition: applySteps.cpp:165
ripple::SetRegularKey
Definition: SetRegularKey.h:30
ripple::PayChanFund
Definition: app/tx/impl/PayChan.h:51
ripple::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition: ReadView.h:193
ripple::ttDEPOSIT_PREAUTH
@ ttDEPOSIT_PREAUTH
This transaction type grants or revokes authorization to transfer funds.
Definition: TxFormats.h:116
ripple::Clawback
Definition: Clawback.h:27
ripple::ttCHECK_CASH
@ ttCHECK_CASH
This transaction type cashes an existing check.
Definition: TxFormats.h:110
ripple::PreclaimResult
Describes the results of the preclaim check.
Definition: applySteps.h:193
ripple::ttPAYCHAN_FUND
@ ttPAYCHAN_FUND
This transaction type funds an existing unidirectional XRP payment channel.
Definition: TxFormats.h:101
ripple::SeqProxy
A type that represents either a sequence value or a ticket value.
Definition: SeqProxy.h:55
ripple::TxConsequences::potentialSpend_
XRPAmount potentialSpend_
Does NOT include the fee.
Definition: applySteps.h:65
ripple::ttPAYCHAN_CLAIM
@ ttPAYCHAN_CLAIM
This transaction type submits a claim against an existing unidirectional payment channel.
Definition: TxFormats.h:104
ripple::Rules
Rules controlling protocol behavior.
Definition: Rules.h:33
ripple::calculateBaseFee
XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Compute only the expected base fee for a transaction.
Definition: applySteps.cpp:550
std::optional
ripple::ttNFTOKEN_BURN
@ ttNFTOKEN_BURN
This transaction burns (i.e.
Definition: TxFormats.h:131
ripple::PreclaimResult::flags
const ApplyFlags flags
From the input - the flags.
Definition: applySteps.h:201
ripple::sfFee
const SF_AMOUNT sfFee
ripple::sfAccount
const SF_ACCOUNT sfAccount
ripple::PreflightResult::flags
const ApplyFlags flags
From the input - the flags.
Definition: applySteps.h:160
ripple::CreateTicket
Definition: CreateTicket.h:30
ripple::TxConsequences::sequencesConsumed_
std::uint32_t sequencesConsumed_
Number of sequences consumed.
Definition: applySteps.h:69
ripple::EscrowFinish::calculateBaseFee
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: Escrow.cpp:342
ripple::tefEXCEPTION
@ tefEXCEPTION
Definition: TER.h:154
ripple::PreflightContext::tx
STTx const & tx
Definition: Transactor.h:35
ripple::PreflightContext
State information when preflighting a tx.
Definition: Transactor.h:31
ripple::CashCheck
Definition: CashCheck.h:27
ripple::PayChanCreate
Definition: app/tx/impl/PayChan.h:27
ripple::NFTokenBurn
Definition: NFTokenBurn.h:27
ripple::TxConsequences
Class describing the consequences to the account of applying a transaction if the transaction consume...
Definition: applySteps.h:45
ripple::SetRegularKey::calculateBaseFee
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: SetRegularKey.cpp:28
ripple::EscrowFinish
Definition: Escrow.h:48
ripple::DeleteAccount::calculateBaseFee
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: DeleteAccount.cpp:56
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:222
ripple::OpenView::rules
Rules const & rules() const override
Returns the tx processing rules.
Definition: OpenView.cpp:152
ripple::invoke_preflight
static std::pair< NotTEC, TxConsequences > invoke_preflight(PreflightContext const &ctx)
Definition: applySteps.cpp:95
ripple::ApplyContext::tx
STTx const & tx
Definition: ApplyContext.h:48
ripple::ttTICKET_CREATE
@ ttTICKET_CREATE
This transaction type creates a new set of tickets.
Definition: TxFormats.h:89
std::exception::what
T what(T... args)
ripple::PreclaimResult::tx
STTx const & tx
From the input - the transaction.
Definition: applySteps.h:199
ripple::XRPAmount
Definition: XRPAmount.h:46
ripple::NFTokenAcceptOffer
Definition: NFTokenAcceptOffer.h:27
ripple::PreflightResult::j
const beast::Journal j
From the input - the journal.
Definition: applySteps.h:162
beast
Definition: base_uint.h:641