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/AMMBid.h>
22 #include <ripple/app/tx/impl/AMMCreate.h>
23 #include <ripple/app/tx/impl/AMMDelete.h>
24 #include <ripple/app/tx/impl/AMMDeposit.h>
25 #include <ripple/app/tx/impl/AMMVote.h>
26 #include <ripple/app/tx/impl/AMMWithdraw.h>
27 #include <ripple/app/tx/impl/ApplyContext.h>
28 #include <ripple/app/tx/impl/CancelCheck.h>
29 #include <ripple/app/tx/impl/CancelOffer.h>
30 #include <ripple/app/tx/impl/CashCheck.h>
31 #include <ripple/app/tx/impl/Change.h>
32 #include <ripple/app/tx/impl/Clawback.h>
33 #include <ripple/app/tx/impl/CreateCheck.h>
34 #include <ripple/app/tx/impl/CreateOffer.h>
35 #include <ripple/app/tx/impl/CreateTicket.h>
36 #include <ripple/app/tx/impl/DeleteAccount.h>
37 #include <ripple/app/tx/impl/DepositPreauth.h>
38 #include <ripple/app/tx/impl/Escrow.h>
39 #include <ripple/app/tx/impl/NFTokenAcceptOffer.h>
40 #include <ripple/app/tx/impl/NFTokenBurn.h>
41 #include <ripple/app/tx/impl/NFTokenCancelOffer.h>
42 #include <ripple/app/tx/impl/NFTokenCreateOffer.h>
43 #include <ripple/app/tx/impl/NFTokenMint.h>
44 #include <ripple/app/tx/impl/PayChan.h>
45 #include <ripple/app/tx/impl/Payment.h>
46 #include <ripple/app/tx/impl/SetAccount.h>
47 #include <ripple/app/tx/impl/SetRegularKey.h>
48 #include <ripple/app/tx/impl/SetSignerList.h>
49 #include <ripple/app/tx/impl/SetTrust.h>
50 #include <ripple/app/tx/impl/XChainBridge.h>
51 #include <ripple/protocol/TxFormats.h>
52 
53 #include <stdexcept>
54 
55 namespace ripple {
56 
57 namespace {
58 
59 struct UnknownTxnType : std::exception
60 {
61  TxType txnType;
62  UnknownTxnType(TxType t) : txnType{t}
63  {
64  }
65 };
66 
67 // Call a lambda with the concrete transaction type as a template parameter
68 // throw an "UnknownTxnType" exception on error
69 template <class F>
70 auto
71 with_txn_type(TxType txnType, F&& f)
72 {
73  switch (txnType)
74  {
75  case ttACCOUNT_DELETE:
76  return f.template operator()<DeleteAccount>();
77  case ttACCOUNT_SET:
78  return f.template operator()<SetAccount>();
79  case ttCHECK_CANCEL:
80  return f.template operator()<CancelCheck>();
81  case ttCHECK_CASH:
82  return f.template operator()<CashCheck>();
83  case ttCHECK_CREATE:
84  return f.template operator()<CreateCheck>();
85  case ttDEPOSIT_PREAUTH:
86  return f.template operator()<DepositPreauth>();
87  case ttOFFER_CANCEL:
88  return f.template operator()<CancelOffer>();
89  case ttOFFER_CREATE:
90  return f.template operator()<CreateOffer>();
91  case ttESCROW_CREATE:
92  return f.template operator()<EscrowCreate>();
93  case ttESCROW_FINISH:
94  return f.template operator()<EscrowFinish>();
95  case ttESCROW_CANCEL:
96  return f.template operator()<EscrowCancel>();
97  case ttPAYCHAN_CLAIM:
98  return f.template operator()<PayChanClaim>();
99  case ttPAYCHAN_CREATE:
100  return f.template operator()<PayChanCreate>();
101  case ttPAYCHAN_FUND:
102  return f.template operator()<PayChanFund>();
103  case ttPAYMENT:
104  return f.template operator()<Payment>();
105  case ttREGULAR_KEY_SET:
106  return f.template operator()<SetRegularKey>();
107  case ttSIGNER_LIST_SET:
108  return f.template operator()<SetSignerList>();
109  case ttTICKET_CREATE:
110  return f.template operator()<CreateTicket>();
111  case ttTRUST_SET:
112  return f.template operator()<SetTrust>();
113  case ttAMENDMENT:
114  case ttFEE:
115  case ttUNL_MODIFY:
116  return f.template operator()<Change>();
117  case ttNFTOKEN_MINT:
118  return f.template operator()<NFTokenMint>();
119  case ttNFTOKEN_BURN:
120  return f.template operator()<NFTokenBurn>();
122  return f.template operator()<NFTokenCreateOffer>();
124  return f.template operator()<NFTokenCancelOffer>();
126  return f.template operator()<NFTokenAcceptOffer>();
127  case ttCLAWBACK:
128  return f.template operator()<Clawback>();
129  case ttAMM_CREATE:
130  return f.template operator()<AMMCreate>();
131  case ttAMM_DEPOSIT:
132  return f.template operator()<AMMDeposit>();
133  case ttAMM_WITHDRAW:
134  return f.template operator()<AMMWithdraw>();
135  case ttAMM_VOTE:
136  return f.template operator()<AMMVote>();
137  case ttAMM_BID:
138  return f.template operator()<AMMBid>();
139  case ttAMM_DELETE:
140  return f.template operator()<AMMDelete>();
142  return f.template operator()<XChainCreateBridge>();
144  return f.template operator()<BridgeModify>();
146  return f.template operator()<XChainCreateClaimID>();
147  case ttXCHAIN_COMMIT:
148  return f.template operator()<XChainCommit>();
149  case ttXCHAIN_CLAIM:
150  return f.template operator()<XChainClaim>();
152  return f.template operator()<XChainAddClaimAttestation>();
154  return f.template operator()<XChainAddAccountCreateAttestation>();
156  return f.template operator()<XChainCreateAccountCommit>();
157  default:
158  throw UnknownTxnType(txnType);
159  }
160 }
161 } // namespace
162 
163 // Templates so preflight does the right thing with T::ConsequencesFactory.
164 //
165 // This could be done more easily using if constexpr, but Visual Studio
166 // 2017 doesn't handle if constexpr correctly. So once we're no longer
167 // building with Visual Studio 2017 we can consider replacing the four
168 // templates with a single template function that uses if constexpr.
169 //
170 // For Transactor::Normal
171 //
172 
173 // clang-format off
174 // Current formatter for rippled is based on clang-10, which does not handle `requires` clauses
175 template <class T>
176 requires(T::ConsequencesFactory == Transactor::Normal)
178  consequences_helper(PreflightContext const& ctx)
179 {
180  return TxConsequences(ctx.tx);
181 };
182 
183 // For Transactor::Blocker
184 template <class T>
185 requires(T::ConsequencesFactory == Transactor::Blocker)
186 TxConsequences
187  consequences_helper(PreflightContext const& ctx)
188 {
189  return TxConsequences(ctx.tx, TxConsequences::blocker);
190 };
191 
192 // For Transactor::Custom
193 template <class T>
194 requires(T::ConsequencesFactory == Transactor::Custom)
195 TxConsequences
196  consequences_helper(PreflightContext const& ctx)
197 {
198  return T::makeTxConsequences(ctx);
199 };
200 // clang-format on
201 
204 {
205  try
206  {
207  return with_txn_type(ctx.tx.getTxnType(), [&]<typename T>() {
208  auto const tec = T::preflight(ctx);
209  return std::make_pair(
210  tec,
211  isTesSuccess(tec) ? consequences_helper<T>(ctx)
212  : TxConsequences{tec});
213  });
214  }
215  catch (UnknownTxnType const& e)
216  {
217  // Should never happen
218  JLOG(ctx.j.fatal())
219  << "Unknown transaction type in preflight: " << e.txnType;
220  assert(false);
221  return {temUNKNOWN, TxConsequences{temUNKNOWN}};
222  }
223 }
224 
225 static TER
227 {
228  try
229  {
230  // use name hiding to accomplish compile-time polymorphism of static
231  // class functions for Transactor and derived classes.
232  return with_txn_type(ctx.tx.getTxnType(), [&]<typename T>() {
233  // If the transactor requires a valid account and the transaction
234  // doesn't list one, preflight will have already a flagged a
235  // failure.
236  auto const id = ctx.tx.getAccountID(sfAccount);
237 
238  if (id != beast::zero)
239  {
240  TER result = T::checkSeqProxy(ctx.view, ctx.tx, ctx.j);
241 
242  if (result != tesSUCCESS)
243  return result;
244 
245  result = T::checkPriorTxAndLastLedger(ctx);
246 
247  if (result != tesSUCCESS)
248  return result;
249 
250  result = T::checkFee(ctx, calculateBaseFee(ctx.view, ctx.tx));
251 
252  if (result != tesSUCCESS)
253  return result;
254 
255  result = T::checkSign(ctx);
256 
257  if (result != tesSUCCESS)
258  return result;
259  }
260 
261  return T::preclaim(ctx);
262  });
263  }
264  catch (UnknownTxnType const& e)
265  {
266  // Should never happen
267  JLOG(ctx.j.fatal())
268  << "Unknown transaction type in preclaim: " << e.txnType;
269  assert(false);
270  return temUNKNOWN;
271  }
272 }
273 
274 static XRPAmount
275 invoke_calculateBaseFee(ReadView const& view, STTx const& tx)
276 {
277  try
278  {
279  return with_txn_type(tx.getTxnType(), [&]<typename T>() {
280  return T::calculateBaseFee(view, tx);
281  });
282  }
283  catch (UnknownTxnType const& e)
284  {
285  assert(false);
286  return XRPAmount{0};
287  }
288 }
289 
290 TxConsequences::TxConsequences(NotTEC pfresult)
291  : isBlocker_(false)
292  , fee_(beast::zero)
293  , potentialSpend_(beast::zero)
294  , seqProx_(SeqProxy::sequence(0))
295  , sequencesConsumed_(0)
296 {
297  assert(!isTesSuccess(pfresult));
298 }
299 
301  : isBlocker_(false)
302  , fee_(
303  tx[sfFee].native() && !tx[sfFee].negative() ? tx[sfFee].xrp()
304  : beast::zero)
305  , potentialSpend_(beast::zero)
306  , seqProx_(tx.getSeqProxy())
307  , sequencesConsumed_(tx.getSeqProxy().isSeq() ? 1 : 0)
308 {
309 }
310 
312  : TxConsequences(tx)
313 {
314  isBlocker_ = (category == blocker);
315 }
316 
318  : TxConsequences(tx)
319 {
321 }
322 
323 TxConsequences::TxConsequences(STTx const& tx, std::uint32_t sequencesConsumed)
324  : TxConsequences(tx)
325 {
327 }
328 
331 {
332  try
333  {
334  return with_txn_type(ctx.tx.getTxnType(), [&]<typename T>() {
335  T p(ctx);
336  return p();
337  });
338  }
339  catch (UnknownTxnType const& e)
340  {
341  // Should never happen
342  JLOG(ctx.journal.fatal())
343  << "Unknown transaction type in apply: " << e.txnType;
344  assert(false);
345  return {temUNKNOWN, false};
346  }
347 }
348 
349 PreflightResult
351  Application& app,
352  Rules const& rules,
353  STTx const& tx,
354  ApplyFlags flags,
355  beast::Journal j)
356 {
357  PreflightContext const pfctx(app, tx, rules, flags, j);
358  try
359  {
360  return {pfctx, invoke_preflight(pfctx)};
361  }
362  catch (std::exception const& e)
363  {
364  JLOG(j.fatal()) << "apply: " << e.what();
365  return {pfctx, {tefEXCEPTION, TxConsequences{tx}}};
366  }
367 }
368 
369 PreclaimResult
371  PreflightResult const& preflightResult,
372  Application& app,
373  OpenView const& view)
374 {
376  if (preflightResult.rules != view.rules())
377  {
378  auto secondFlight = preflight(
379  app,
380  view.rules(),
381  preflightResult.tx,
382  preflightResult.flags,
383  preflightResult.j);
384  ctx.emplace(
385  app,
386  view,
387  secondFlight.ter,
388  secondFlight.tx,
389  secondFlight.flags,
390  secondFlight.j);
391  }
392  else
393  {
394  ctx.emplace(
395  app,
396  view,
397  preflightResult.ter,
398  preflightResult.tx,
399  preflightResult.flags,
400  preflightResult.j);
401  }
402  try
403  {
404  if (ctx->preflightResult != tesSUCCESS)
405  return {*ctx, ctx->preflightResult};
406  return {*ctx, invoke_preclaim(*ctx)};
407  }
408  catch (std::exception const& e)
409  {
410  JLOG(ctx->j.fatal()) << "apply: " << e.what();
411  return {*ctx, tefEXCEPTION};
412  }
413 }
414 
415 XRPAmount
416 calculateBaseFee(ReadView const& view, STTx const& tx)
417 {
418  return invoke_calculateBaseFee(view, tx);
419 }
420 
421 XRPAmount
422 calculateDefaultBaseFee(ReadView const& view, STTx const& tx)
423 {
424  return Transactor::calculateBaseFee(view, tx);
425 }
426 
428 doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view)
429 {
430  if (preclaimResult.view.seq() != view.seq())
431  {
432  // Logic error from the caller. Don't have enough
433  // info to recover.
434  return {tefEXCEPTION, false};
435  }
436  try
437  {
438  if (!preclaimResult.likelyToClaimFee)
439  return {preclaimResult.ter, false};
440  ApplyContext ctx(
441  app,
442  view,
443  preclaimResult.tx,
444  preclaimResult.ter,
445  calculateBaseFee(view, preclaimResult.tx),
446  preclaimResult.flags,
447  preclaimResult.j);
448  return invoke_apply(ctx);
449  }
450  catch (std::exception const& e)
451  {
452  JLOG(preclaimResult.j.fatal()) << "apply: " << e.what();
453  return {tefEXCEPTION, false};
454  }
455 }
456 
457 } // namespace ripple
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:338
ripple::STTx::getTxnType
TxType getTxnType() const
Definition: STTx.h:179
ripple::ttNFTOKEN_CREATE_OFFER
@ ttNFTOKEN_CREATE_OFFER
This transaction creates a new offer to buy or sell an NFT.
Definition: TxFormats.h:134
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::Transactor::Blocker
@ Blocker
Definition: Transactor.h:101
ripple::ttAMM_DELETE
@ ttAMM_DELETE
This transaction type deletes AMM in the empty state.
Definition: TxFormats.h:161
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:290
std::exception
STL class.
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:633
ripple::ttSIGNER_LIST_SET
@ ttSIGNER_LIST_SET
This transaction type modifies the signer list associated with an account.
Definition: TxFormats.h:95
ripple::ttXCHAIN_CLAIM
@ ttXCHAIN_CLAIM
This transaction completes a crosschain transaction.
Definition: TxFormats.h:170
std::pair
ripple::ttESCROW_CANCEL
@ ttESCROW_CANCEL
This transaction type cancels an existing escrow.
Definition: TxFormats.h:71
ripple::OpenView
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:55
ripple::ttXCHAIN_CREATE_BRIDGE
@ ttXCHAIN_CREATE_BRIDGE
This transactions creates a sidechain.
Definition: TxFormats.h:185
ripple::ttFEE
@ ttFEE
This system-generated transaction type is used to update the network's fee settings.
Definition: TxFormats.h:198
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:29
ripple::ttAMM_DEPOSIT
@ ttAMM_DEPOSIT
This transaction type deposits into an AMM instance.
Definition: TxFormats.h:149
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::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::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:56
ripple::invoke_calculateBaseFee
static XRPAmount invoke_calculateBaseFee(ReadView const &view, STTx const &tx)
Definition: applySteps.cpp:275
ripple::ApplyContext::journal
const beast::Journal journal
Definition: ApplyContext.h:51
ripple::ttXCHAIN_CREATE_CLAIM_ID
@ ttXCHAIN_CREATE_CLAIM_ID
This transactions creates a crosschain sequence number.
Definition: TxFormats.h:164
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:350
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::ttAMENDMENT
@ ttAMENDMENT
This system-generated transaction type is used to update the status of the various amendments.
Definition: TxFormats.h:192
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::requires
requires(T::ConsequencesFactory==Transactor::Normal) TxConsequences consequences_helper(PreflightContext const &ctx)
Definition: applySteps.cpp:176
ripple::invoke_preclaim
static TER invoke_preclaim(PreclaimContext const &ctx)
Definition: applySteps.cpp:226
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
stdexcept
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:204
ripple::doApply
std::pair< TER, bool > doApply(PreclaimResult const &preclaimResult, Application &app, OpenView &view)
Apply a prechecked transaction to an OpenView.
Definition: applySteps.cpp:428
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
ripple::ttXCHAIN_COMMIT
@ ttXCHAIN_COMMIT
This transactions initiates a crosschain transaction.
Definition: TxFormats.h:167
ripple::ttAMM_CREATE
@ ttAMM_CREATE
This transaction type creates an AMM instance.
Definition: TxFormats.h:146
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::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
Definition: TER.h:376
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::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:604
ripple::ttXCHAIN_MODIFY_BRIDGE
@ ttXCHAIN_MODIFY_BRIDGE
This transaction modifies a sidechain.
Definition: TxFormats.h:182
ripple::ttAMM_WITHDRAW
@ ttAMM_WITHDRAW
This transaction type withdraws from an AMM instance.
Definition: TxFormats.h:152
ripple::ttESCROW_FINISH
@ ttESCROW_FINISH
This transaction type completes an existing escrow.
Definition: TxFormats.h:65
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
std::uint32_t
ripple::temUNKNOWN
@ temUNKNOWN
Definition: TER.h:122
ripple::ttXCHAIN_ACCOUNT_CREATE_COMMIT
@ ttXCHAIN_ACCOUNT_CREATE_COMMIT
This transaction initiates a crosschain account create transaction.
Definition: TxFormats.h:173
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:330
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:422
ripple::ttACCOUNT_SET
@ ttACCOUNT_SET
This transaction type adjusts various account settings.
Definition: TxFormats.h:68
ripple::Transactor::Custom
@ Custom
Definition: Transactor.h:101
ripple::preclaim
PreclaimResult preclaim(PreflightResult const &preflightResult, Application &app, OpenView const &view)
Gate a transaction based on static ledger information.
Definition: applySteps.cpp:370
ripple::TxConsequences::sequencesConsumed
std::uint32_t sequencesConsumed() const
Sequences consumed.
Definition: applySteps.h:122
ripple::ReadView
A view into a ledger.
Definition: ReadView.h:54
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition: ReadView.h:122
ripple::ttDEPOSIT_PREAUTH
@ ttDEPOSIT_PREAUTH
This transaction type grants or revokes authorization to transfer funds.
Definition: TxFormats.h:116
ripple::Transactor::Normal
@ Normal
Definition: Transactor.h:101
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::ttAMM_VOTE
@ ttAMM_VOTE
This transaction type votes for the trading fee.
Definition: TxFormats.h:155
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:416
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::PreflightResult::flags
const ApplyFlags flags
From the input - the flags.
Definition: applySteps.h:160
ripple::TxConsequences::sequencesConsumed_
std::uint32_t sequencesConsumed_
Number of sequences consumed.
Definition: applySteps.h:69
ripple::tefEXCEPTION
@ tefEXCEPTION
Definition: TER.h:163
ripple::PreflightContext::tx
STTx const & tx
Definition: Transactor.h:35
ripple::PreflightContext
State information when preflighting a tx.
Definition: Transactor.h:31
ripple::TxConsequences
Class describing the consequences to the account of applying a transaction if the transaction consume...
Definition: applySteps.h:45
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:233
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:203
ripple::ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION
@ ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION
This transaction adds an attestation to a claimid.
Definition: TxFormats.h:179
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::ttAMM_BID
@ ttAMM_BID
This transaction type bids for the auction slot.
Definition: TxFormats.h:158
ripple::PreflightResult::j
const beast::Journal j
From the input - the journal.
Definition: applySteps.h:162
ripple::ttXCHAIN_ADD_CLAIM_ATTESTATION
@ ttXCHAIN_ADD_CLAIM_ATTESTATION
This transaction adds an attestation to a claimid.
Definition: TxFormats.h:176
beast
Definition: base_uint.h:641