mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 11:45:53 +00:00
refactor: Use std::expected instead of std::variant for errors (#2160)
This commit is contained in:
@@ -59,14 +59,14 @@ FeatureHandler::process(FeatureHandler::Input input, Context const& ctx) const
|
||||
auto const range = sharedPtrBackend_->fetchLedgerRange();
|
||||
ASSERT(range.has_value(), "Feature's ledger range must be available");
|
||||
|
||||
auto const lgrInfoOrStatus = getLedgerHeaderFromHashOrSeq(
|
||||
auto const expectedLgrInfo = getLedgerHeaderFromHashOrSeq(
|
||||
*sharedPtrBackend_, ctx.yield, input.ledgerHash, input.ledgerIndex, range->maxSequence
|
||||
);
|
||||
|
||||
if (auto const status = std::get_if<Status>(&lgrInfoOrStatus))
|
||||
return Error{*status};
|
||||
if (!expectedLgrInfo.has_value())
|
||||
return Error{expectedLgrInfo.error()};
|
||||
|
||||
auto const lgrInfo = std::get<ripple::LedgerHeader>(lgrInfoOrStatus);
|
||||
auto const& lgrInfo = expectedLgrInfo.value();
|
||||
auto const& all = amendmentCenter_->getAll();
|
||||
|
||||
auto searchPredicate = [search = input.feature](auto const& feature) {
|
||||
|
||||
Reference in New Issue
Block a user