xrpld
Loading...
Searching...
No Matches
LoanBrokerInvariant.h
1#pragma once
2
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/protocol/STLedgerEntry.h>
7#include <xrpl/protocol/STTx.h>
8#include <xrpl/protocol/TER.h>
9#include <xrpl/protocol/XRPAmount.h>
10
11#include <map>
12#include <vector>
13
14namespace xrpl {
15
25{
26 // Not all of these elements will necessarily be populated. Remaining items
27 // will be looked up as needed.
29 {
31 // After is used for most of the checks, except
32 // those that check changed values.
34 };
35 // Collect all the LoanBrokers found directly or indirectly through
36 // pseudo-accounts. Key is the brokerID / index. It will be used to find the
37 // LoanBroker object if brokerBefore and brokerAfter are nullptr
39 // Collect all the modified trust lines. Their high and low accounts will be
40 // loaded to look for LoanBroker pseudo-accounts.
42 // Collect all the modified MPTokens. Their accounts will be loaded to look
43 // for LoanBroker pseudo-accounts.
45
46 static bool
47 goodZeroDirectory(ReadView const& view, SLE::const_ref dir, beast::Journal const& j);
48
49public:
50 void
52
53 bool
54 finalize(STTx const&, TER const, XRPAmount const, ReadView const&, beast::Journal const&);
55};
56
57} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
A view into a ledger.
Definition ReadView.h:41
std::shared_ptr< STLedgerEntry const > const & const_ref
std::shared_ptr< STLedgerEntry const > const_pointer
Invariants: Loan brokers are internally consistent.
std::map< uint256, BrokerInfo > brokers_
static bool goodZeroDirectory(ReadView const &view, SLE::const_ref dir, beast::Journal const &j)
void visitEntry(bool, SLE::const_ref, SLE::const_ref)
std::vector< SLE::const_pointer > mpts_
std::vector< SLE::const_pointer > lines_
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
TERSubset< CanCvtToTER > TER
Definition TER.h:647