Compare commits

..

4 Commits

Author SHA1 Message Date
Mayukha Vadari
4b8dd46aea Remove asset association during vault deletion
Removed the association of asset with the vault during deletion.
2026-03-20 11:46:38 -04:00
Mayukha Vadari
f330c93f19 Update assertion messages for asset and share withdrawals 2026-03-20 10:06:24 -04:00
Mayukha Vadari
c6d12def97 Fix error logging for negative balance in doWithdraw
Log error message for negative broker cover balance.
2026-03-20 10:05:30 -04:00
Mayukha Vadari
45865fcd34 fix: Update error messages in VaultDelete.cpp 2026-03-20 10:04:31 -04:00
2 changed files with 5 additions and 7 deletions

View File

@@ -1364,7 +1364,7 @@ doWithdraw(
j) < amount)
{
// LCOV_EXCL_START
JLOG(j.error()) << "LoanBrokerCoverWithdraw: negative balance of "
JLOG(j.error()) << "doWithdraw: negative balance of "
"broker cover assets.";
return tefINTERNAL;
// LCOV_EXCL_STOP
@@ -3414,7 +3414,7 @@ assetsToSharesWithdraw(
STAmount const& assets,
TruncateShares truncate)
{
XRPL_ASSERT(!assets.negative(), "xrpl::assetsToSharesDeposit : non-negative assets");
XRPL_ASSERT(!assets.negative(), "xrpl::assetsToSharesWithdraw : non-negative assets");
XRPL_ASSERT(
assets.asset() == vault->at(sfAsset),
"xrpl::assetsToSharesWithdraw : assets and vault match");
@@ -3440,7 +3440,7 @@ sharesToAssetsWithdraw(
std::shared_ptr<SLE const> const& issuance,
STAmount const& shares)
{
XRPL_ASSERT(!shares.negative(), "xrpl::sharesToAssetsDeposit : non-negative shares");
XRPL_ASSERT(!shares.negative(), "xrpl::sharesToAssetsWithdraw : non-negative shares");
XRPL_ASSERT(
shares.asset() == vault->at(sfShareMPTID),
"xrpl::sharesToAssetsWithdraw : shares and vault match");

View File

@@ -52,7 +52,7 @@ VaultDelete::preclaim(PreclaimContext const& ctx)
if (!sleMPT)
{
// LCOV_EXCL_START
JLOG(ctx.j.error()) << "VaultDeposit: missing issuance of vault shares.";
JLOG(ctx.j.error()) << "VaultDelete: missing issuance of vault shares.";
return tecOBJECT_NOT_FOUND;
// LCOV_EXCL_STOP
}
@@ -60,7 +60,7 @@ VaultDelete::preclaim(PreclaimContext const& ctx)
if (sleMPT->at(sfIssuer) != vault->getAccountID(sfAccount))
{
// LCOV_EXCL_START
JLOG(ctx.j.error()) << "VaultDeposit: invalid owner of vault shares.";
JLOG(ctx.j.error()) << "VaultDelete: invalid owner of vault shares.";
return tecNO_PERMISSION;
// LCOV_EXCL_STOP
}
@@ -197,8 +197,6 @@ VaultDelete::doApply()
// Destroy the vault.
view().erase(vault);
associateAsset(*vault, asset);
return tesSUCCESS;
}