xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
tx
invariants
LoanInvariant.h
1
#pragma once
2
3
#include <xrpl/beast/utility/Journal.h>
4
#include <xrpl/ledger/ReadView.h>
5
#include <xrpl/protocol/STLedgerEntry.h>
6
#include <xrpl/protocol/STTx.h>
7
#include <xrpl/protocol/TER.h>
8
#include <xrpl/protocol/XRPAmount.h>
9
10
#include <
utility
>
11
#include <
vector
>
12
13
namespace
xrpl
{
14
49
class
ValidLoan
50
{
51
// Pair is <before, after>. After is used for most of the checks, except
52
// those that check changed values.
53
std::vector<std::pair<SLE::const_pointer, SLE::const_pointer>
>
loans_
;
54
// Loans removed from the ledger, in the same <before, after> form as loans_.
55
// Note that `after` holds the erased entry, so it is not null.
56
std::vector<std::pair<SLE::const_pointer, SLE::const_pointer>
>
deletedLoans_
;
57
58
public
:
59
void
60
visitEntry
(
bool
,
SLE::ConstRef
,
SLE::ConstRef
);
61
62
bool
63
finalize
(
STTx
const
&,
TER
const
,
XRPAmount
const
,
ReadView
const
&,
beast::Journal
const
&);
64
};
65
66
}
// namespace xrpl
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:41
xrpl::STLedgerEntry::ConstRef
std::shared_ptr< STLedgerEntry const > const & ConstRef
Definition
STLedgerEntry.h:37
xrpl::STTx
Definition
STTx.h:43
xrpl::ValidLoan
Invariants: Loans are internally consistent.
Definition
LoanInvariant.h:50
xrpl::ValidLoan::visitEntry
void visitEntry(bool, SLE::ConstRef, SLE::ConstRef)
Definition
LoanInvariant.cpp:27
xrpl::ValidLoan::deletedLoans_
std::vector< std::pair< SLE::const_pointer, SLE::const_pointer > > deletedLoans_
Definition
LoanInvariant.h:56
xrpl::ValidLoan::loans_
std::vector< std::pair< SLE::const_pointer, SLE::const_pointer > > loans_
Definition
LoanInvariant.h:53
xrpl::ValidLoan::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition
LoanInvariant.cpp:43
xrpl::XRPAmount
Definition
XRPAmount.h:28
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::TER
TERSubset< CanCvtToTER > TER
Definition
TER.h:654
utility
vector
Generated by
1.17.0