Skip to content

Commit

Permalink
fix BEST_OFFER_DEBUGGING
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Dec 2, 2024
1 parent 76a92d9 commit 458c603
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ledger/test/InMemoryLedgerTxn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,4 +402,21 @@ InMemoryLedgerTxn::getBestOffer(Asset const& buying, Asset const& selling,
{
return mRealRootForOffers.getBestOffer(buying, selling, worseThan);
}

#ifdef BEST_OFFER_DEBUGGING
bool
InMemoryLedgerTxn::bestOfferDebuggingEnabled() const
{
return mRealRootForOffers.bestOfferDebuggingEnabled();
}

std::shared_ptr<LedgerEntry const>
InMemoryLedgerTxn::getBestOfferSlow(Asset const& buying, Asset const& selling,
OfferDescriptor const* worseThan,
std::unordered_set<int64_t>& exclude)
{
return mRealRootForOffers.getBestOfferSlow(buying, selling, worseThan,
exclude);
}
#endif
}
9 changes: 9 additions & 0 deletions src/ledger/test/InMemoryLedgerTxn.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ class InMemoryLedgerTxn : public LedgerTxn
LedgerRange const& ledgers) const override;

void deleteObjectsModifiedOnOrAfterLedger(uint32_t ledger) const override;

#ifdef BEST_OFFER_DEBUGGING
virtual bool bestOfferDebuggingEnabled() const override;

virtual std::shared_ptr<LedgerEntry const>
getBestOfferSlow(Asset const& buying, Asset const& selling,
OfferDescriptor const* worseThan,
std::unordered_set<int64_t>& exclude) override;
#endif
};

}

0 comments on commit 458c603

Please sign in to comment.