Skip to content

Refactor: Alphabetically sort transaction type conditionals in Signat…Refactor: Alphabetically sort transaction type handling in SignatureUtils (#701)#707

Open
LukasDEDD wants to merge 2 commits intoXRPLF:mainfrom
LukasDEDD:feature/701-a

Conversation

@LukasDEDD
Copy link

Summary

This PR implements the refactor requested in issue #701 by alphabetically
sorting the long if/else if chains in:

  • addSignatureToTransaction(...)
  • addMultiSignaturesToTransaction(...)

Both methods contain large conditional blocks that map runtime transaction
types to their corresponding builders. Alphabetical ordering improves:

  • readability
  • consistency
  • ease of navigation
  • reduces merge conflicts when new transaction types are added

What was changed

  • Reordered all else if branches alphabetically by transaction class name
  • No logic was modified
  • No new functionality was added
  • No behavior was changed

Why this change is safe

  • Only the order of branches changed
  • Each branch still maps the same transaction type to the same builder
  • No fields, signatures, or validation logic were touched
  • All existing tests pass without modification

Additional notes

This is a pure refactor with no functional impact. It aligns the codebase with
the maintainers' request for improved maintainability and consistency.

…ureUtils

This refactor alphabetically orders the long if/else chains in both
addSignatureToTransaction and addMultiSignaturesToTransaction to improve
readability, maintainability, and reduce merge conflicts when adding new
transaction types. No functional behavior is changed.
@LukasDEDD
Copy link
Author

I hope everything is OK now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants