Skip to content

correct: Say why the entry was invalid when suggesting a repair #85

Description

@BenWestgate

When a string is invalid, correct shows only the repaired string. So does the interactive "Possible correction" prompt in secret, share, wallet and create --existing. codex32 check already names the problem. Keep offering the repair, and print one line to standard error that says what was wrong:

  • Header: the threshold is not 0 or 2–9, or the threshold is 0 and the share index is not S.
  • Length: the string is not one of the valid lengths.
  • Character set: the string contains a character outside the bech32 alphabet, such as i, b or o.
  • Case: the string mixes upper and lower case. Say that codex32 strings are either all uppercase or all lowercase, so a mixed-case string is invalid for that reason. Also say that letter case doesn't change the seed or its fingerprint. A tester's main worry here was whether a different case recovers the same wallet.

Checked with BIP-93 test vector 1 damaged five ways: last letter lowercase, threshold A, index A with threshold 0, I or B in the data, and one extra character. correct repaired each one without saying what was wrong, and check named the cause every time. This was on a disposable tip that includes #42.

This builds on #42 (#37), which makes correct repair mixed-case input. Without #42, correct on reviewability-v1 reports "No valid correction found" when an uppercase string has a single lowercase letter.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliCommand-line interface behavior.area: correctionCorrection engine and correction UX.enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions