-
Notifications
You must be signed in to change notification settings - Fork 310
Closed
Description
Description
All places that accept TXID as CLI arguments need to be updated to use the ltx.ParseTXID
function to ensure consistent TXID format handling across all commands.
Current State
It's unclear if all CLI commands that accept TXID arguments are properly parsing them using the standard parsing function.
Required Changes
- Audit all CLI commands that accept TXID as input
- Ensure they use
ltx.ParseTXID
for parsing - Add validation for invalid TXID formats
- Ensure consistent error messages for invalid TXIDs
Affected Areas
Commands that likely accept TXID arguments:
- Restore commands with point-in-time recovery
- Any commands that filter by transaction range
- Debug or inspection commands
Example Implementation
// Correct parsing
txid, err := ltx.ParseTXID(txidStr)
if err \!= nil {
return fmt.Errorf("invalid TXID format: %w", err)
}
Benefits
- Consistent TXID format validation
- Better error messages for users
- Prevents issues with malformed transaction IDs
Additional Context
This was requested by Ben Johnson to ensure consistent handling of TXID formats throughout the CLI.
Metadata
Metadata
Assignees
Labels
No labels