mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 07:26:51 +00:00
style: Fix clang-tidy include-cleaner, braces, and return-move warnings
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <xrpl/protocol/AccountID.h>
|
||||
#include <xrpl/protocol/Asset.h>
|
||||
#include <xrpl/protocol/LedgerFormats.h> // IWYU pragma: keep
|
||||
#include <xrpl/protocol/Protocol.h>
|
||||
#include <xrpl/protocol/Rules.h>
|
||||
#include <xrpl/protocol/SField.h>
|
||||
#include <xrpl/protocol/STAmount.h>
|
||||
|
||||
@@ -191,7 +191,7 @@ determineClawAmount(
|
||||
// Use the vaultAsset here, because it will be the right type in all
|
||||
// circumstances. The amount may be an IOU indicating the pseudo-account's
|
||||
// asset, which is correct, but not what is needed here.
|
||||
STAmount const requested = [&] {
|
||||
STAmount requested = [&] {
|
||||
if (!amount || *amount == beast::kZero)
|
||||
return STAmount{vaultAsset, maxClawAmount};
|
||||
Number const magnitude{*amount};
|
||||
@@ -204,7 +204,7 @@ determineClawAmount(
|
||||
return requested;
|
||||
|
||||
// Negate so the posterior is CoverAvailable minus amount.
|
||||
STAmount const rounded = -roundToPosteriorBrokerCoverScale(
|
||||
STAmount rounded = -roundToPosteriorBrokerCoverScale(
|
||||
vaultSle, sleBroker, -requested, Number::RoundingMode::TowardsZero);
|
||||
if (rounded == beast::kZero)
|
||||
return std::unexpected(tecPRECISION_LOSS);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <xrpl/ledger/helpers/VaultHelpers.h>
|
||||
#include <xrpl/protocol/Feature.h>
|
||||
#include <xrpl/protocol/Indexes.h>
|
||||
#include <xrpl/protocol/Protocol.h>
|
||||
#include <xrpl/protocol/SField.h>
|
||||
#include <xrpl/protocol/STAmount.h>
|
||||
#include <xrpl/protocol/STLedgerEntry.h>
|
||||
@@ -106,10 +107,12 @@ LoanBrokerCoverDeposit::preclaim(PreclaimContext const& ctx)
|
||||
// failing only in doApply.
|
||||
auto const roundedAmount = [&]() -> STAmount {
|
||||
if (getVaultVersion(vault) == VaultVersion::FixedPrecision)
|
||||
{
|
||||
return roundToPosteriorBrokerCoverScale(
|
||||
vault, sleBroker, amount, Number::RoundingMode::TowardsZero);
|
||||
}
|
||||
if (!fix320Enabled)
|
||||
return amount;
|
||||
return STAmount{amount};
|
||||
|
||||
return roundToScale(
|
||||
amount,
|
||||
@@ -165,8 +168,10 @@ LoanBrokerCoverDeposit::doApply()
|
||||
bool const fix320Enabled = view().rules().enabled(fixCleanup3_2_0);
|
||||
auto const amount = [&]() -> STAmount {
|
||||
if (getVaultVersion(vault) == VaultVersion::FixedPrecision)
|
||||
{
|
||||
return roundToPosteriorBrokerCoverScale(
|
||||
vault, broker, tx[sfAmount], Number::RoundingMode::TowardsZero);
|
||||
}
|
||||
if (!fix320Enabled)
|
||||
return tx[sfAmount];
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ LoanBrokerCoverWithdraw::preclaim(PreclaimContext const& ctx)
|
||||
|
||||
auto const roundedAmount = [&] {
|
||||
if (getVaultVersion(vault) != VaultVersion::FixedPrecision)
|
||||
return amount;
|
||||
return STAmount{amount};
|
||||
// Negate so the posterior is CoverAvailable minus amount.
|
||||
return -roundToPosteriorBrokerCoverScale(
|
||||
vault, sleBroker, -amount, Number::RoundingMode::TowardsZero);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <xrpl/protocol/Indexes.h>
|
||||
#include <xrpl/protocol/Protocol.h>
|
||||
#include <xrpl/protocol/SField.h>
|
||||
#include <xrpl/protocol/STAmount.h>
|
||||
#include <xrpl/protocol/STLedgerEntry.h>
|
||||
#include <xrpl/protocol/STNumber.h>
|
||||
#include <xrpl/protocol/STTakesAsset.h>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <xrpl/protocol/SeqProxy.h>
|
||||
#include <xrpl/protocol/TER.h>
|
||||
#include <xrpl/protocol/TxFlags.h>
|
||||
#include <xrpl/protocol/UintTypes.h>
|
||||
#include <xrpl/protocol/Units.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
Reference in New Issue
Block a user