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

Invariant: Validates counts of NFTokens after all transaction types. More...

#include <NFTInvariant.h>

Collaboration diagram for xrpl::NFTokenCountTracking:

Public Member Functions

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

Private Attributes

std::uint32_t beforeMintedTotal_ = 0
std::uint32_t beforeBurnedTotal_ = 0
std::uint32_t afterMintedTotal_ = 0
std::uint32_t afterBurnedTotal_ = 0

Detailed Description

Invariant: Validates counts of NFTokens after all transaction types.

The following checks are made:

  • The number of minted or burned NFTokens can only be changed by NFTokenMint or NFTokenBurn transactions.
  • A successful NFTokenMint must increase the number of NFTokens.
  • A failed NFTokenMint must not change the number of minted NFTokens.
  • An NFTokenMint transaction cannot change the number of burned NFTokens.
  • A successful NFTokenBurn must increase the number of burned NFTokens.
  • A failed NFTokenBurn must not change the number of burned NFTokens.
  • An NFTokenBurn transaction cannot change the number of minted NFTokens.

Definition at line 55 of file NFTInvariant.h.

Member Function Documentation

◆ visitEntry()

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

Definition at line 186 of file NFTInvariant.cpp.

◆ finalize()

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

Definition at line 202 of file NFTInvariant.cpp.

Member Data Documentation

◆ beforeMintedTotal_

std::uint32_t xrpl::NFTokenCountTracking::beforeMintedTotal_ = 0
private

Definition at line 57 of file NFTInvariant.h.

◆ beforeBurnedTotal_

std::uint32_t xrpl::NFTokenCountTracking::beforeBurnedTotal_ = 0
private

Definition at line 58 of file NFTInvariant.h.

◆ afterMintedTotal_

std::uint32_t xrpl::NFTokenCountTracking::afterMintedTotal_ = 0
private

Definition at line 59 of file NFTInvariant.h.

◆ afterBurnedTotal_

std::uint32_t xrpl::NFTokenCountTracking::afterBurnedTotal_ = 0
private

Definition at line 60 of file NFTInvariant.h.