refactor: split ulxly command into subcommand packages#829
Merged
Conversation
Reorganize the monolithic cmd/ulxly/ulxly.go (~2567 lines) into organized subcommand packages following patterns from cmd/p2p/. Changes: - Create cmd/ulxly/common/ for shared types, constants, and utilities - Create cmd/ulxly/bridge/ for bridge asset/message/weth commands - Create cmd/ulxly/claim/ for claim asset/message/everything commands - Create cmd/ulxly/proof/ for proof/rollups-proof/empty-proof/zero-proof - Create cmd/ulxly/events/ for get-deposits/get-claims/get-verify-batches - Create cmd/ulxly/tree/ for compute-balance/nullifier/combined tree - Move usage.md files to their respective subpackage directories - Remove unused code from balanceandnullifiertreehelper.go - Simplify root ulxly.go to just import and register subcommands The CLI interface remains unchanged - this is purely a code organization refactor for improved maintainability.
Move shared functions to the common package: - ParseDepositCountFromTransaction and ParseBridgeDepositCount for bridge commands - GetDepositWhenReadyForClaim, GetDeposit, and GetMerkleProofsExitRoots for claim commands - ErrNotReadyForClaim and ErrDepositAlreadyClaimed error sentinels This removes ~355 lines of duplicated code across the bridge/asset, bridge/message, bridge/weth, claim/asset, and claim/message subcommands.
jhkimqd
approved these changes
Jan 21, 2026
Contributor
jhkimqd
left a comment
There was a problem hiding this comment.
+1 lgtm! I've tested this locally and on some integration networks using scripts depending on polycli ulxly bridge asset and polycli ulxly claim asset it seems to be working
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.
Description
Reorganize the monolithic cmd/ulxly/ulxly.go (~2567 lines) into organized subcommand packages following patterns from cmd/p2p/.
Changes:
The CLI interface remains unchanged - this is purely a code organization refactor for improved maintainability.
Jira / Linear Tickets
Testing