rippled
Loading...
Searching...
No Matches
View.h
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#ifndef RIPPLE_LEDGER_VIEW_H_INCLUDED
21#define RIPPLE_LEDGER_VIEW_H_INCLUDED
22
23#include <xrpld/ledger/ApplyView.h>
24#include <xrpld/ledger/OpenView.h>
25#include <xrpld/ledger/ReadView.h>
26
27#include <xrpl/beast/utility/Journal.h>
28#include <xrpl/protocol/Indexes.h>
29#include <xrpl/protocol/MPTIssue.h>
30#include <xrpl/protocol/Protocol.h>
31#include <xrpl/protocol/Rate.h>
32#include <xrpl/protocol/STLedgerEntry.h>
33#include <xrpl/protocol/STObject.h>
34#include <xrpl/protocol/Serializer.h>
35#include <xrpl/protocol/TER.h>
36
37#include <functional>
38#include <initializer_list>
39#include <map>
40#include <utility>
41
42namespace ripple {
43
44enum class WaiveTransferFee : bool { No = false, Yes };
45enum class SkipEntry : bool { No = false, Yes };
46
47//------------------------------------------------------------------------------
48//
49// Observers
50//
51//------------------------------------------------------------------------------
52
74[[nodiscard]] bool
75hasExpired(ReadView const& view, std::optional<std::uint32_t> const& exp);
76
79
82
83[[nodiscard]] bool
84isGlobalFrozen(ReadView const& view, AccountID const& issuer);
85
86[[nodiscard]] bool
87isGlobalFrozen(ReadView const& view, MPTIssue const& mptIssue);
88
89[[nodiscard]] bool
90isGlobalFrozen(ReadView const& view, Asset const& asset);
91
92// Note, depth parameter is used to limit the recursion depth
93[[nodiscard]] bool
95 ReadView const& view,
96 AccountID const& account,
97 MPTIssue const& mptShare,
98 int depth);
99
100[[nodiscard]] bool
102 ReadView const& view,
103 AccountID const& account,
104 Currency const& currency,
105 AccountID const& issuer);
106
107[[nodiscard]] inline bool
109 ReadView const& view,
110 AccountID const& account,
111 Issue const& issue)
112{
113 return isIndividualFrozen(view, account, issue.currency, issue.account);
114}
115
116[[nodiscard]] bool
118 ReadView const& view,
119 AccountID const& account,
120 MPTIssue const& mptIssue);
121
122[[nodiscard]] inline bool
124 ReadView const& view,
125 AccountID const& account,
126 Asset const& asset)
127{
128 return std::visit(
129 [&](auto const& issue) {
130 return isIndividualFrozen(view, account, issue);
131 },
132 asset.value());
133}
134
135[[nodiscard]] bool
137 ReadView const& view,
138 AccountID const& account,
139 Currency const& currency,
140 AccountID const& issuer);
141
142[[nodiscard]] inline bool
144 ReadView const& view,
145 AccountID const& account,
146 Issue const& issue,
147 int = 0 /*ignored*/)
148{
149 return isFrozen(view, account, issue.currency, issue.account);
150}
151
152[[nodiscard]] bool
154 ReadView const& view,
155 AccountID const& account,
156 MPTIssue const& mptIssue,
157 int depth = 0);
158
164[[nodiscard]] inline bool
166 ReadView const& view,
167 AccountID const& account,
168 Asset const& asset,
169 int depth = 0)
170{
171 return std::visit(
172 [&](auto const& issue) {
173 return isFrozen(view, account, issue, depth);
174 },
175 asset.value());
176}
177
178[[nodiscard]] bool
180 ReadView const& view,
181 std::initializer_list<AccountID> const& accounts,
182 MPTIssue const& mptIssue,
183 int depth = 0);
184
185[[nodiscard]] inline bool
187 ReadView const& view,
188 std::initializer_list<AccountID> const& accounts,
189 Issue const& issue)
190{
191 for (auto const& account : accounts)
192 {
193 if (isFrozen(view, account, issue.currency, issue.account))
194 return true;
195 }
196 return false;
197}
198
199[[nodiscard]] inline bool
201 ReadView const& view,
202 std::initializer_list<AccountID> const& accounts,
203 Asset const& asset,
204 int depth = 0)
205{
206 return std::visit(
207 [&]<ValidIssueType TIss>(TIss const& issue) {
208 if constexpr (std::is_same_v<TIss, Issue>)
209 return isAnyFrozen(view, accounts, issue);
210 else
211 return isAnyFrozen(view, accounts, issue, depth);
212 },
213 asset.value());
214}
215
216[[nodiscard]] bool
218 ReadView const& view,
219 AccountID const& account,
220 Currency const& currency,
221 AccountID const& issuer);
222
223[[nodiscard]] bool
225 ReadView const& view,
226 AccountID const& account,
227 Issue const& asset,
228 Issue const& asset2);
229
230// Returns the amount an account can spend without going into debt.
231//
232// <-- saAmount: amount of currency held by account. May be negative.
233[[nodiscard]] STAmount
235 ReadView const& view,
236 AccountID const& account,
237 Currency const& currency,
238 AccountID const& issuer,
239 FreezeHandling zeroIfFrozen,
241
242[[nodiscard]] STAmount
244 ReadView const& view,
245 AccountID const& account,
246 Issue const& issue,
247 FreezeHandling zeroIfFrozen,
249
250[[nodiscard]] STAmount
252 ReadView const& view,
253 AccountID const& account,
254 MPTIssue const& mptIssue,
255 FreezeHandling zeroIfFrozen,
256 AuthHandling zeroIfUnauthorized,
258
259[[nodiscard]] STAmount
261 ReadView const& view,
262 AccountID const& account,
263 Asset const& asset,
264 FreezeHandling zeroIfFrozen,
265 AuthHandling zeroIfUnauthorized,
267
268// Returns the amount an account can spend of the currency type saDefault, or
269// returns saDefault if this account is the issuer of the currency in
270// question. Should be used in favor of accountHolds when questioning how much
271// an account can spend while also allowing currency issuers to spend
272// unlimited amounts of their own currency (since they can always issue more).
273[[nodiscard]] STAmount
275 ReadView const& view,
276 AccountID const& id,
277 STAmount const& saDefault,
278 FreezeHandling freezeHandling,
280
281// Return the account's liquid (not reserved) XRP. Generally prefer
282// calling accountHolds() over this interface. However, this interface
283// allows the caller to temporarily adjust the owner count should that be
284// necessary.
285//
286// @param ownerCountAdj positive to add to count, negative to reduce count.
287[[nodiscard]] XRPAmount
289 ReadView const& view,
290 AccountID const& id,
291 std::int32_t ownerCountAdj,
293
295void
297 ReadView const& view,
298 Keylet const& root,
299 std::function<void(std::shared_ptr<SLE const> const&)> const& f);
300
307bool
309 ReadView const& view,
310 Keylet const& root,
311 uint256 const& after,
312 std::uint64_t const hint,
313 unsigned int limit,
314 std::function<bool(std::shared_ptr<SLE const> const&)> const& f);
315
317inline void
319 ReadView const& view,
320 AccountID const& id,
321 std::function<void(std::shared_ptr<SLE const> const&)> const& f)
322{
323 return forEachItem(view, keylet::ownerDir(id), f);
324}
325
332inline bool
334 ReadView const& view,
335 AccountID const& id,
336 uint256 const& after,
337 std::uint64_t const hint,
338 unsigned int limit,
339 std::function<bool(std::shared_ptr<SLE const> const&)> const& f)
340{
341 return forEachItemAfter(view, keylet::ownerDir(id), after, hint, limit, f);
342}
343
349[[nodiscard]] Rate
350transferRate(ReadView const& view, AccountID const& issuer);
351
357[[nodiscard]] Rate
358transferRate(ReadView const& view, MPTID const& issuanceID);
359
363[[nodiscard]] bool
364dirIsEmpty(ReadView const& view, Keylet const& k);
365
366// Return the list of enabled amendments
367[[nodiscard]] std::set<uint256>
368getEnabledAmendments(ReadView const& view);
369
370// Return a map of amendments that have achieved majority
372[[nodiscard]] majorityAmendments_t
374
384[[nodiscard]] std::optional<uint256>
385hashOfSeq(ReadView const& ledger, LedgerIndex seq, beast::Journal journal);
386
399inline LedgerIndex
401{
402 return (requested + 255) & (~255);
403}
404
410[[nodiscard]] bool
412 ReadView const& validLedger,
413 ReadView const& testLedger,
415 char const* reason);
416
417[[nodiscard]] bool
419 uint256 const& validHash,
420 LedgerIndex validIndex,
421 ReadView const& testLedger,
423 char const* reason);
424
425//------------------------------------------------------------------------------
426//
427// Modifiers
428//
429//------------------------------------------------------------------------------
430
432void
434 ApplyView& view,
435 std::shared_ptr<SLE> const& sle,
436 std::int32_t amount,
438
454bool
456 ReadView const& view,
457 uint256 const& root,
459 unsigned int& index,
460 uint256& entry);
461
462bool
464 ApplyView& view,
465 uint256 const& root,
467 unsigned int& index,
468 uint256& entry);
486bool
488 ReadView const& view,
489 uint256 const& root,
491 unsigned int& index,
492 uint256& entry);
493
494bool
495dirNext(
496 ApplyView& view,
497 uint256 const& root,
499 unsigned int& index,
500 uint256& entry);
503[[nodiscard]] std::function<void(SLE::ref)>
504describeOwnerDir(AccountID const& account);
505
506[[nodiscard]] TER
507dirLink(ApplyView& view, AccountID const& owner, std::shared_ptr<SLE>& object);
508
510pseudoAccountAddress(ReadView const& view, uint256 const& pseudoOwnerKey);
511
520[[nodiscard]] Expected<std::shared_ptr<SLE>, TER>
522 ApplyView& view,
523 uint256 const& pseudoOwnerKey,
524 SField const& ownerField);
525
526// Returns true iff sleAcct is a pseudo-account.
527//
528// Returns false if sleAcct is
529// * NOT a pseudo-account OR
530// * NOT a ltACCOUNT_ROOT OR
531// * null pointer
532[[nodiscard]] bool
534
535[[nodiscard]] inline bool
536isPseudoAccount(ReadView const& view, AccountID accountId)
537{
538 return isPseudoAccount(view.read(keylet::account(accountId)));
539}
540
541[[nodiscard]] TER
543 ApplyView& view,
544 AccountID const& accountID,
545 XRPAmount priorBalance,
546 Issue const& issue,
547 beast::Journal journal);
548
549[[nodiscard]] TER
551 ApplyView& view,
552 AccountID const& accountID,
553 XRPAmount priorBalance,
554 MPTIssue const& mptIssue,
555 beast::Journal journal);
556
557[[nodiscard]] inline TER
559 ApplyView& view,
560 AccountID const& accountID,
561 XRPAmount priorBalance,
562 Asset const& asset,
563 beast::Journal journal)
564{
565 return std::visit(
566 [&]<ValidIssueType TIss>(TIss const& issue) -> TER {
567 return addEmptyHolding(
568 view, accountID, priorBalance, issue, journal);
569 },
570 asset.value());
571}
572
573// VFALCO NOTE Both STAmount parameters should just
574// be "Amount", a unit-less number.
575//
580[[nodiscard]] TER
582 ApplyView& view,
583 bool const bSrcHigh,
584 AccountID const& uSrcAccountID,
585 AccountID const& uDstAccountID,
586 uint256 const& uIndex, // --> ripple state entry
587 SLE::ref sleAccount, // --> the account being set.
588 bool const bAuth, // --> authorize account.
589 bool const bNoRipple, // --> others cannot ripple through
590 bool const bFreeze, // --> funds cannot leave
591 bool bDeepFreeze, // --> can neither receive nor send funds
592 STAmount const& saBalance, // --> balance of account being set.
593 // Issuer should be noAccount()
594 STAmount const& saLimit, // --> limit for account being set.
595 // Issuer should be the account being set.
596 std::uint32_t uSrcQualityIn,
597 std::uint32_t uSrcQualityOut,
599
600[[nodiscard]] TER
602 ApplyView& view,
603 AccountID const& accountID,
604 Issue const& issue,
605 beast::Journal journal);
606
607[[nodiscard]] TER
609 ApplyView& view,
610 AccountID const& accountID,
611 MPTIssue const& mptIssue,
612 beast::Journal journal);
613
614[[nodiscard]] inline TER
616 ApplyView& view,
617 AccountID const& accountID,
618 Asset const& asset,
619 beast::Journal journal)
620{
621 return std::visit(
622 [&]<ValidIssueType TIss>(TIss const& issue) -> TER {
623 return removeEmptyHolding(view, accountID, issue, journal);
624 },
625 asset.value());
626}
627
628[[nodiscard]] TER
630 ApplyView& view,
631 std::shared_ptr<SLE> const& sleRippleState,
632 AccountID const& uLowAccountID,
633 AccountID const& uHighAccountID,
635
642// [[nodiscard]] // nodiscard commented out so Flow, BookTip and others compile.
643TER
644offerDelete(ApplyView& view, std::shared_ptr<SLE> const& sle, beast::Journal j);
645
646//------------------------------------------------------------------------------
647
648//
649// Money Transfers
650//
651
652// Direct send w/o fees:
653// - Redeeming IOUs and/or sending sender's own IOUs.
654// - Create trust line of needed.
655// --> bCheckIssuer : normally require issuer to be involved.
656// [[nodiscard]] // nodiscard commented out so DirectStep.cpp compiles.
657
661TER
663 ApplyView& view,
664 AccountID const& uSenderID,
665 AccountID const& uReceiverID,
666 STAmount const& saAmount,
667 bool bCheckIssuer,
669
673[[nodiscard]] TER
675 ApplyView& view,
676 AccountID const& from,
677 AccountID const& to,
678 STAmount const& saAmount,
681
682[[nodiscard]] TER
684 ApplyView& view,
685 AccountID const& account,
686 STAmount const& amount,
687 Issue const& issue,
689
690[[nodiscard]] TER
692 ApplyView& view,
693 AccountID const& account,
694 STAmount const& amount,
695 Issue const& issue,
697
698[[nodiscard]] TER
700 ApplyView& view,
701 AccountID const& from,
702 AccountID const& to,
703 STAmount const& amount,
705
706/* Check if MPToken exists:
707 * - StrongAuth - before checking lsfMPTRequireAuth is set
708 * - WeakAuth - after checking if lsfMPTRequireAuth is set
709 */
710enum class MPTAuthType : bool { StrongAuth = true, WeakAuth = false };
711
717[[nodiscard]] TER
718requireAuth(ReadView const& view, Issue const& issue, AccountID const& account);
719
738[[nodiscard]] TER
740 ReadView const& view,
741 MPTIssue const& mptIssue,
742 AccountID const& account,
744 int depth = 0);
745
746[[nodiscard]] TER inline requireAuth(
747 ReadView const& view,
748 Asset const& asset,
749 AccountID const& account,
751{
752 return std::visit(
753 [&]<ValidIssueType TIss>(TIss const& issue_) {
754 if constexpr (std::is_same_v<TIss, Issue>)
755 return requireAuth(view, issue_, account);
756 else
757 return requireAuth(view, issue_, account, authType);
758 },
759 asset.value());
760}
761
785[[nodiscard]] TER
787 ApplyView& view,
788 MPTID const& mptIssuanceID,
789 AccountID const& account,
790 XRPAmount const& priorBalance,
792
797[[nodiscard]] TER
799 ReadView const& view,
800 MPTIssue const& mptIssue,
801 AccountID const& from,
802 AccountID const& to);
803
810 uint256 const&,
819[[nodiscard]] TER
821 ApplyView& view,
822 Keylet const& ownerDirKeylet,
823 EntryDeleter const& deleter,
825 std::optional<std::uint16_t> maxNodesToDelete = std::nullopt);
826
831[[nodiscard]] TER
833 ApplyView& view,
834 std::shared_ptr<SLE> sleState,
835 std::optional<AccountID> const& ammAccountID,
837
838// From the perspective of a vault,
839// return the number of shares to give the depositor
840// when they deposit a fixed amount of assets.
841[[nodiscard]] STAmount
843 std::shared_ptr<SLE const> const& vault,
844 std::shared_ptr<SLE const> const& issuance,
845 STAmount const& assets);
846
847// From the perspective of a vault,
848// return the number of shares to demand from the depositor
849// when they ask to withdraw a fixed amount of assets.
850[[nodiscard]] STAmount
852 std::shared_ptr<SLE const> const& vault,
853 std::shared_ptr<SLE const> const& issuance,
854 STAmount const& assets);
855
856// From the perspective of a vault,
857// return the number of assets to give the depositor
858// when they redeem a fixed amount of shares.
859[[nodiscard]] STAmount
861 std::shared_ptr<SLE const> const& vault,
862 std::shared_ptr<SLE const> const& issuance,
863 STAmount const& shares);
864
871bool
873
874} // namespace ripple
875
876#endif
Provide a light-weight way to check active() before string formatting.
Definition: Journal.h:205
A generic endpoint for log messages.
Definition: Journal.h:60
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:144
constexpr value_type const & value() const
Definition: Asset.h:156
A currency issued by an account.
Definition: Issue.h:36
AccountID account
Definition: Issue.h:39
Currency currency
Definition: Issue.h:38
A view into a ledger.
Definition: ReadView.h:52
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
std::shared_ptr< STLedgerEntry > const & ref
Definition: STLedgerEntry.h:38
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:177
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:367
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition: AccountID.h:49
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1083
std::uint32_t LedgerIndex
A ledger index.
Definition: Protocol.h:130
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:554
FreezeHandling
Controls the treatment of frozen account balances.
Definition: View.h:78
@ fhZERO_IF_FROZEN
Definition: View.h:78
@ fhIGNORE_FREEZE
Definition: View.h:78
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:148
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2677
LedgerIndex getCandidateLedger(LedgerIndex requested)
Find a ledger index from which we could easily get the requested ledger.
Definition: View.h:400
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:216
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2563
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:126
base_uint< 256 > uint256
Definition: base_uint.h:558
bool dirNext(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:137
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account)
Check if the account lacks required authorization.
Definition: View.cpp:2268
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:350
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:948
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:762
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2152
base_uint< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
Definition: UintTypes.h:64
AuthHandling
Controls the treatment of unauthorized MPT balances.
Definition: View.h:81
@ ahZERO_IF_UNAUTHORIZED
Definition: View.h:81
@ ahIGNORE_AUTH
Definition: View.h:81
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1037
SkipEntry
Definition: View.h:45
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2225
TER enforceMPTokenAuthorization(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
Enforce account has MPToken to match its authorization.
Definition: View.cpp:2373
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1459
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:250
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:908
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2465
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Definition: UintTypes.h:56
bool isVaultPseudoAccountFrozen(ReadView const &view, AccountID const &account, MPTIssue const &mptShare, int depth)
Definition: View.cpp:310
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2052
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:159
WaiveTransferFee
Definition: View.h:44
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1215
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1419
TER addEmptyHolding(ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1142
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1056
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:387
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)
Definition: View.cpp:376
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:925
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:54
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:684
MPTAuthType
Definition: View.h:710
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2696
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2658
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2485
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:656
Number root(Number f, unsigned d)
Definition: Number.cpp:636
STAmount assetsToSharesDeposit(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2640
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:176
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2612
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, int depth)
Definition: View.cpp:285
TERSubset< CanCvtToTER > TER
Definition: TER.h:643
TER removeEmptyHolding(ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1334
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:786
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:894
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1128
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:1978
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1045
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:618
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:185
A pair of SHAMap key and LedgerEntryType.
Definition: Keylet.h:39
Set the sequence number on a JTx.
Definition: seq.h:34
T visit(T... args)