mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 23:00:55 +00:00
refactor: Enable remaining clang-tidy cppcoreguidelines checks (#6538)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <test/jtx/AMM.h>
|
||||
#include <test/jtx/Env.h>
|
||||
|
||||
#include <xrpl/basics/safe_cast.h>
|
||||
#include <xrpl/protocol/AMMCore.h>
|
||||
#include <xrpl/protocol/AmountConversions.h>
|
||||
#include <xrpl/protocol/ApiVersion.h>
|
||||
@@ -627,7 +628,8 @@ AMM::bid(BidArg const& arg)
|
||||
amm->isFieldPresent(sfAuctionSlot));
|
||||
if (amm->isFieldPresent(sfAuctionSlot))
|
||||
{
|
||||
auto const& auctionSlot = static_cast<STObject const&>(amm->peekAtField(sfAuctionSlot));
|
||||
auto const& auctionSlot =
|
||||
safe_downcast<STObject const&>(amm->peekAtField(sfAuctionSlot));
|
||||
lastPurchasePrice_ = auctionSlot[sfPrice].iou();
|
||||
}
|
||||
}
|
||||
@@ -719,7 +721,8 @@ AMM::expectAuctionSlot(auto&& cb) const
|
||||
amm->isFieldPresent(sfAuctionSlot));
|
||||
if (amm->isFieldPresent(sfAuctionSlot))
|
||||
{
|
||||
auto const& auctionSlot = static_cast<STObject const&>(amm->peekAtField(sfAuctionSlot));
|
||||
auto const& auctionSlot =
|
||||
safe_downcast<STObject const&>(amm->peekAtField(sfAuctionSlot));
|
||||
if (auctionSlot.isFieldPresent(sfAccount))
|
||||
{
|
||||
// This could fail in pre-fixInnerObjTemplate tests
|
||||
|
||||
@@ -82,18 +82,17 @@ AMMTestBase::AMMTestBase()
|
||||
|
||||
void
|
||||
AMMTestBase::testAMM(
|
||||
std::function<void(jtx::AMM&, jtx::Env&)>&& cb,
|
||||
std::function<void(jtx::AMM&, jtx::Env&)> const& cb,
|
||||
std::optional<std::pair<STAmount, STAmount>> const& pool,
|
||||
std::uint16_t tfee,
|
||||
std::optional<jtx::ter> const& ter,
|
||||
std::vector<FeatureBitset> const& vfeatures)
|
||||
{
|
||||
testAMM(
|
||||
std::move(cb), TestAMMArg{.pool = pool, .tfee = tfee, .ter = ter, .features = vfeatures});
|
||||
testAMM(cb, TestAMMArg{.pool = pool, .tfee = tfee, .ter = ter, .features = vfeatures});
|
||||
}
|
||||
|
||||
void
|
||||
AMMTestBase::testAMM(std::function<void(jtx::AMM&, jtx::Env&)>&& cb, TestAMMArg const& arg)
|
||||
AMMTestBase::testAMM(std::function<void(jtx::AMM&, jtx::Env&)> const& cb, TestAMMArg const& arg)
|
||||
{
|
||||
using namespace jtx;
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ Oracle::ledgerEntry(
|
||||
toJson(jvParams[jss::oracle][jss::oracle_document_id], *documentID);
|
||||
if (index)
|
||||
{
|
||||
std::uint32_t i;
|
||||
std::uint32_t i = 0;
|
||||
if (boost::conversion::try_lexical_convert(*index, i))
|
||||
jvParams[jss::oracle][jss::ledger_index] = i;
|
||||
else
|
||||
|
||||
@@ -27,7 +27,7 @@ class WSClientImpl : public WSClient
|
||||
{
|
||||
Json::Value jv;
|
||||
|
||||
explicit msg(Json::Value&& jv_) : jv(jv_)
|
||||
explicit msg(Json::Value&& jv_) : jv(std::move(jv_))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user