You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SLEBase's resolveEntry() helper (include/xrpl/ledger/helpers/SLEBase.h) uses const_cast<ReadView*> to reach ApplyView::peek() from a ReadView const&. This is safe today only because xrpld never holds a truly const-qualified ReadView, but it's fragile.
Ideas raised in PR #7886 review, roughly in order of preference:
Add a constpeek() to ReadView that just calls read(), and call peek() here unconditionally.
Make ApplyView::peek() a const function (with the members it touches mutable), then cast view to ApplyView const* instead of stripping const off a ReadView*.
SLEBase'sresolveEntry()helper (include/xrpl/ledger/helpers/SLEBase.h) usesconst_cast<ReadView*>to reachApplyView::peek()from aReadView const&. This is safe today only becausexrpldnever holds a trulyconst-qualifiedReadView, but it's fragile.Ideas raised in PR #7886 review, roughly in order of preference:
ApplyView::read()to use the cache (see ApplyView::read() doesn't go through the apply-state-table cache like peek() does #8068) — would remove the need for this workaround entirely.constpeek()toReadViewthat just callsread(), and callpeek()here unconditionally.ApplyView::peek()aconstfunction (with the members it touchesmutable), then castviewtoApplyView const*instead of strippingconstoff aReadView*.