Open mvadari opened 1 week ago
The changes include the addition of a new script, generate_definitions.py
, which generates a definitions.json
file from the source code of the rippled project. This script reads protocol-related headers and macro files, processes their contents, and outputs structured JSON data. Additionally, the definitions.json
file has undergone significant modifications, with new entries added and several existing entries removed or retained across various sections, including TYPES
, LEDGER_ENTRY_TYPES
, FIELDS
, TRANSACTION_RESULTS
, and TRANSACTION_TYPES
. Furthermore, updates were made to the generate_tx_models.py
script, changing the source files for SFields and TxFormats, and modifying the type mapping.
File | Change Summary |
---|---|
tools/generate_definitions.py | New script created to generate definitions.json . It reads protocol-related files, processes data, and outputs structured JSON. Includes functions for reading files, translating formats, and extracting type information. |
xrpl/core/binarycodec/definitions/definitions.json | Modifications to definitions.json : new entries added in LEDGER_ENTRY_TYPES , several entries removed, and others retained. Changes also include removals in TRANSACTION_RESULTS and TRANSACTION_TYPES . |
tools/generate_tx_models.py | Significant modifications to _parse_rippled_source function to read SFields and TxFormats from new source files. Updated regex patterns and added new entry "UINT192": "str" to TYPE_MAP . |
In the meadow, scripts do play,
Generating definitions, hip-hip-hooray!
New types hop in, old ones take flight,
JSON dances, oh what a sight!
With every change, we leap and bound,
In the world of code, joy is found! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
High Level Overview of Change
This PR adds a script to generate the
definitions.json
file from rippled source code.Context of Change
Copied (and modified) from https://github.com/RichardAH/xrpl-codec-gen. It makes more sense to store this script in the library repo now.
Type of Change
Did you update HISTORY.md?
Test Plan
Works locally.