Add ValidMPTTransfer invariant.

This commit is contained in:
Gregory Tsipenyuk
2026-04-06 13:34:05 -04:00
parent 56c9d1d497
commit a91e8ddad7
3 changed files with 132 additions and 1 deletions

View File

@@ -399,7 +399,8 @@ using InvariantChecks = std::tuple<
ValidLoanBroker,
ValidLoan,
ValidVault,
ValidMPTPayment>;
ValidMPTPayment,
ValidMPTTransfer>;
/**
* @brief get a tuple of all invariant checks

View File

@@ -56,4 +56,22 @@ public:
finalize(STTx const&, TER const, XRPAmount const, ReadView const&, beast::Journal const&);
};
class ValidMPTTransfer
{
struct Value
{
std::optional<std::uint64_t> amtBefore;
std::optional<std::uint64_t> amtAfter;
};
// MPTID: {holder: Value}
hash_map<uint192, hash_map<AccountID, Value>> amount_;
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