Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari committed Nov 18, 2024
1 parent 6267de4 commit 85f0f64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/xrpl/tools/generateModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let jsTransactionFile

function processRippledSource(folder) {
const sfieldMacroFile = readFile(
path.join(process.argv[2], '/include/xrpl/protocol/detail/sfields.macro'),
path.join(folder, '/include/xrpl/protocol/detail/sfields.macro'),
)
const sfieldHits = sfieldMacroFile.matchAll(
/^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm,
Expand Down Expand Up @@ -162,7 +162,7 @@ export { ${tx} } from './${tx}'`,

function generateParamLine(sfields, param, isRequired) {
const paramName = param.slice(2)
const paramType = sfields[paramName]
const paramType = sfields[paramName] ?? 'any'
const paramTypeOutput = typeMap[paramType]
return ` ${paramName}${isRequired ? '' : '?'}: ${paramTypeOutput}\n`
}
Expand Down

0 comments on commit 85f0f64

Please sign in to comment.