xrpld
Loading...
Searching...
No Matches
xrpl::ValidMPTPayment Class Reference

Verify public MPT amount and outstanding amount accounting. More...

#include <MPTInvariant.h>

Collaboration diagram for xrpl::ValidMPTPayment:

Classes

struct  MPTData

Public Member Functions

void visitEntry (bool isDelete, SLE::const_ref before, SLE::const_ref after)
 Track MPT amount and outstanding amount changes.
bool finalize (STTx const &tx, TER const result, XRPAmount const fee, ReadView const &view, beast::Journal const &j)
 Verify public MPT payment accounting invariants.

Private Types

enum class  Order { Before = 0 , After = 1 }

Private Attributes

bool overflow_ {false}
hash_map< uint192, MPTDatadata_

Detailed Description

Verify public MPT amount and outstanding amount accounting.

Checks that OutstandingAmount does not exceed MaximumAmount and that OutstandingAmount after application equals OutstandingAmount before application plus the net holder balance delta.

Definition at line 76 of file MPTInvariant.h.

Member Enumeration Documentation

◆ Order

enum class xrpl::ValidMPTPayment::Order
strongprivate
Enumerator
Before 
After 

Definition at line 78 of file MPTInvariant.h.

Member Function Documentation

◆ visitEntry()

void xrpl::ValidMPTPayment::visitEntry ( bool isDelete,
SLE::const_ref before,
SLE::const_ref after )

Track MPT amount and outstanding amount changes.

Parameters
isDeleteWhether the ledger entry is being deleted.
beforeThe ledger entry before transaction application.
afterThe ledger entry after transaction application.

Definition at line 407 of file MPTInvariant.cpp.

◆ finalize()

bool xrpl::ValidMPTPayment::finalize ( STTx const & tx,
TER const result,
XRPAmount const fee,
ReadView const & view,
beast::Journal const & j )

Verify public MPT payment accounting invariants.

Parameters
txThe transaction being checked.
resultThe transaction result code.
feeThe fee charged by the transaction.
viewThe ledger view after transaction application.
jJournal used for diagnostics.
Returns
true if the invariant checks pass, otherwise false.

Definition at line 469 of file MPTInvariant.cpp.

Member Data Documentation

◆ overflow_

bool xrpl::ValidMPTPayment::overflow_ {false}
private

Definition at line 87 of file MPTInvariant.h.

◆ data_

hash_map<uint192, MPTData> xrpl::ValidMPTPayment::data_
private

Definition at line 89 of file MPTInvariant.h.