Skip to content

Commit

Permalink
removing assert
Browse files Browse the repository at this point in the history
  • Loading branch information
vlntb committed Jan 24, 2025
1 parent 4498ecb commit 58087a5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions include/xrpl/resource/detail/Logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,19 +444,22 @@ class Logic
Disposition
charge(Entry& entry, Charge const& fee, std::string context = {})
{
assert(
feeDrop.cost() > feeInvalidSignature.cost() &&
feeInvalidSignature.cost() > feeInvalidRequest.cost() &&
feeInvalidRequest.cost() > 10);
// Only use these for logging in Logic::charge, and keep the values in
// descending order
static Charge const feeLogAsWarn(3000, "log as warn");
static Charge const feeLogAsInfo(1000, "log as info");
static Charge const feeLogAsDebug(100, "log as debug");

auto getStream = [this](Resource::Charge::value_type cost) {
if (cost >= feeDrop.cost())
if (cost >= feeLogAsWarn.cost())
return m_journal.warn();
if (cost >= feeInvalidSignature.cost())
if (cost >= feeLogAsInfo.cost())
return m_journal.info();
if (cost >= feeInvalidRequest.cost())
if (cost >= feeLogAsDebug.cost())
return m_journal.debug();
return m_journal.trace();
};

if (!context.empty())
context = " (" + context + ")";

Expand Down

0 comments on commit 58087a5

Please sign in to comment.