rippled icon indicating copy to clipboard operation
rippled copied to clipboard

refactor: add `rpcName` to `LEDGER_ENTRY` macro

Open mvadari opened this issue 1 year ago • 3 comments

High Level Overview of Change

The new LEDGER_ENTRY macro now takes one additional parameter, rpcName. This makes it easier to avoid missing including the new field in jss.h and to the list of account_objects/ledger_data filters.

Context of Change

Prevent easy bugs.

Type of Change

  • [x] Refactor (non-breaking change that only restructures code)

API Impact

No change to the user.

Test Plan

All tests still pass.

mvadari avatar Nov 22 '24 21:11 mvadari

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.8%. Comparing base (49e0d54) to head (a1a203d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5202     +/-   ##
=========================================
- Coverage     77.9%   77.8%   -0.1%     
=========================================
  Files          783     783             
  Lines        66707   66707             
  Branches      8140    8139      -1     
=========================================
- Hits         51964   51929     -35     
- Misses       14743   14778     +35     
Files with missing lines Coverage Δ
include/xrpl/protocol/detail/ledger_entries.macro 100.0% <100.0%> (ø)
src/libxrpl/protocol/LedgerFormats.cpp 100.0% <ø> (ø)
src/xrpld/rpc/detail/RPCHelpers.cpp 82.8% <ø> (ø)

... and 10 files with indirect coverage changes

Impacted file tree graph

codecov[bot] avatar Nov 22 '24 23:11 codecov[bot]

Looks like Windows tests are failing. I'm not sure how to resolve that.

mvadari avatar Dec 02 '24 15:12 mvadari

The Windows error is this bug. Below is the fix, to go in ledger_entries.macro:

#ifndef LEDGER_ENTRY_DUPLICATE
#define EXPAND(x) x
#define LEDGER_ENTRY_DUPLICATE(...) EXPAND(LEDGER_ENTRY(__VA_ARGS__))
#endif

...

#undef EXPAND
#undef LEDGER_ENTRY_DUPLICATE

thejohnfreeman avatar Dec 04 '24 01:12 thejohnfreeman

@bthomee this PR is ready to merge

mvadari avatar Jan 02 '25 15:01 mvadari