-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor: add rpcName
to LEDGER_ENTRY
macro
#5202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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
|
Looks like Windows tests are failing. I'm not sure how to resolve that. |
include/xrpl/protocol/jss.h
Outdated
#pragma push_macro("LEDGER_ENTRY") | ||
#pragma push_macro("LEDGER_ENTRY_DUPLICATE") | ||
#undef LEDGER_ENTRY | ||
#undef LEDGER_ENTRY_DUPLICATE | ||
|
||
#define LEDGER_ENTRY(tag, value, name, rpcName, fields) \ | ||
JSS(name); \ | ||
JSS(rpcName); | ||
|
||
#define LEDGER_ENTRY_DUPLICATE(tag, value, name, rpcName, fields) JSS(rpcName); | ||
|
||
#include <xrpl/protocol/detail/ledger_entries.macro> | ||
|
||
#undef LEDGER_ENTRY | ||
#undef LEDGER_ENTRY_DUPLICATE | ||
#pragma pop_macro("LEDGER_ENTRY") | ||
#pragma pop_macro("LEDGER_ENTRY_DUPLICATE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern we're going with is this:
#pragma push_macro
#undef
#pragma push_macro
#undef
#define
#define
#include
#undef
#pragma pop_macro
#undef
#pragma pop_macro
@Bronek feels more strongly about this pattern, but I agree it should be consistent everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in c7709ff
The Windows error is this bug. Below is the fix, to go in #ifndef LEDGER_ENTRY_DUPLICATE
#define EXPAND(x) x
#define LEDGER_ENTRY_DUPLICATE(...) EXPAND(LEDGER_ENTRY(__VA_ARGS__))
#endif
...
#undef EXPAND
#undef LEDGER_ENTRY_DUPLICATE |
@bthomee this PR is ready to merge |
The LEDGER_ENTRY macro now takes an additional parameter, which makes it easier to avoid missing including the new field in jss.h and to the list of account_objects/ledger_data filters.
The LEDGER_ENTRY macro now takes an additional parameter, which makes it easier to avoid missing including the new field in jss.h and to the list of account_objects/ledger_data filters.
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 injss.h
and to the list ofaccount_objects
/ledger_data
filters.Context of Change
Prevent easy bugs.
Type of Change
API Impact
No change to the user.
Test Plan
All tests still pass.