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/CreateCheck.h>
27 #include <ripple/app/tx/impl/CreateOffer.h>
28 #include <ripple/app/tx/impl/CreateTicket.h>
29 #include <ripple/app/tx/impl/DeleteAccount.h>
30 #include <ripple/app/tx/impl/DepositPreauth.h>
31 #include <ripple/app/tx/impl/Escrow.h>
32 #include <ripple/app/tx/impl/NFTokenAcceptOffer.h>
33 #include <ripple/app/tx/impl/NFTokenBurn.h>
34 #include <ripple/app/tx/impl/NFTokenCancelOffer.h>
35 #include <ripple/app/tx/impl/NFTokenCreateOffer.h>
36 #include <ripple/app/tx/impl/NFTokenMint.h>
37 #include <ripple/app/tx/impl/PayChan.h>
38 #include <ripple/app/tx/impl/Payment.h>
39 #include <ripple/app/tx/impl/SetAccount.h>
40 #include <ripple/app/tx/impl/SetRegularKey.h>
41 #include <ripple/app/tx/impl/SetSignerList.h>
42 #include <ripple/app/tx/impl/SetTrust.h>
43 
44 namespace ripple {
45 
46 // Templates so preflight does the right thing with T::ConsequencesFactory.
47 //
48 // This could be done more easily using if constexpr, but Visual Studio
49 // 2017 doesn't handle if constexpr correctly. So once we're no longer
50 // building with Visual Studio 2017 we can consider replacing the four
51 // templates with a single template function that uses if constexpr.
52 //
53 // For Transactor::Normal
54 template <
55  class T,
57 TxConsequences
59 {
60  return TxConsequences(ctx.tx);
61 };
62 
63 // For Transactor::Blocker
64 template <
65  class T,
67 TxConsequences
68 consequences_helper(PreflightContext const& ctx)
69 {
70  return TxConsequences(ctx.tx, TxConsequences::blocker);
71 };
72 
73 // For Transactor::Custom
74 template <
75  class T,
77 TxConsequences
78 consequences_helper(PreflightContext const& ctx)
79 {
80  return T::makeTxConsequences(ctx);
81 };
82 
83 template <class T>
86 {
87  auto const tec = T::preflight(ctx);
88  return {
89  tec,
90  isTesSuccess(tec) ? consequences_helper<T>(ctx) : TxConsequences{tec}};
91 }
92 
95 {
96  switch (ctx.tx.getTxnType())
97  {
98  case ttACCOUNT_DELETE:
99  return invoke_preflight_helper<DeleteAccount>(ctx);
100  case ttACCOUNT_SET:
101  return invoke_preflight_helper<SetAccount>(ctx);
102  case ttCHECK_CANCEL:
103  return invoke_preflight_helper<CancelCheck>(ctx);
104  case ttCHECK_CASH:
105  return invoke_preflight_helper<CashCheck>(ctx);
106  case ttCHECK_CREATE:
107  return invoke_preflight_helper<CreateCheck>(ctx);
108  case ttDEPOSIT_PREAUTH:
109  return invoke_preflight_helper<DepositPreauth>(ctx);
110  case ttOFFER_CANCEL:
111  return invoke_preflight_helper<CancelOffer>(ctx);
112  case ttOFFER_CREATE:
113  return invoke_preflight_helper<CreateOffer>(ctx);
114  case ttESCROW_CREATE:
115  return invoke_preflight_helper<EscrowCreate>(ctx);
116  case ttESCROW_FINISH:
117  return invoke_preflight_helper<EscrowFinish>(ctx);
118  case ttESCROW_CANCEL:
119  return invoke_preflight_helper<EscrowCancel>(ctx);
120  case ttPAYCHAN_CLAIM:
121  return invoke_preflight_helper<PayChanClaim>(ctx);
122  case ttPAYCHAN_CREATE:
123  return invoke_preflight_helper<PayChanCreate>(ctx);
124  case ttPAYCHAN_FUND:
125  return invoke_preflight_helper<PayChanFund>(ctx);
126  case ttPAYMENT:
127  return invoke_preflight_helper<Payment>(ctx);
128  case ttREGULAR_KEY_SET:
129  return invoke_preflight_helper<SetRegularKey>(ctx);
130  case ttSIGNER_LIST_SET:
131  return invoke_preflight_helper<SetSignerList>(ctx);
132  case ttTICKET_CREATE:
133  return invoke_preflight_helper<CreateTicket>(ctx);
134  case ttTRUST_SET:
135  return invoke_preflight_helper<SetTrust>(ctx);
136  case ttAMENDMENT:
137  case ttFEE:
138  case ttUNL_MODIFY:
139  return invoke_preflight_helper<Change>(ctx);
140  case ttNFTOKEN_MINT:
141  return invoke_preflight_helper<NFTokenMint>(ctx);
142  case ttNFTOKEN_BURN:
143  return invoke_preflight_helper<NFTokenBurn>(ctx);
145  return invoke_preflight_helper<NFTokenCreateOffer>(ctx);
147  return invoke_preflight_helper<NFTokenCancelOffer>(ctx);
149  return invoke_preflight_helper<NFTokenAcceptOffer>(ctx);
150  default:
151  assert(false);
153  }
154 }
155 
156 /* invoke_preclaim<T> uses name hiding to accomplish
157  compile-time polymorphism of (presumably) static
158  class functions for Transactor and derived classes.
159 */
160 template <class T>
161 static TER
163 {
164  // If the transactor requires a valid account and the transaction doesn't
165  // list one, preflight will have already a flagged a failure.
166  auto const id = ctx.tx.getAccountID(sfAccount);
167 
168  if (id != beast::zero)
169  {
170  TER result = T::checkSeqProxy(ctx.view, ctx.tx, ctx.j);
171 
172  if (result != tesSUCCESS)
173  return result;
174 
175  result = T::checkPriorTxAndLastLedger(ctx);
176 
177  if (result != tesSUCCESS)
178  return result;
179 
180  result = T::checkFee(ctx, calculateBaseFee(ctx.view, ctx.tx));
181 
182  if (result != tesSUCCESS)
183  return result;
184 
185  result = T::checkSign(ctx);
186 
187  if (result != tesSUCCESS)
188  return result;
189  }
190 
191  return T::preclaim(ctx);
192 }
193 
194 static TER
195 invoke_preclaim(PreclaimContext const& ctx)
196 {
197  switch (ctx.tx.getTxnType())
198  {
199  case ttACCOUNT_DELETE:
200  return invoke_preclaim<DeleteAccount>(ctx);
201  case ttACCOUNT_SET:
202  return invoke_preclaim<SetAccount>(ctx);
203  case ttCHECK_CANCEL:
204  return invoke_preclaim<CancelCheck>(ctx);
205  case ttCHECK_CASH:
206  return invoke_preclaim<CashCheck>(ctx);
207  case ttCHECK_CREATE:
208  return invoke_preclaim<CreateCheck>(ctx);
209  case ttDEPOSIT_PREAUTH:
210  return invoke_preclaim<DepositPreauth>(ctx);
211  case ttOFFER_CANCEL:
212  return invoke_preclaim<CancelOffer>(ctx);
213  case ttOFFER_CREATE:
214  return invoke_preclaim<CreateOffer>(ctx);
215  case ttESCROW_CREATE:
216  return invoke_preclaim<EscrowCreate>(ctx);
217  case ttESCROW_FINISH:
218  return invoke_preclaim<EscrowFinish>(ctx);
219  case ttESCROW_CANCEL:
220  return invoke_preclaim<EscrowCancel>(ctx);
221  case ttPAYCHAN_CLAIM:
222  return invoke_preclaim<PayChanClaim>(ctx);
223  case ttPAYCHAN_CREATE:
224  return invoke_preclaim<PayChanCreate>(ctx);
225  case ttPAYCHAN_FUND:
226  return invoke_preclaim<PayChanFund>(ctx);
227  case ttPAYMENT:
228  return invoke_preclaim<Payment>(ctx);
229  case ttREGULAR_KEY_SET:
230  return invoke_preclaim<SetRegularKey>(ctx);
231  case ttSIGNER_LIST_SET:
232  return invoke_preclaim<SetSignerList>(ctx);
233  case ttTICKET_CREATE:
234  return invoke_preclaim<CreateTicket>(ctx);
235  case ttTRUST_SET:
236  return invoke_preclaim<SetTrust>(ctx);
237  case ttAMENDMENT:
238  case ttFEE:
239  case ttUNL_MODIFY:
240  return invoke_preclaim<Change>(ctx);
241  case ttNFTOKEN_MINT:
242  return invoke_preclaim<NFTokenMint>(ctx);
243  case ttNFTOKEN_BURN:
244  return invoke_preclaim<NFTokenBurn>(ctx);
246  return invoke_preclaim<NFTokenCreateOffer>(ctx);
248  return invoke_preclaim<NFTokenCancelOffer>(ctx);
250  return invoke_preclaim<NFTokenAcceptOffer>(ctx);
251  default:
252  assert(false);
253  return temUNKNOWN;
254  }
255 }
256 
257 static XRPAmount
258 invoke_calculateBaseFee(ReadView const& view, STTx const& tx)
259 {
260  switch (tx.getTxnType())
261  {
262  case ttACCOUNT_DELETE:
263  return DeleteAccount::calculateBaseFee(view, tx);
264  case ttACCOUNT_SET:
265  return SetAccount::calculateBaseFee(view, tx);
266  case ttCHECK_CANCEL:
267  return CancelCheck::calculateBaseFee(view, tx);
268  case ttCHECK_CASH:
269  return CashCheck::calculateBaseFee(view, tx);
270  case ttCHECK_CREATE:
271  return CreateCheck::calculateBaseFee(view, tx);
272  case ttDEPOSIT_PREAUTH:
273  return DepositPreauth::calculateBaseFee(view, tx);
274  case ttOFFER_CANCEL:
275  return CancelOffer::calculateBaseFee(view, tx);
276  case ttOFFER_CREATE:
277  return CreateOffer::calculateBaseFee(view, tx);
278  case ttESCROW_CREATE:
279  return EscrowCreate::calculateBaseFee(view, tx);
280  case ttESCROW_FINISH:
281  return EscrowFinish::calculateBaseFee(view, tx);
282  case ttESCROW_CANCEL:
283  return EscrowCancel::calculateBaseFee(view, tx);
284  case ttPAYCHAN_CLAIM:
285  return PayChanClaim::calculateBaseFee(view, tx);
286  case ttPAYCHAN_CREATE:
287  return PayChanCreate::calculateBaseFee(view, tx);
288  case ttPAYCHAN_FUND:
289  return PayChanFund::calculateBaseFee(view, tx);
290  case ttPAYMENT:
291  return Payment::calculateBaseFee(view, tx);
292  case ttREGULAR_KEY_SET:
293  return SetRegularKey::calculateBaseFee(view, tx);
294  case ttSIGNER_LIST_SET:
295  return SetSignerList::calculateBaseFee(view, tx);
296  case ttTICKET_CREATE:
297  return CreateTicket::calculateBaseFee(view, tx);
298  case ttTRUST_SET:
299  return SetTrust::calculateBaseFee(view, tx);
300  case ttAMENDMENT:
301  case ttFEE:
302  case ttUNL_MODIFY:
303  return Change::calculateBaseFee(view, tx);
304  case ttNFTOKEN_MINT:
305  return NFTokenMint::calculateBaseFee(view, tx);
306  case ttNFTOKEN_BURN:
307  return NFTokenBurn::calculateBaseFee(view, tx);
309  return NFTokenCreateOffer::calculateBaseFee(view, tx);
311  return NFTokenCancelOffer::calculateBaseFee(view, tx);
313  return NFTokenAcceptOffer::calculateBaseFee(view, tx);
314  default:
315  assert(false);
316  return XRPAmount{0};
317  }
318 }
319 
321  : isBlocker_(false)
322  , fee_(beast::zero)
323  , potentialSpend_(beast::zero)
324  , seqProx_(SeqProxy::sequence(0))
325  , sequencesConsumed_(0)
326 {
327  assert(!isTesSuccess(pfresult));
328 }
329 
331  : isBlocker_(false)
332  , fee_(
333  tx[sfFee].native() && !tx[sfFee].negative() ? tx[sfFee].xrp()
334  : beast::zero)
335  , potentialSpend_(beast::zero)
336  , seqProx_(tx.getSeqProxy())
337  , sequencesConsumed_(tx.getSeqProxy().isSeq() ? 1 : 0)
338 {
339 }
340 
342  : TxConsequences(tx)
343 {
344  isBlocker_ = (category == blocker);
345 }
346 
348  : TxConsequences(tx)
349 {
351 }
352 
353 TxConsequences::TxConsequences(STTx const& tx, std::uint32_t sequencesConsumed)
354  : TxConsequences(tx)
355 {
357 }
358 
361 {
362  switch (ctx.tx.getTxnType())
363  {
364  case ttACCOUNT_DELETE: {
365  DeleteAccount p(ctx);
366  return p();
367  }
368  case ttACCOUNT_SET: {
369  SetAccount p(ctx);
370  return p();
371  }
372  case ttCHECK_CANCEL: {
373  CancelCheck p(ctx);
374  return p();
375  }
376  case ttCHECK_CASH: {
377  CashCheck p(ctx);
378  return p();
379  }
380  case ttCHECK_CREATE: {
381  CreateCheck p(ctx);
382  return p();
383  }
384  case ttDEPOSIT_PREAUTH: {
385  DepositPreauth p(ctx);
386  return p();
387  }
388  case ttOFFER_CANCEL: {
389  CancelOffer p(ctx);
390  return p();
391  }
392  case ttOFFER_CREATE: {
393  CreateOffer p(ctx);
394  return p();
395  }
396  case ttESCROW_CREATE: {
397  EscrowCreate p(ctx);
398  return p();
399  }
400  case ttESCROW_FINISH: {
401  EscrowFinish p(ctx);
402  return p();
403  }
404  case ttESCROW_CANCEL: {
405  EscrowCancel p(ctx);
406  return p();
407  }
408  case ttPAYCHAN_CLAIM: {
409  PayChanClaim p(ctx);
410  return p();
411  }
412  case ttPAYCHAN_CREATE: {
413  PayChanCreate p(ctx);
414  return p();
415  }
416  case ttPAYCHAN_FUND: {
417  PayChanFund p(ctx);
418  return p();
419  }
420  case ttPAYMENT: {
421  Payment p(ctx);
422  return p();
423  }
424  case ttREGULAR_KEY_SET: {
425  SetRegularKey p(ctx);
426  return p();
427  }
428  case ttSIGNER_LIST_SET: {
429  SetSignerList p(ctx);
430  return p();
431  }
432  case ttTICKET_CREATE: {
433  CreateTicket p(ctx);
434  return p();
435  }
436  case ttTRUST_SET: {
437  SetTrust p(ctx);
438  return p();
439  }
440  case ttAMENDMENT:
441  case ttFEE:
442  case ttUNL_MODIFY: {
443  Change p(ctx);
444  return p();
445  }
446  case ttNFTOKEN_MINT: {
447  NFTokenMint p(ctx);
448  return p();
449  }
450  case ttNFTOKEN_BURN: {
451  NFTokenBurn p(ctx);
452  return p();
453  }
454  case ttNFTOKEN_CREATE_OFFER: {
455  NFTokenCreateOffer p(ctx);
456  return p();
457  }
458  case ttNFTOKEN_CANCEL_OFFER: {
459  NFTokenCancelOffer p(ctx);
460  return p();
461  }
462  case ttNFTOKEN_ACCEPT_OFFER: {
463  NFTokenAcceptOffer p(ctx);
464  return p();
465  }
466  default:
467  assert(false);
468  return {temUNKNOWN, false};
469  }
470 }
471 
472 PreflightResult
474  Application& app,
475  Rules const& rules,
476  STTx const& tx,
477  ApplyFlags flags,
478  beast::Journal j)
479 {
480  PreflightContext const pfctx(app, tx, rules, flags, j);
481  try
482  {
483  return {pfctx, invoke_preflight(pfctx)};
484  }
485  catch (std::exception const& e)
486  {
487  JLOG(j.fatal()) << "apply: " << e.what();
488  return {pfctx, {tefEXCEPTION, TxConsequences{tx}}};
489  }
490 }
491 
492 PreclaimResult
494  PreflightResult const& preflightResult,
495  Application& app,
496  OpenView const& view)
497 {
499  if (preflightResult.rules != view.rules())
500  {
501  auto secondFlight = preflight(
502  app,
503  view.rules(),
504  preflightResult.tx,
505  preflightResult.flags,
506  preflightResult.j);
507  ctx.emplace(
508  app,
509  view,
510  secondFlight.ter,
511  secondFlight.tx,
512  secondFlight.flags,
513  secondFlight.j);
514  }
515  else
516  {
517  ctx.emplace(
518  app,
519  view,
520  preflightResult.ter,
521  preflightResult.tx,
522  preflightResult.flags,
523  preflightResult.j);
524  }
525  try
526  {
527  if (ctx->preflightResult != tesSUCCESS)
528  return {*ctx, ctx->preflightResult};
529  return {*ctx, invoke_preclaim(*ctx)};
530  }
531  catch (std::exception const& e)
532  {
533  JLOG(ctx->j.fatal()) << "apply: " << e.what();
534  return {*ctx, tefEXCEPTION};
535  }
536 }
537 
538 XRPAmount
539 calculateBaseFee(ReadView const& view, STTx const& tx)
540 {
541  return invoke_calculateBaseFee(view, tx);
542 }
543 
544 XRPAmount
545 calculateDefaultBaseFee(ReadView const& view, STTx const& tx)
546 {
547  return Transactor::calculateBaseFee(view, tx);
548 }
549 
551 doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view)
552 {
553  if (preclaimResult.view.seq() != view.seq())
554  {
555  // Logic error from the caller. Don't have enough
556  // info to recover.
557  return {tefEXCEPTION, false};
558  }
559  try
560  {
561  if (!preclaimResult.likelyToClaimFee)
562  return {preclaimResult.ter, false};
563  ApplyContext ctx(
564  app,
565  view,
566  preclaimResult.tx,
567  preclaimResult.ter,
568  calculateBaseFee(view, preclaimResult.tx),
569  preclaimResult.flags,
570  preclaimResult.j);
571  return invoke_apply(ctx);
572  }
573  catch (std::exception const& e)
574  {
575  JLOG(preclaimResult.j.fatal()) << "apply: " << e.what();
576  return {tefEXCEPTION, false};
577  }
578 }
579 
580 } // 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:58
ripple::Application
Definition: Application.h:115
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:320
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::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:152
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:258
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:473
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:146
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:158
ripple::doApply
std::pair< TER, bool > doApply(PreclaimResult const &preclaimResult, Application &app, OpenView &view)
Apply a prechecked transaction to an OpenView.
Definition: applySteps.cpp:551
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:85
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:360
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:545
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:493
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:162
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::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:539
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:94
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