From 91f20bc785310e35ceb89181a8fd7d47baa83e6d Mon Sep 17 00:00:00 2001 From: Gregory Tsipenyuk Date: Mon, 5 Feb 2024 10:57:12 -0500 Subject: [PATCH] Fix clang format, Windows build, AMM test debugging --- src/ripple/app/paths/impl/MPTEndpointStep.cpp | 3 +-- src/ripple/app/paths/impl/PaySteps.cpp | 2 ++ src/ripple/app/tx/impl/Payment.cpp | 5 ++--- src/ripple/protocol/Asset.h | 6 +++--- src/test/app/AMM_test.cpp | 12 +----------- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/ripple/app/paths/impl/MPTEndpointStep.cpp b/src/ripple/app/paths/impl/MPTEndpointStep.cpp index 8d58ed2f9fc..d76d7216da8 100644 --- a/src/ripple/app/paths/impl/MPTEndpointStep.cpp +++ b/src/ripple/app/paths/impl/MPTEndpointStep.cpp @@ -239,8 +239,7 @@ class DirectMPTPaymentStep : public MPTEndpointStep using MPTEndpointStep::MPTEndpointStep; using MPTEndpointStep::check; - bool - verifyPrevStepDebtDirection(DebtDirection) const + bool verifyPrevStepDebtDirection(DebtDirection) const { // A payment doesn't care whether or not prevStepRedeems. return true; diff --git a/src/ripple/app/paths/impl/PaySteps.cpp b/src/ripple/app/paths/impl/PaySteps.cpp index ee37f1b6f19..4d9e4308ed3 100644 --- a/src/ripple/app/paths/impl/PaySteps.cpp +++ b/src/ripple/app/paths/impl/PaySteps.cpp @@ -701,5 +701,7 @@ template bool isDirectXrpToXrp(Strand const& strand); template bool isDirectXrpToXrp(Strand const& strand); +template bool +isDirectXrpToXrp(Strand const& strand); } // namespace ripple diff --git a/src/ripple/app/tx/impl/Payment.cpp b/src/ripple/app/tx/impl/Payment.cpp index bbd427ca081..fb5665fb7c3 100644 --- a/src/ripple/app/tx/impl/Payment.cpp +++ b/src/ripple/app/tx/impl/Payment.cpp @@ -150,9 +150,8 @@ Payment::preflight(PreflightContext const& ctx) if (bXRPDirect && partialPaymentAllowed) { // Consistent but redundant transaction. - JLOG(j.trace()) - << "Malformed transaction: " - << "Partial payment specified for XRP to XRP."; + JLOG(j.trace()) << "Malformed transaction: " + << "Partial payment specified for XRP to XRP."; return temBAD_SEND_PARTIAL; } if (bDirect && limitQuality) diff --git a/src/ripple/protocol/Asset.h b/src/ripple/protocol/Asset.h index 355d9a9a856..9f2d78cafbf 100644 --- a/src/ripple/protocol/Asset.h +++ b/src/ripple/protocol/Asset.h @@ -95,15 +95,15 @@ class Asset } template - requires(std::is_same_v || std::is_same_v) + requires(std::is_same_v || std::is_same_v) T const* get() const { return std::get_if(asset_); } - operator Currency const&() const; + operator Currency const &() const; - operator MPT const&() const; + operator MPT const &() const; friend constexpr bool comparable(Asset const& a1, Asset const& a2) diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index ad4dd4015a1..b0e5106f9eb 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -4820,17 +4820,7 @@ struct AMM_test : public jtx::AMMTest void run() override { - //testCore(); - using namespace jtx; - Env env(*this); - fund(env, gw, {alice, bob}, {USD(1'000)}, Fund::All); - env(rate(gw, 1.25)); - env.close(); - env(pay(alice, bob, USD(100)), sendmax(USD(125)), txflags(tfPartialPayment)); - env.close(); - std::cout << env.balance(gw, USD) << std::endl; - std::cout << env.balance(alice, USD) << std::endl; - std::cout << env.balance(bob, USD) << std::endl; + testCore(); } };