feat: Add code generator for transactions and ledger entries#6443
Draft
feat: Add code generator for transactions and ledger entries#6443
Conversation
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
ximinez
reviewed
Feb 27, 2026
| value = args_list[1] | ||
| name = args_list[2] | ||
| rpc_name = args_list[3] | ||
| fields_str = args_list[4] |
Collaborator
There was a problem hiding this comment.
You might be able to make this a little bit more future-proof by setting the fields_str to the last item rather than a specific index. The way the existing macros are written, the fields will always have to be last, so any new fields will be inserted before them. At least until the possible future where the macros are all replaced by python parsers.
a1q123456
commented
Mar 1, 2026
| set(VENV_PYTHON "${VENV_DIR}/Scripts/python.exe") | ||
| set(VENV_PIP "${VENV_DIR}/Scripts/pip.exe") | ||
| else () | ||
| set(VENV_PYTHON "${VENV_DIR}/bin/python") |
Collaborator
Author
There was a problem hiding this comment.
Check if it builds if there's no network connection
| message(STATUS "Using Python3 for code generation: ${Python3_EXECUTABLE}") | ||
|
|
||
| # Set up Python virtual environment for code generation | ||
| set(VENV_DIR "${CMAKE_CURRENT_BINARY_DIR}/codegen_venv") |
Collaborator
Author
There was a problem hiding this comment.
Good to have: may be worth making it a build option
| /.cache | ||
|
|
||
| # Auto-generated protocol wrapper classes (generated at CMake configure time) | ||
| /include/xrpl/protocol_autogen/transactions/ |
Collaborator
Author
There was a problem hiding this comment.
May be a good idea to check those files in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
This PR adds code generators to generate type wrappers for transactions and ledger entries. The generators are python scripts and we generate code during configuration. The generated files are ignored by git but are put under xrpl.protocol_autogen. This approach provides 2 benefits:
transactions.macro,ledger_entries.macro, orsfields.macroContext of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)