Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libxrpl/tx/invariants/VaultInvariant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ ValidVault::finalize(

if (afterVault.assetsAvailable < kZero)
{
JLOG(j.fatal()) << "Invariant failed: assets available must be positive";
JLOG(j.fatal()) << "Invariant failed: assets available must not be negative";
result = false;
}

Expand All @@ -485,13 +485,13 @@ ValidVault::finalize(

if (afterVault.assetsTotal < kZero)
{
JLOG(j.fatal()) << "Invariant failed: assets outstanding must be positive";
JLOG(j.fatal()) << "Invariant failed: assets outstanding must not be negative";
result = false;
}

if (afterVault.assetsMaximum < kZero)
{
JLOG(j.fatal()) << "Invariant failed: assets maximum must be positive";
JLOG(j.fatal()) << "Invariant failed: assets maximum must not be negative";
result = false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/tx/transactors/lending/LoanPay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ LoanPay::doApply()
XRPL_ASSERT_PARTS(
vaultBalanceAfter >= beast::kZero && brokerBalanceAfter >= beast::kZero,
"xrpl::LoanPay::doApply",
"positive vault and broker balances");
"non-negative vault and broker balances");
XRPL_ASSERT_PARTS(
vaultBalanceAfter >= vaultBalanceBefore,
"xrpl::LoanPay::doApply",
Expand Down
8 changes: 4 additions & 4 deletions src/test/app/Invariants_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3260,9 +3260,9 @@ class Invariants_test : public beast::unit_test::Suite
"set must not change assets available",
"set must not change shares outstanding",
"set must not change vault balance",
"assets available must be positive",
"assets available must not be negative",
"assets available must not be greater than assets outstanding",
"assets outstanding must be positive"},
"assets outstanding must not be negative"},
[&](Account const& a1, Account const& a2, ApplyContext& ac) {
auto const keylet = keylet::vault(a1.id(), ac.view().seq());
auto sleVault = ac.view().peek(keylet);
Expand Down Expand Up @@ -3389,7 +3389,7 @@ class Invariants_test : public beast::unit_test::Suite
TxAccount::A2);

doInvariantCheck(
{"assets maximum must be positive"},
{"assets maximum must not be negative"},
[&](Account const& a1, Account const& a2, ApplyContext& ac) {
auto const keylet = keylet::vault(a1.id(), ac.view().seq());
return kAdjust(ac.view(), keylet, kArgs(a2.id(), 0, [&](Adjustments& sample) {
Expand Down Expand Up @@ -3577,7 +3577,7 @@ class Invariants_test : public beast::unit_test::Suite

doInvariantCheck(
{
"assets maximum must be positive",
"assets maximum must not be negative",
"create operation must not have updated a vault",
},
[&](Account const& a1, Account const& a2, ApplyContext& ac) {
Expand Down
Loading