mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
The invariant check system had grown into a single monolithic file pair containing 24 invariant checker classes. The large `InvariantCheck.cpp` file was a frequent source of merge conflicts and difficult to navigate. This refactoring improves maintainability and readability with zero behavioral changes. In particular, this change: - Splits `InvariantCheck.h` and `InvariantCheck.cpp` into 10 focused header/source pairs organized by domain under a new `invariants/` subdirectory. - Extracts the shared `Privilege` enum and `hasPrivilege()` function into a dedicated `InvariantCheckPrivilege.h` header, so domain-specific files can reference them independently.
32 lines
740 B
C++
32 lines
740 B
C++
#pragma once
|
|
|
|
#include <xrpl/beast/utility/Journal.h>
|
|
#include <xrpl/ledger/ReadView.h>
|
|
#include <xrpl/protocol/STTx.h>
|
|
#include <xrpl/protocol/TER.h>
|
|
|
|
#include <cstdint>
|
|
|
|
namespace xrpl {
|
|
|
|
class ValidMPTIssuance
|
|
{
|
|
std::uint32_t mptIssuancesCreated_ = 0;
|
|
std::uint32_t mptIssuancesDeleted_ = 0;
|
|
|
|
std::uint32_t mptokensCreated_ = 0;
|
|
std::uint32_t mptokensDeleted_ = 0;
|
|
// non-MPT transactions may attempt to create
|
|
// MPToken by an issuer
|
|
bool mptCreatedByIssuer_ = false;
|
|
|
|
public:
|
|
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&);
|
|
};
|
|
|
|
} // namespace xrpl
|