rippled
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
xrpl::TransfersNotFrozen Class Reference

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

#include <InvariantCheck.h>

Collaboration diagram for xrpl::TransfersNotFrozen:
Collaboration graph
[legend]

Classes

struct  BalanceChange
 
struct  IssuerChanges
 

Public Member Functions

void visitEntry (bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
 
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 (std::shared_ptr< SLE const > const &before, std::shared_ptr< SLE const > const &after)
 
STAmount calculateBalanceChange (std::shared_ptr< SLE const > const &before, std::shared_ptr< SLE const > const &after, bool isDelete)
 
void recordBalance (Issue const &issue, BalanceChange change)
 
void recordBalanceChanges (std::shared_ptr< SLE const > const &after, STAmount const &balanceChange)
 
std::shared_ptr< SLE const > findIssuer (AccountID const &issuerID, ReadView const &view)
 
bool validateIssuerChanges (std::shared_ptr< SLE const > const &issuer, IssuerChanges const &changes, STTx const &tx, beast::Journal const &j, bool enforce)
 
bool validateFrozenState (BalanceChange const &change, bool high, STTx const &tx, beast::Journal const &j, bool enforce, bool globalFreeze)
 

Private Attributes

ByIssuer balanceChanges_
 
std::map< AccountID, std::shared_ptr< SLE const > 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 222 of file InvariantCheck.h.

Member Typedef Documentation

◆ ByIssuer

Definition at line 236 of file InvariantCheck.h.

Member Function Documentation

◆ visitEntry()

void xrpl::TransfersNotFrozen::visitEntry ( bool  isDelete,
std::shared_ptr< SLE const > const &  before,
std::shared_ptr< SLE const > const &  after 
)

Definition at line 665 of file InvariantCheck.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 695 of file InvariantCheck.cpp.

◆ isValidEntry()

bool xrpl::TransfersNotFrozen::isValidEntry ( std::shared_ptr< SLE const > const &  before,
std::shared_ptr< SLE const > const &  after 
)
private

Definition at line 750 of file InvariantCheck.cpp.

◆ calculateBalanceChange()

STAmount xrpl::TransfersNotFrozen::calculateBalanceChange ( std::shared_ptr< SLE const > const &  before,
std::shared_ptr< SLE const > const &  after,
bool  isDelete 
)
private

Definition at line 775 of file InvariantCheck.cpp.

◆ recordBalance()

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

Definition at line 803 of file InvariantCheck.cpp.

◆ recordBalanceChanges()

void xrpl::TransfersNotFrozen::recordBalanceChanges ( std::shared_ptr< SLE const > const &  after,
STAmount const &  balanceChange 
)
private

Definition at line 817 of file InvariantCheck.cpp.

◆ findIssuer()

std::shared_ptr< SLE const > xrpl::TransfersNotFrozen::findIssuer ( AccountID const &  issuerID,
ReadView const &  view 
)
private

Definition at line 830 of file InvariantCheck.cpp.

◆ validateIssuerChanges()

bool xrpl::TransfersNotFrozen::validateIssuerChanges ( std::shared_ptr< SLE const > const &  issuer,
IssuerChanges const &  changes,
STTx const &  tx,
beast::Journal const &  j,
bool  enforce 
)
private

Definition at line 841 of file InvariantCheck.cpp.

◆ validateFrozenState()

bool xrpl::TransfersNotFrozen::validateFrozenState ( BalanceChange const &  change,
bool  high,
STTx const &  tx,
beast::Journal const &  j,
bool  enforce,
bool  globalFreeze 
)
private

Definition at line 882 of file InvariantCheck.cpp.

Member Data Documentation

◆ balanceChanges_

ByIssuer xrpl::TransfersNotFrozen::balanceChanges_
private

Definition at line 237 of file InvariantCheck.h.

◆ possibleIssuers_

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

Definition at line 239 of file InvariantCheck.h.