rippled
Loading...
Searching...
No Matches
AccountSet.cpp
1#include <xrpl/basics/Log.h>
2#include <xrpl/ledger/View.h>
3#include <xrpl/ledger/helpers/DirectoryHelpers.h>
4#include <xrpl/protocol/Feature.h>
5#include <xrpl/protocol/Indexes.h>
6#include <xrpl/protocol/PublicKey.h>
7#include <xrpl/protocol/Quality.h>
8#include <xrpl/protocol/st.h>
9#include <xrpl/tx/transactors/account/AccountSet.h>
10#include <xrpl/tx/transactors/delegate/DelegateUtils.h>
11
12namespace xrpl {
13
14TxConsequences
16{
17 // The AccountSet may be a blocker, but only if it sets or clears
18 // specific account flags.
19 auto getTxConsequencesCategory = [](STTx const& tx) {
20 if (std::uint32_t const uTxFlags = tx.getFlags();
21 uTxFlags & (tfRequireAuth | tfOptionalAuth))
23
24 if (auto const uSetFlag = tx[~sfSetFlag]; uSetFlag &&
25 (*uSetFlag == asfRequireAuth || *uSetFlag == asfDisableMaster ||
26 *uSetFlag == asfAccountTxnID))
28
29 if (auto const uClearFlag = tx[~sfClearFlag]; uClearFlag &&
30 (*uClearFlag == asfRequireAuth || *uClearFlag == asfDisableMaster ||
31 *uClearFlag == asfAccountTxnID))
33
35 };
36
37 return TxConsequences{ctx.tx, getTxConsequencesCategory(ctx.tx)};
38}
39
42{
43 return tfAccountSetMask;
44}
45
48{
49 auto& tx = ctx.tx;
50 auto& j = ctx.j;
51
52 std::uint32_t const uTxFlags = tx.getFlags();
53
54 std::uint32_t const uSetFlag = tx.getFieldU32(sfSetFlag);
55 std::uint32_t const uClearFlag = tx.getFieldU32(sfClearFlag);
56
57 if ((uSetFlag != 0) && (uSetFlag == uClearFlag))
58 {
59 JLOG(j.trace()) << "Malformed transaction: Set and clear same flag.";
60 return temINVALID_FLAG;
61 }
62
63 //
64 // RequireAuth
65 //
66 bool const bSetRequireAuth = ((uTxFlags & tfRequireAuth) != 0u) || (uSetFlag == asfRequireAuth);
67 bool const bClearRequireAuth =
68 ((uTxFlags & tfOptionalAuth) != 0u) || (uClearFlag == asfRequireAuth);
69
70 if (bSetRequireAuth && bClearRequireAuth)
71 {
72 JLOG(j.trace()) << "Malformed transaction: Contradictory flags set.";
73 return temINVALID_FLAG;
74 }
75
76 //
77 // RequireDestTag
78 //
79 bool const bSetRequireDest =
80 ((uTxFlags & tfRequireDestTag) != 0u) || (uSetFlag == asfRequireDest);
81 bool const bClearRequireDest =
82 ((uTxFlags & tfOptionalDestTag) != 0u) || (uClearFlag == asfRequireDest);
83
84 if (bSetRequireDest && bClearRequireDest)
85 {
86 JLOG(j.trace()) << "Malformed transaction: Contradictory flags set.";
87 return temINVALID_FLAG;
88 }
89
90 //
91 // DisallowXRP
92 //
93 bool const bSetDisallowXRP = ((uTxFlags & tfDisallowXRP) != 0u) || (uSetFlag == asfDisallowXRP);
94 bool const bClearDisallowXRP =
95 ((uTxFlags & tfAllowXRP) != 0u) || (uClearFlag == asfDisallowXRP);
96
97 if (bSetDisallowXRP && bClearDisallowXRP)
98 {
99 JLOG(j.trace()) << "Malformed transaction: Contradictory flags set.";
100 return temINVALID_FLAG;
101 }
102
103 // TransferRate
104 if (tx.isFieldPresent(sfTransferRate))
105 {
106 std::uint32_t const uRate = tx.getFieldU32(sfTransferRate);
107
108 if ((uRate != 0u) && (uRate < QUALITY_ONE))
109 {
110 JLOG(j.trace()) << "Malformed transaction: Transfer rate too small.";
112 }
113
114 if (uRate > 2 * QUALITY_ONE)
115 {
116 JLOG(j.trace()) << "Malformed transaction: Transfer rate too large.";
118 }
119 }
120
121 // TickSize
122 if (tx.isFieldPresent(sfTickSize))
123 {
124 auto uTickSize = tx[sfTickSize];
125 if ((uTickSize != 0u) &&
126 ((uTickSize < Quality::minTickSize) || (uTickSize > Quality::maxTickSize)))
127 {
128 JLOG(j.trace()) << "Malformed transaction: Bad tick size.";
129 return temBAD_TICK_SIZE;
130 }
131 }
132
133 if (auto const mk = tx[~sfMessageKey])
134 {
135 if (!mk->empty() && !publicKeyType({mk->data(), mk->size()}))
136 {
137 JLOG(j.trace()) << "Invalid message key specified.";
138 return telBAD_PUBLIC_KEY;
139 }
140 }
141
142 if (auto const domain = tx[~sfDomain]; domain && domain->size() > maxDomainLength)
143 {
144 JLOG(j.trace()) << "domain too long";
145 return telBAD_DOMAIN;
146 }
147
148 // Configure authorized minting account:
149 if (uSetFlag == asfAuthorizedNFTokenMinter && !tx.isFieldPresent(sfNFTokenMinter))
150 return temMALFORMED;
151
152 if (uClearFlag == asfAuthorizedNFTokenMinter && tx.isFieldPresent(sfNFTokenMinter))
153 return temMALFORMED;
154
155 return tesSUCCESS;
156}
157
158NotTEC
160{
161 // AccountSet is prohibited to be granted on a transaction level,
162 // but some granular permissions are allowed.
163 auto const delegate = tx[~sfDelegate];
164 if (!delegate)
165 return tesSUCCESS;
166
167 auto const delegateKey = keylet::delegate(tx[sfAccount], *delegate);
168 auto const sle = view.read(delegateKey);
169
170 if (!sle)
172
174 loadGranularPermission(sle, ttACCOUNT_SET, granularPermissions);
175
176 auto const uSetFlag = tx.getFieldU32(sfSetFlag);
177 auto const uClearFlag = tx.getFieldU32(sfClearFlag);
178 auto const uTxFlags = tx.getFlags();
179 // We don't support any flag based granular permission under
180 // AccountSet transaction. If any delegated account is trying to
181 // update the flag on behalf of another account, it is not
182 // authorized.
183 if (uSetFlag != 0 || uClearFlag != 0 || ((uTxFlags & tfUniversalMask) != 0u))
185
186 if (tx.isFieldPresent(sfEmailHash) && !granularPermissions.contains(AccountEmailHashSet))
188
189 if (tx.isFieldPresent(sfWalletLocator) || tx.isFieldPresent(sfNFTokenMinter))
191
192 if (tx.isFieldPresent(sfMessageKey) && !granularPermissions.contains(AccountMessageKeySet))
194
195 if (tx.isFieldPresent(sfDomain) && !granularPermissions.contains(AccountDomainSet))
197
198 if (tx.isFieldPresent(sfTransferRate) && !granularPermissions.contains(AccountTransferRateSet))
200
201 if (tx.isFieldPresent(sfTickSize) && !granularPermissions.contains(AccountTickSizeSet))
203
204 return tesSUCCESS;
205}
206
207TER
209{
210 auto const id = ctx.tx[sfAccount];
211
212 std::uint32_t const uTxFlags = ctx.tx.getFlags();
213
214 auto const sle = ctx.view.read(keylet::account(id));
215 if (!sle)
216 return terNO_ACCOUNT;
217
218 std::uint32_t const uFlagsIn = sle->getFieldU32(sfFlags);
219
220 std::uint32_t const uSetFlag = ctx.tx.getFieldU32(sfSetFlag);
221
222 // legacy AccountSet flags
223 bool const bSetRequireAuth = ((uTxFlags & tfRequireAuth) != 0u) || (uSetFlag == asfRequireAuth);
224
225 //
226 // RequireAuth
227 //
228 if (bSetRequireAuth && ((uFlagsIn & lsfRequireAuth) == 0u))
229 {
230 if (!dirIsEmpty(ctx.view, keylet::ownerDir(id)))
231 {
232 JLOG(ctx.j.trace()) << "Retry: Owner directory not empty.";
233 return ((ctx.flags & tapRETRY) != 0u) ? TER{terOWNERS} : TER{tecOWNERS};
234 }
235 }
236
237 //
238 // Clawback
239 //
240 if (ctx.view.rules().enabled(featureClawback))
241 {
242 if (uSetFlag == asfAllowTrustLineClawback)
243 {
244 if ((uFlagsIn & lsfNoFreeze) != 0u)
245 {
246 JLOG(ctx.j.trace()) << "Can't set Clawback if NoFreeze is set";
247 return tecNO_PERMISSION;
248 }
249
250 if (!dirIsEmpty(ctx.view, keylet::ownerDir(id)))
251 {
252 JLOG(ctx.j.trace()) << "Owner directory not empty.";
253 return tecOWNERS;
254 }
255 }
256 else if (uSetFlag == asfNoFreeze)
257 {
258 // Cannot set NoFreeze if clawback is enabled
259 if ((uFlagsIn & lsfAllowTrustLineClawback) != 0u)
260 {
261 JLOG(ctx.j.trace()) << "Can't set NoFreeze if clawback is enabled";
262 return tecNO_PERMISSION;
263 }
264 }
265 }
266
267 return tesSUCCESS;
268}
269
270TER
272{
273 auto const sle = view().peek(keylet::account(account_));
274 if (!sle)
275 return tefINTERNAL; // LCOV_EXCL_LINE
276
277 std::uint32_t const uFlagsIn = sle->getFieldU32(sfFlags);
278 std::uint32_t uFlagsOut = uFlagsIn;
279
280 STTx const& tx{ctx_.tx};
281 std::uint32_t const uSetFlag{tx.getFieldU32(sfSetFlag)};
282 std::uint32_t const uClearFlag{tx.getFieldU32(sfClearFlag)};
283
284 // legacy AccountSet flags
285 std::uint32_t const uTxFlags{tx.getFlags()};
286 bool const bSetRequireDest{
287 ((uTxFlags & tfRequireDestTag) != 0u) || (uSetFlag == asfRequireDest)};
288 bool const bClearRequireDest{
289 ((uTxFlags & tfOptionalDestTag) != 0u) || (uClearFlag == asfRequireDest)};
290 bool const bSetRequireAuth{((uTxFlags & tfRequireAuth) != 0u) || (uSetFlag == asfRequireAuth)};
291 bool const bClearRequireAuth{
292 ((uTxFlags & tfOptionalAuth) != 0u) || (uClearFlag == asfRequireAuth)};
293 bool const bSetDisallowXRP{((uTxFlags & tfDisallowXRP) != 0u) || (uSetFlag == asfDisallowXRP)};
294 bool const bClearDisallowXRP{((uTxFlags & tfAllowXRP) != 0u) || (uClearFlag == asfDisallowXRP)};
295
296 bool const sigWithMaster{[&tx, &acct = account_]() {
297 auto const spk = tx.getSigningPubKey();
298
299 if (publicKeyType(makeSlice(spk)))
300 {
301 PublicKey const signingPubKey(makeSlice(spk));
302
303 if (calcAccountID(signingPubKey) == acct)
304 return true;
305 }
306 return false;
307 }()};
308
309 //
310 // RequireAuth
311 //
312 if (bSetRequireAuth && ((uFlagsIn & lsfRequireAuth) == 0u))
313 {
314 JLOG(j_.trace()) << "Set RequireAuth.";
315 uFlagsOut |= lsfRequireAuth;
316 }
317
318 if (bClearRequireAuth && ((uFlagsIn & lsfRequireAuth) != 0u))
319 {
320 JLOG(j_.trace()) << "Clear RequireAuth.";
321 uFlagsOut &= ~lsfRequireAuth;
322 }
323
324 //
325 // RequireDestTag
326 //
327 if (bSetRequireDest && ((uFlagsIn & lsfRequireDestTag) == 0u))
328 {
329 JLOG(j_.trace()) << "Set lsfRequireDestTag.";
330 uFlagsOut |= lsfRequireDestTag;
331 }
332
333 if (bClearRequireDest && ((uFlagsIn & lsfRequireDestTag) != 0u))
334 {
335 JLOG(j_.trace()) << "Clear lsfRequireDestTag.";
336 uFlagsOut &= ~lsfRequireDestTag;
337 }
338
339 //
340 // DisallowXRP
341 //
342 if (bSetDisallowXRP && ((uFlagsIn & lsfDisallowXRP) == 0u))
343 {
344 JLOG(j_.trace()) << "Set lsfDisallowXRP.";
345 uFlagsOut |= lsfDisallowXRP;
346 }
347
348 if (bClearDisallowXRP && ((uFlagsIn & lsfDisallowXRP) != 0u))
349 {
350 JLOG(j_.trace()) << "Clear lsfDisallowXRP.";
351 uFlagsOut &= ~lsfDisallowXRP;
352 }
353
354 //
355 // DisableMaster
356 //
357 if ((uSetFlag == asfDisableMaster) && ((uFlagsIn & lsfDisableMaster) == 0u))
358 {
359 if (!sigWithMaster)
360 {
361 JLOG(j_.trace()) << "Must use master key to disable master key.";
362 return tecNEED_MASTER_KEY;
363 }
364
365 if ((!sle->isFieldPresent(sfRegularKey)) && (!view().peek(keylet::signers(account_))))
366 {
367 // Account has no regular key or multi-signer signer list.
369 }
370
371 JLOG(j_.trace()) << "Set lsfDisableMaster.";
372 uFlagsOut |= lsfDisableMaster;
373 }
374
375 if ((uClearFlag == asfDisableMaster) && ((uFlagsIn & lsfDisableMaster) != 0u))
376 {
377 JLOG(j_.trace()) << "Clear lsfDisableMaster.";
378 uFlagsOut &= ~lsfDisableMaster;
379 }
380
381 //
382 // DefaultRipple
383 //
384 if (uSetFlag == asfDefaultRipple)
385 {
386 JLOG(j_.trace()) << "Set lsfDefaultRipple.";
387 uFlagsOut |= lsfDefaultRipple;
388 }
389 else if (uClearFlag == asfDefaultRipple)
390 {
391 JLOG(j_.trace()) << "Clear lsfDefaultRipple.";
392 uFlagsOut &= ~lsfDefaultRipple;
393 }
394
395 //
396 // NoFreeze
397 //
398 if (uSetFlag == asfNoFreeze)
399 {
400 if (!sigWithMaster && ((uFlagsIn & lsfDisableMaster) == 0u))
401 {
402 JLOG(j_.trace()) << "Must use master key to set NoFreeze.";
403 return tecNEED_MASTER_KEY;
404 }
405
406 JLOG(j_.trace()) << "Set NoFreeze flag";
407 uFlagsOut |= lsfNoFreeze;
408 }
409
410 // Anyone may set global freeze
411 if (uSetFlag == asfGlobalFreeze)
412 {
413 JLOG(j_.trace()) << "Set GlobalFreeze flag";
414 uFlagsOut |= lsfGlobalFreeze;
415 }
416
417 // If you have set NoFreeze, you may not clear GlobalFreeze
418 // This prevents those who have set NoFreeze from using
419 // GlobalFreeze strategically.
420 if ((uSetFlag != asfGlobalFreeze) && (uClearFlag == asfGlobalFreeze) &&
421 ((uFlagsOut & lsfNoFreeze) == 0))
422 {
423 JLOG(j_.trace()) << "Clear GlobalFreeze flag";
424 uFlagsOut &= ~lsfGlobalFreeze;
425 }
426
427 //
428 // Track transaction IDs signed by this account in its root
429 //
430 if ((uSetFlag == asfAccountTxnID) && !sle->isFieldPresent(sfAccountTxnID))
431 {
432 JLOG(j_.trace()) << "Set AccountTxnID.";
433 sle->makeFieldPresent(sfAccountTxnID);
434 }
435
436 if ((uClearFlag == asfAccountTxnID) && sle->isFieldPresent(sfAccountTxnID))
437 {
438 JLOG(j_.trace()) << "Clear AccountTxnID.";
439 sle->makeFieldAbsent(sfAccountTxnID);
440 }
441
442 //
443 // DepositAuth
444 //
445 if (uSetFlag == asfDepositAuth)
446 {
447 JLOG(j_.trace()) << "Set lsfDepositAuth.";
448 uFlagsOut |= lsfDepositAuth;
449 }
450 else if (uClearFlag == asfDepositAuth)
451 {
452 JLOG(j_.trace()) << "Clear lsfDepositAuth.";
453 uFlagsOut &= ~lsfDepositAuth;
454 }
455
456 //
457 // EmailHash
458 //
459 if (tx.isFieldPresent(sfEmailHash))
460 {
461 uint128 const uHash = tx.getFieldH128(sfEmailHash);
462
463 if (!uHash)
464 {
465 JLOG(j_.trace()) << "unset email hash";
466 sle->makeFieldAbsent(sfEmailHash);
467 }
468 else
469 {
470 JLOG(j_.trace()) << "set email hash";
471 sle->setFieldH128(sfEmailHash, uHash);
472 }
473 }
474
475 //
476 // WalletLocator
477 //
478 if (tx.isFieldPresent(sfWalletLocator))
479 {
480 uint256 const uHash = tx.getFieldH256(sfWalletLocator);
481
482 if (!uHash)
483 {
484 JLOG(j_.trace()) << "unset wallet locator";
485 sle->makeFieldAbsent(sfWalletLocator);
486 }
487 else
488 {
489 JLOG(j_.trace()) << "set wallet locator";
490 sle->setFieldH256(sfWalletLocator, uHash);
491 }
492 }
493
494 //
495 // MessageKey
496 //
497 if (tx.isFieldPresent(sfMessageKey))
498 {
499 Blob const messageKey = tx.getFieldVL(sfMessageKey);
500
501 if (messageKey.empty())
502 {
503 JLOG(j_.debug()) << "clear message key";
504 sle->makeFieldAbsent(sfMessageKey);
505 }
506 else
507 {
508 JLOG(j_.debug()) << "set message key";
509 sle->setFieldVL(sfMessageKey, messageKey);
510 }
511 }
512
513 //
514 // Domain
515 //
516 if (tx.isFieldPresent(sfDomain))
517 {
518 Blob const domain = tx.getFieldVL(sfDomain);
519
520 if (domain.empty())
521 {
522 JLOG(j_.trace()) << "unset domain";
523 sle->makeFieldAbsent(sfDomain);
524 }
525 else
526 {
527 JLOG(j_.trace()) << "set domain";
528 sle->setFieldVL(sfDomain, domain);
529 }
530 }
531
532 //
533 // TransferRate
534 //
535 if (tx.isFieldPresent(sfTransferRate))
536 {
537 std::uint32_t const uRate = tx.getFieldU32(sfTransferRate);
538
539 if (uRate == 0 || uRate == QUALITY_ONE)
540 {
541 JLOG(j_.trace()) << "unset transfer rate";
542 sle->makeFieldAbsent(sfTransferRate);
543 }
544 else
545 {
546 JLOG(j_.trace()) << "set transfer rate";
547 sle->setFieldU32(sfTransferRate, uRate);
548 }
549 }
550
551 //
552 // TickSize
553 //
554 if (tx.isFieldPresent(sfTickSize))
555 {
556 auto uTickSize = tx[sfTickSize];
557 if ((uTickSize == 0) || (uTickSize == Quality::maxTickSize))
558 {
559 JLOG(j_.trace()) << "unset tick size";
560 sle->makeFieldAbsent(sfTickSize);
561 }
562 else
563 {
564 JLOG(j_.trace()) << "set tick size";
565 sle->setFieldU8(sfTickSize, uTickSize);
566 }
567 }
568
569 // Configure authorized minting account:
570 if (uSetFlag == asfAuthorizedNFTokenMinter)
571 sle->setAccountID(sfNFTokenMinter, ctx_.tx[sfNFTokenMinter]);
572
573 if (uClearFlag == asfAuthorizedNFTokenMinter && sle->isFieldPresent(sfNFTokenMinter))
574 sle->makeFieldAbsent(sfNFTokenMinter);
575
576 if (uSetFlag == asfDisallowIncomingNFTokenOffer)
577 {
578 uFlagsOut |= lsfDisallowIncomingNFTokenOffer;
579 }
580 else if (uClearFlag == asfDisallowIncomingNFTokenOffer)
581 {
582 uFlagsOut &= ~lsfDisallowIncomingNFTokenOffer;
583 }
584
585 if (uSetFlag == asfDisallowIncomingCheck)
586 {
587 uFlagsOut |= lsfDisallowIncomingCheck;
588 }
589 else if (uClearFlag == asfDisallowIncomingCheck)
590 {
591 uFlagsOut &= ~lsfDisallowIncomingCheck;
592 }
593
594 if (uSetFlag == asfDisallowIncomingPayChan)
595 {
596 uFlagsOut |= lsfDisallowIncomingPayChan;
597 }
598 else if (uClearFlag == asfDisallowIncomingPayChan)
599 {
600 uFlagsOut &= ~lsfDisallowIncomingPayChan;
601 }
602
603 if (uSetFlag == asfDisallowIncomingTrustline)
604 {
605 uFlagsOut |= lsfDisallowIncomingTrustline;
606 }
607 else if (uClearFlag == asfDisallowIncomingTrustline)
608 {
609 uFlagsOut &= ~lsfDisallowIncomingTrustline;
610 }
611
612 // Set or clear flags for disallowing escrow
613 if (ctx_.view().rules().enabled(featureTokenEscrow))
614 {
615 if (uSetFlag == asfAllowTrustLineLocking)
616 {
617 uFlagsOut |= lsfAllowTrustLineLocking;
618 }
619 else if (uClearFlag == asfAllowTrustLineLocking)
620 {
621 uFlagsOut &= ~lsfAllowTrustLineLocking;
622 }
623 }
624
625 // Set flag for clawback
626 if (ctx_.view().rules().enabled(featureClawback) && uSetFlag == asfAllowTrustLineClawback)
627 {
628 JLOG(j_.trace()) << "set allow clawback";
629 uFlagsOut |= lsfAllowTrustLineClawback;
630 }
631
632 if (uFlagsIn != uFlagsOut)
633 sle->setFieldU32(sfFlags, uFlagsOut);
634
635 ctx_.view().update(sle);
636
637 return tesSUCCESS;
638}
639
640} // namespace xrpl
Stream debug() const
Definition Journal.h:301
Stream trace() const
Severity stream access functions.
Definition Journal.h:295
TER doApply() override
static NotTEC preflight(PreflightContext const &ctx)
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
static NotTEC checkPermission(ReadView const &view, STTx const &tx)
static TxConsequences makeTxConsequences(PreflightContext const &ctx)
STTx const & tx
ApplyView & view()
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
A public key.
Definition PublicKey.h:42
A view into a ledger.
Definition ReadView.h:31
virtual Rules const & rules() const =0
Returns the tx processing rules.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
Definition Rules.cpp:120
std::uint32_t getFieldU32(SField const &field) const
Definition STObject.cpp:593
bool isFieldPresent(SField const &field) const
Definition STObject.cpp:456
std::uint32_t getFlags() const
Definition STObject.cpp:509
AccountID const account_
Definition Transactor.h:116
beast::Journal const j_
Definition Transactor.h:114
ApplyView & view()
Definition Transactor.h:132
ApplyContext & ctx_
Definition Transactor.h:112
Class describing the consequences to the account of applying a transaction if the transaction consume...
Definition applySteps.h:38
@ normal
Moves currency around, creates offers, etc.
Definition applySteps.h:44
@ blocker
Affects the ability of subsequent transactions to claim a fee.
Definition applySteps.h:47
Integers of any length that is a multiple of 32-bits.
Definition base_uint.h:66
T contains(T... args)
T empty(T... args)
Keylet signers(AccountID const &account) noexcept
A SignerList.
Definition Indexes.cpp:295
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition Indexes.cpp:336
Keylet delegate(AccountID const &account, AccountID const &authorizedAccount) noexcept
A keylet for Delegate object.
Definition Indexes.cpp:418
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:165
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
@ telBAD_DOMAIN
Definition TER.h:33
@ telBAD_PUBLIC_KEY
Definition TER.h:35
@ terOWNERS
Definition TER.h:200
@ terNO_DELEGATE_PERMISSION
Definition TER.h:210
@ terNO_ACCOUNT
Definition TER.h:197
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
@ tefINTERNAL
Definition TER.h:153
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
void loadGranularPermission(std::shared_ptr< SLE const > const &delegate, TxType const &type, std::unordered_set< GranularPermissionType > &granularPermissions)
Load the granular permissions granted to the delegate account for the specified transaction type.
AccountID calcAccountID(PublicKey const &pk)
std::size_t constexpr maxDomainLength
The maximum length of a domain.
Definition Protocol.h:215
@ tapRETRY
Definition ApplyView.h:19
@ temINVALID_FLAG
Definition TER.h:91
@ temMALFORMED
Definition TER.h:67
@ temBAD_TRANSFER_RATE
Definition TER.h:87
@ temBAD_TICK_SIZE
Definition TER.h:98
@ tecNEED_MASTER_KEY
Definition TER.h:289
@ tecNO_ALTERNATIVE_KEY
Definition TER.h:277
@ tecOWNERS
Definition TER.h:279
@ tecNO_PERMISSION
Definition TER.h:286
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition Slice.h:215
constexpr FlagValue tfUniversalMask
Definition TxFlags.h:43
@ tesSUCCESS
Definition TER.h:225
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:57
ReadView const & view
Definition Transactor.h:60
beast::Journal const j
Definition Transactor.h:65
State information when preflighting a tx.
Definition Transactor.h:14
beast::Journal const j
Definition Transactor.h:21