#include <VaultInvariant.h>
Definition at line 38 of file VaultInvariant.h.
◆ computeVaultMinScale()
Compute the minimum STAmount scale for rounding invariant calculations.
Post-amendment (fixCleanup3_2_0) this is simply the posterior assetsTotal scale. Pre-amendment it is the coarsest scale across vaultDelta and both asset-field deltas.
- Parameters
-
| vaultDelta | Delta of the vault's asset balance for this transaction. |
| rules | Active ledger rules (used to check the amendment). |
- Returns
- The minimum scale to apply when rounding vault-related amounts.
Definition at line 255 of file VaultInvariant.cpp.
◆ deltaAssets()
Return the vault-asset balance-change delta for an account.
Looks up the ledger-entry delta recorded during visitEntry for the account entry (XRP), trust line (IOU), or MPToken (MPT) that corresponds to the vault asset held by id.
- Parameters
-
| id | Account whose asset delta is requested. |
- Returns
- The delta, or
std::nullopt if the entry was not touched.
Definition at line 186 of file VaultInvariant.cpp.
◆ deltaAssetsTxAccount()
Return the vault-asset delta for the transaction's sending account, adjusted for the fee.
Calls deltaAssets for tx[sfAccount] and, for non-delegated XRP transactions, adds the consumed fee back so the invariant sees the net asset movement rather than the fee-reduced balance change.
- Parameters
-
| tx | The transaction being applied. |
| fee | Fee charged by this transaction. |
- Returns
- The fee-adjusted delta, or
std::nullopt if the net delta is zero or the account entry was not touched.
Definition at line 218 of file VaultInvariant.cpp.
◆ deltaShares()
Return the vault-share balance-change delta for an account.
For the vault's pseudo-account the MPTokenIssuance outstanding-amount delta is returned; for all other accounts the MPToken delta is returned.
- Parameters
-
| id | Account whose share delta is requested. |
- Returns
- The delta, or
std::nullopt if the entry was not touched.
Definition at line 236 of file VaultInvariant.cpp.
◆ isVaultEmpty()
| bool xrpl::ValidVault::isVaultEmpty |
( |
Vault const & | vault | ) |
|
|
staticnodiscardprivate |
Check whether a vault holds no assets.
- Parameters
-
| vault | Snapshot of the vault to test. |
- Returns
true when both assetsAvailable and assetsTotal are zero.
Definition at line 249 of file VaultInvariant.cpp.
◆ computeCoarsestScale()
◆ visitEntry()
◆ finalize()
◆ kZero
| Number xrpl::ValidVault::kZero {} |
|
staticconstexprprivate |
◆ afterVault_
◆ afterMPTs_
◆ beforeVault_
◆ beforeMPTs_
◆ deltas_