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