MetaMask / MetaMask/metamask-design-system
Improve error handling of `generateSeedEthereum` in design system shared
- Dominant language
- TypeScript
- Stars
- 37
- Forks
- 14
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 60
Description
https://github.com/MetaMask/metamask-design-system/pull/817/files#r2294831748
### Bug: Ethereum Seed Generation Fails With Invalid Inputs
The `generateSeedEthereum` function can return `NaN` because `parseInt` receives an empty string (for short addresses like '0x') or invalid hexadecimal characters from the sliced address. This may cause issues for downstream icon generation expecting a numeric seed.
Contributor guide
Research direction
Read packages/design-system-shared/src/utils/caip-address.ts#L51-L56 and trace generateSeedEthereum from there. Reproduce the short "0x" and invalid-hex cases described in the issue; done means these inputs no longer produce NaN for downstream icon generation, with relevant regression coverage passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100