Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/codex32/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ def _error(name: str, base: type[CodexError], doc: str) -> type[CodexError]:
UnknownProfile = _error("UnknownProfile", CodexError, "The HRP is not a registered profile.")
InvalidChecksum = _error("InvalidChecksum", CodexError, "The outer checksum does not validate.")

InvalidHeader = _error("InvalidHeader", CodexError, "The six-symbol header is invalid.")
InvalidThreshold = _error("InvalidThreshold", InvalidHeader, "The threshold is not 0 or 2 through 9.")
InvalidIdentifier = _error("InvalidIdentifier", InvalidHeader, "The identifier is not four symbols.")
InvalidShareIndex = _error("InvalidShareIndex", InvalidHeader, "The share index conflicts with its header.")

InvalidPayload = _error("InvalidPayload", CodexError, "The payload is not permitted by its profile.")
InvalidPadding = _error("InvalidPadding", InvalidPayload, "The discarded payload padding is invalid.")
InvalidBip39Checksum = _error("InvalidBip39Checksum", InvalidPayload, "The BIP39 checksum is invalid.")
InvalidThreshold = _error("InvalidThreshold", CodexError, "The threshold is not 0 or 2 through 9.")
InvalidIdentifier = _error("InvalidIdentifier", CodexError, "The identifier is not four symbols.")
InvalidShareIndex = _error("InvalidShareIndex", CodexError, "The share index conflicts with its header.")

InvalidPadding = _error("InvalidPadding", CodexError, "The discarded payload padding is invalid.")
InvalidBip39Checksum = _error("InvalidBip39Checksum", CodexError, "The BIP39 checksum is invalid.")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're removing the BIP39 profile in another PR, so this doesn't belong in this library anymore.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed for the BIP39-removal PR. profiles/bip39.py still imports and raises InvalidBip39Checksum at this head; deleting it here would break the current profile and expand this PR's scope. Remove both together in that PR. (AI-assisted response.)


InvalidShareSet = _error("InvalidShareSet", CodexError, "Artifacts cannot form an interpolation set.")
WrongShareCount = _error("WrongShareCount", InvalidShareSet, "The share count differs from its threshold.")
Expand Down
Loading