mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-23 07:00:21 +00:00
fix clang-tidy issues
This commit is contained in:
@@ -834,9 +834,6 @@ transResultInfo(TERRaw code, std::string& token, std::string& text);
|
||||
std::string
|
||||
transToken(TERRaw code);
|
||||
|
||||
std::string
|
||||
transHuman(TERRaw code);
|
||||
|
||||
std::optional<TER>
|
||||
transCode(std::string const& token);
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
|
||||
: registry(registry)
|
||||
, view(view)
|
||||
, preflightResult(preflightResult)
|
||||
, preflightResult(std::move(preflightResult))
|
||||
, flags(flags)
|
||||
, tx(tx)
|
||||
, parentBatchId(parentBatchId)
|
||||
|
||||
@@ -28,7 +28,7 @@ struct ApplyResult
|
||||
std::optional<TxMeta> metadata;
|
||||
|
||||
ApplyResult(TER t, bool a, std::optional<TxMeta> m = std::nullopt)
|
||||
: ter(t), applied(a), metadata(std::move(m))
|
||||
: ter(std::move(t)), applied(a), metadata(std::move(m))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@@ -505,7 +505,7 @@ class FlowException : public std::runtime_error
|
||||
public:
|
||||
TER ter;
|
||||
|
||||
FlowException(TER t, std::string const& msg) : std::runtime_error(msg), ter(t)
|
||||
FlowException(TER t, std::string const& msg) : std::runtime_error(msg), ter(std::move(t))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/check/CheckCancel.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Zero.h>
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
#include <xrpl/ledger/View.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/credentials/CredentialDelete.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
#include <xrpl/ledger/helpers/CredentialHelpers.h>
|
||||
#include <xrpl/protocol/AccountID.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/delegate/DelegateSet.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/helpers/AccountRootHelpers.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/dex/AMMDelete.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Zero.h>
|
||||
#include <xrpl/ledger/Sandbox.h>
|
||||
#include <xrpl/ledger/helpers/AMMHelpers.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/did/DIDDelete.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
#include <xrpl/ledger/ReadView.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/escrow/EscrowCancel.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
#include <xrpl/ledger/View.h>
|
||||
#include <xrpl/ledger/helpers/AccountRootHelpers.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/escrow/EscrowFinish.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/Slice.h>
|
||||
#include <xrpl/basics/chrono.h>
|
||||
#include <xrpl/conditions/Condition.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/lending/LoanDelete.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/Number.h> // IWYU pragma: keep
|
||||
#include <xrpl/beast/utility/Zero.h>
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/Number.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/beast/utility/Zero.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <xrpl/tx/transactors/oracle/OracleDelete.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
#include <xrpl/ledger/helpers/AccountRootHelpers.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Zero.h>
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <xrpl/ledger/helpers/AccountRootHelpers.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/sponsor/SponsorshipSet.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/beast/utility/Zero.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/sponsor/SponsorshipTransfer.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/base_uint.h>
|
||||
#include <xrpl/beast/utility/instrumentation.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/token/ConfidentialMPTConvert.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/Slice.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/token/ConfidentialMPTConvertBack.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/ReadView.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/token/ConfidentialMPTMergeInbox.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/ReadView.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <xrpl/tx/transactors/token/ConfidentialMPTSend.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/Slice.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/ReadView.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <xrpl/tx/transactors/vault/VaultSet.h>
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/beast/utility/Zero.h>
|
||||
#include <xrpl/protocol/Feature.h>
|
||||
#include <xrpl/protocol/Indexes.h>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
@@ -242,21 +243,21 @@ struct TER_test : public beast::unit_test::Suite
|
||||
|
||||
// 1. Implicit conversion from enum uses transHuman
|
||||
{
|
||||
TER t = tecNO_DST;
|
||||
TER const t = tecNO_DST;
|
||||
BEAST_EXPECT(t.code == tecNO_DST);
|
||||
BEAST_EXPECT(t.reason == transHuman(TERRaw{tecNO_DST}));
|
||||
}
|
||||
|
||||
// 2. Explicit reason
|
||||
{
|
||||
TER t = {tecNO_DST, "custom reason"};
|
||||
TER const t = {tecNO_DST, "custom reason"};
|
||||
BEAST_EXPECT(t.code == tecNO_DST);
|
||||
BEAST_EXPECT(t.reason == "custom reason");
|
||||
}
|
||||
|
||||
// 3. Default constructor uses tesSUCCESS description
|
||||
{
|
||||
TER t;
|
||||
TER const t;
|
||||
BEAST_EXPECT(t.code == tesSUCCESS);
|
||||
BEAST_EXPECT(t.reason == transHuman(TERRaw{tesSUCCESS}));
|
||||
}
|
||||
@@ -264,11 +265,11 @@ struct TER_test : public beast::unit_test::Suite
|
||||
// 4. Copy and move
|
||||
{
|
||||
TER t1 = {tecPATH_DRY, "reason 1"};
|
||||
TER t2 = t1;
|
||||
TER const t2 = t1;
|
||||
BEAST_EXPECT(t2.code == tecPATH_DRY);
|
||||
BEAST_EXPECT(t2.reason == "reason 1");
|
||||
|
||||
TER t3 = std::move(t1);
|
||||
TER const t3 = std::move(t1);
|
||||
BEAST_EXPECT(t3.code == tecPATH_DRY);
|
||||
BEAST_EXPECT(t3.reason == "reason 1");
|
||||
}
|
||||
|
||||
@@ -251,8 +251,8 @@ public:
|
||||
, seqProxy(seqProxy)
|
||||
, txn(txn)
|
||||
, retriesRemaining(retriesRemaining)
|
||||
, preflightResult(preflightResult)
|
||||
, lastResult(lastResult)
|
||||
, preflightResult(std::move(preflightResult))
|
||||
, lastResult(std::move(lastResult))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user