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

#include <MPTInvariant.h>

Collaboration diagram for xrpl::ValidMPTIssuance:

Public Member Functions

void visitEntry (bool isDelete, SLE::const_ref before, SLE::const_ref after)
 Track MPT issuance and holding creations, deletions, and mutations.
bool finalize (STTx const &tx, TER const result, XRPAmount const fee, ReadView const &view, beast::Journal const &j) const
 Verify MPT issuance invariants after transaction application.

Private Attributes

std::uint32_t mptIssuancesCreated_ = 0
std::uint32_t mptIssuancesDeleted_ = 0
std::uint32_t mptokensCreated_ = 0
std::uint32_t mptokensDeleted_ = 0
bool mptCreatedByIssuer_ = false
bool referenceHoldingSetOnCreate_ = false
 sfReferenceHolding is intended to be set exactly once at vault creation and immutable thereafter; true when that rule was violated.
bool referenceHoldingMutated_ = false
 True when sfReferenceHolding was mutated on an existing MPTokenIssuance.
std::vector< std::shared_ptr< SLE const > > deletedHoldings_
 MPTokens and RippleStates deleted during apply.

Detailed Description

Definition at line 15 of file MPTInvariant.h.

Member Function Documentation

◆ visitEntry()

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

Track MPT issuance and holding creations, deletions, and mutations.

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

Definition at line 69 of file MPTInvariant.cpp.

◆ finalize()

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

Verify MPT issuance invariants after transaction application.

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 129 of file MPTInvariant.cpp.

Member Data Documentation

◆ mptIssuancesCreated_

std::uint32_t xrpl::ValidMPTIssuance::mptIssuancesCreated_ = 0
private

Definition at line 17 of file MPTInvariant.h.

◆ mptIssuancesDeleted_

std::uint32_t xrpl::ValidMPTIssuance::mptIssuancesDeleted_ = 0
private

Definition at line 18 of file MPTInvariant.h.

◆ mptokensCreated_

std::uint32_t xrpl::ValidMPTIssuance::mptokensCreated_ = 0
private

Definition at line 20 of file MPTInvariant.h.

◆ mptokensDeleted_

std::uint32_t xrpl::ValidMPTIssuance::mptokensDeleted_ = 0
private

Definition at line 21 of file MPTInvariant.h.

◆ mptCreatedByIssuer_

bool xrpl::ValidMPTIssuance::mptCreatedByIssuer_ = false
private

Definition at line 24 of file MPTInvariant.h.

◆ referenceHoldingSetOnCreate_

bool xrpl::ValidMPTIssuance::referenceHoldingSetOnCreate_ = false
private

sfReferenceHolding is intended to be set exactly once at vault creation and immutable thereafter; true when that rule was violated.

Definition at line 28 of file MPTInvariant.h.

◆ referenceHoldingMutated_

bool xrpl::ValidMPTIssuance::referenceHoldingMutated_ = false
private

True when sfReferenceHolding was mutated on an existing MPTokenIssuance.

Definition at line 31 of file MPTInvariant.h.

◆ deletedHoldings_

std::vector<std::shared_ptr<SLE const> > xrpl::ValidMPTIssuance::deletedHoldings_
private

MPTokens and RippleStates deleted during apply.

finalize() checks each holder's AccountRoot to detect vault pseudo-account holdings deleted outside VaultDelete. All these checks are gated on fixCleanup3_2_0.

Definition at line 36 of file MPTInvariant.h.