fix: Fix unity build for book step (#6942)

Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
This commit is contained in:
Jingchen
2026-04-16 18:12:00 +01:00
committed by GitHub
parent d52d735543
commit 4a73be499d

View File

@@ -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(
[&]<typename TIn, typename TOut>(TIn const&, TOut const&) {
using TIn_ = typename TIn::amount_type;
using TOut_ = typename TOut::amount_type;
return equalHelper<TIn_, TOut_, BookPaymentStep<TIn_, TOut_>>(step, book);
if constexpr (ValidTaker<TIn_, TOut_>)
{
return equalHelper<TIn_, TOut_, BookPaymentStep<TIn_, TOut_>>(step, book);
}
else
{
// LCOV_EXCL_START
UNREACHABLE("xrpl::bookStepEqual : invalid book step");
return false;
// LCOV_EXCL_STOP
}
},
book.in.getAmountType(),
book.out.getAmountType());