From 7094aa9376e4ee2dd7291f099bdf5d14550b7456 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 29 Oct 2025 13:20:51 -0400 Subject: [PATCH 1/2] add newlines --- .../src/enums/definitions.json | 22 +++++++++++++++++++ .../tools/generateDefinitions.js | 14 +++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/packages/ripple-binary-codec/src/enums/definitions.json b/packages/ripple-binary-codec/src/enums/definitions.json index 4899a4df01..271b0c5a9d 100644 --- a/packages/ripple-binary-codec/src/enums/definitions.json +++ b/packages/ripple-binary-codec/src/enums/definitions.json @@ -680,6 +680,16 @@ "type": "UInt32" } ], + [ + "MutableFlags", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 53, + "type": "UInt32" + } + ], [ "IndexNext", { @@ -2130,6 +2140,16 @@ "type": "Number" } ], + [ + "DummyInt32", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "Int32" + } + ], [ "TransactionMetaData", { @@ -3366,6 +3386,8 @@ "Hash160": 17, "Hash192": 21, "Hash256": 5, + "Int32": 10, + "Int64": 11, "Issue": 24, "LedgerEntry": 10002, "Metadata": 10004, diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 2e6ce29a84..6cf100f851 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -138,12 +138,14 @@ async function main() { // process STypes let stypeHits = [ ...sfieldHeaderFile.matchAll( - /^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$/gm, + /^ *STYPE\(STI_([^ ]*?)[ \n]*,[ \n]*([0-9-]+)[ \n]*\)[ \n]*\\?$/gm, ), ] if (stypeHits.length === 0) stypeHits = [ - ...sfieldHeaderFile.matchAll(/^ *STI_([^ ]*?) *= *([0-9-]+) *,?$/gm), + ...sfieldHeaderFile.matchAll( + /^ *STI_([^ ]*?)[ \n]*=[ \n]*([0-9-]+)[ \n]*,?$/gm, + ), ] const stypeMap = {} stypeHits.forEach(([_, key, value]) => { @@ -248,7 +250,7 @@ async function main() { // Parse SField.cpp for all the SFields and their serialization info let sfieldHits = [ ...sfieldMacroFile.matchAll( - /^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, + /^ *[A-Z]*TYPED_SFIELD[ \n]*\([ \n]*sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, ), ] sfieldHits.push( @@ -298,7 +300,7 @@ async function main() { } hits = [ ...ledgerFormatsMacroFile.matchAll( - /^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), *([^,]+), \({$/gm, + /^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+[ \n]*,[ \n]*([x0-9a-f]+)[ \n]*,[ \n]*([^,]+),[ \n]*([^,]+), \({$/gm, ), ] hits.push(['', '-1', 'Invalid']) @@ -321,7 +323,7 @@ async function main() { let terHits = [ ...cleanedTerFile.matchAll( - /^ *((tel|tem|tef|ter|tes|tec)[A-Z_]+)( *= *([0-9-]+))? *,? *(\/\/[^\n]*)?$/gm, + /^ *((tel|tem|tef|ter|tes|tec)[A-Z_]+)([ \n]*=[ \n]*([0-9-]+))?[ \n]*,?[ \n]*(\/\/[^\n]*)?$/gm, ), ] let upto = -1 @@ -359,7 +361,7 @@ async function main() { let txHits = [ ...transactionsMacroFile.matchAll( - /^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$/gm, + /^ *TRANSACTION\(tt[A-Z_]+[ \n]*,* ([0-9]+)[ \n]*,[ \n]*([A-Za-z]+).*$/gm, ), ] txHits.push(['', '-1', 'Invalid']) From 40ea5f01cf9c67a8d782f69113b0af2201a5fe02 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 29 Oct 2025 13:22:42 -0400 Subject: [PATCH 2/2] fix typo --- packages/ripple-binary-codec/tools/generateDefinitions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 6cf100f851..5f970f694b 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -361,7 +361,7 @@ async function main() { let txHits = [ ...transactionsMacroFile.matchAll( - /^ *TRANSACTION\(tt[A-Z_]+[ \n]*,* ([0-9]+)[ \n]*,[ \n]*([A-Za-z]+).*$/gm, + /^ *TRANSACTION\(tt[A-Z_]+[ \n]*,[ \n]*([0-9]+)[ \n]*,[ \n]*([A-Za-z]+).*$/gm, ), ] txHits.push(['', '-1', 'Invalid'])