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

Invariant: frozen trust line balance change is not allowed. More...

#include <FreezeInvariant.h>

Collaboration diagram for xrpl::TransfersNotFrozen:

Classes

struct  BalanceChange
struct  IssuerChanges

Public Member Functions

void visitEntry (bool, SLE::ConstRef, SLE::ConstRef)
bool finalize (STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)

Private Types

using ByIssuer = std::map<Issue, IssuerChanges>

Private Member Functions

bool isValidEntry (SLE::ConstRef before, SLE::ConstRef after)
void recordBalance (Issue const &issue, BalanceChange change)
void recordBalanceChanges (SLE::ConstRef after, STAmount const &balanceChange)
SLE::const_pointer findIssuer (AccountID const &issuerID, ReadView const &view)

Static Private Member Functions

static STAmount calculateBalanceChange (SLE::ConstRef before, SLE::ConstRef after, bool isDelete)
static bool validateIssuerChanges (SLE::ConstRef issuer, IssuerChanges const &changes, STTx const &tx, beast::Journal const &j, bool enforce, bool fixOverrideFreeze, std::optional< LoanDefaultFreezeExemptAccounts > const &loanDefaultAccounts)
static bool validateFrozenState (BalanceChange const &change, bool high, STTx const &tx, beast::Journal const &j, bool enforce, bool globalFreeze, bool fixOverrideFreeze, std::optional< LoanDefaultFreezeExemptAccounts > const &loanDefaultAccounts)

Private Attributes

ByIssuer balanceChanges_
std::map< AccountID, SLE::const_pointer const > possibleIssuers_

Detailed Description

Invariant: frozen trust line balance change is not allowed.

We iterate all affected trust lines and ensure that they don't have unexpected change of balance if they're frozen.

Definition at line 26 of file FreezeInvariant.h.

Member Typedef Documentation

◆ ByIssuer

Definition at line 40 of file FreezeInvariant.h.

Member Function Documentation

◆ visitEntry()

void xrpl::TransfersNotFrozen::visitEntry ( bool isDelete,
SLE::ConstRef before,
SLE::ConstRef after )

Definition at line 28 of file FreezeInvariant.cpp.

◆ finalize()

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

Definition at line 55 of file FreezeInvariant.cpp.

◆ isValidEntry()

bool xrpl::TransfersNotFrozen::isValidEntry ( SLE::ConstRef before,
SLE::ConstRef after )
private

Definition at line 117 of file FreezeInvariant.cpp.

◆ calculateBalanceChange()

STAmount xrpl::TransfersNotFrozen::calculateBalanceChange ( SLE::ConstRef before,
SLE::ConstRef after,
bool isDelete )
staticprivate

Definition at line 142 of file FreezeInvariant.cpp.

◆ recordBalance()

void xrpl::TransfersNotFrozen::recordBalance ( Issue const & issue,
BalanceChange change )
private

Definition at line 167 of file FreezeInvariant.cpp.

◆ recordBalanceChanges()

void xrpl::TransfersNotFrozen::recordBalanceChanges ( SLE::ConstRef after,
STAmount const & balanceChange )
private

Definition at line 185 of file FreezeInvariant.cpp.

◆ findIssuer()

SLE::const_pointer xrpl::TransfersNotFrozen::findIssuer ( AccountID const & issuerID,
ReadView const & view )
private

Definition at line 202 of file FreezeInvariant.cpp.

◆ validateIssuerChanges()

bool xrpl::TransfersNotFrozen::validateIssuerChanges ( SLE::ConstRef issuer,
IssuerChanges const & changes,
STTx const & tx,
beast::Journal const & j,
bool enforce,
bool fixOverrideFreeze,
std::optional< LoanDefaultFreezeExemptAccounts > const & loanDefaultAccounts )
staticprivate

Definition at line 213 of file FreezeInvariant.cpp.

◆ validateFrozenState()

bool xrpl::TransfersNotFrozen::validateFrozenState ( BalanceChange const & change,
bool high,
STTx const & tx,
beast::Journal const & j,
bool enforce,
bool globalFreeze,
bool fixOverrideFreeze,
std::optional< LoanDefaultFreezeExemptAccounts > const & loanDefaultAccounts )
staticprivate

Definition at line 264 of file FreezeInvariant.cpp.

Member Data Documentation

◆ balanceChanges_

ByIssuer xrpl::TransfersNotFrozen::balanceChanges_
private

Definition at line 41 of file FreezeInvariant.h.

◆ possibleIssuers_

std::map<AccountID, SLE::const_pointer const> xrpl::TransfersNotFrozen::possibleIssuers_
private

Definition at line 43 of file FreezeInvariant.h.