From 4a73be499d69d7f4157e2dff1f1b775a65962d6f Mon Sep 17 00:00:00 2001 From: Jingchen Date: Thu, 16 Apr 2026 18:12:00 +0100 Subject: [PATCH] fix: Fix unity build for book step (#6942) Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com> --- src/libxrpl/tx/paths/BookStep.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libxrpl/tx/paths/BookStep.cpp b/src/libxrpl/tx/paths/BookStep.cpp index ab2efcf39a..bb71a65823 100644 --- a/src/libxrpl/tx/paths/BookStep.cpp +++ b/src/libxrpl/tx/paths/BookStep.cpp @@ -1427,18 +1427,22 @@ equalHelper(Step const& step, xrpl::Book const& book) bool bookStepEqual(Step const& step, xrpl::Book const& book) { - if (isXRP(book.in) && isXRP(book.out)) - { - // LCOV_EXCL_START - UNREACHABLE("xrpl::test::bookStepEqual : no XRP to XRP book step"); - return false; // no such thing as xrp/xrp book step - // LCOV_EXCL_STOP - } return std::visit( [&](TIn const&, TOut const&) { using TIn_ = typename TIn::amount_type; using TOut_ = typename TOut::amount_type; - return equalHelper>(step, book); + + if constexpr (ValidTaker) + { + return equalHelper>(step, book); + } + else + { + // LCOV_EXCL_START + UNREACHABLE("xrpl::bookStepEqual : invalid book step"); + return false; + // LCOV_EXCL_STOP + } }, book.in.getAmountType(), book.out.getAmountType());