rippled
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/STTx.h>
7#include <xrpl/protocol/TER.h>
8
9#include <map>
10#include <vector>
11
12namespace xrpl {
13
23{
24 // Not all of these elements will necessarily be populated. Remaining items
25 // will be looked up as needed.
27 {
29 // After is used for most of the checks, except
30 // those that check changed values.
32 };
33 // Collect all the LoanBrokers found directly or indirectly through
34 // pseudo-accounts. Key is the brokerID / index. It will be used to find the
35 // LoanBroker object if brokerBefore and brokerAfter are nullptr
37 // Collect all the modified trust lines. Their high and low accounts will be
38 // loaded to look for LoanBroker pseudo-accounts.
40 // Collect all the modified MPTokens. Their accounts will be loaded to look
41 // for LoanBroker pseudo-accounts.
43
44 static bool
45 goodZeroDirectory(ReadView const& view, SLE::const_ref dir, beast::Journal const& j);
46
47public:
48 void
50
51 bool
52 finalize(STTx const&, TER const, XRPAmount const, ReadView const&, beast::Journal const&);
53};
54
55} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
A view into a ledger.
Definition ReadView.h:31
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, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
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