rlp: fix hexToBytes bug#4276
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an hexToBytes parsing bug for 0x-prefixed hex strings (as reported in issue #4275) and adds coverage to prevent regressions.
Changes:
- Correct
hexToBytesto strip the0xprefix viahex.slice(2)(instead of incorrectly keeping only the prefix). - Add unit tests validating decoding for both
0x-prefixed and non-prefixed hex strings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/rlp/src/index.ts | Fixes hexToBytes handling of 0x-prefixed strings. |
| packages/rlp/test/dataTypes.spec.ts | Adds regression tests for hexToBytes with and without 0x prefix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
📦 Bundle Size Analysis
Values are minified+gzipped bundles of each package entry. Workspace deps are bundled; external deps are excluded. Generated by bundle-size workflow |
Fix for bug pointed out in issue #4275
Adds missing unit test that would have caught bug.