Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions slip44.json
Original file line number Diff line number Diff line change
Expand Up @@ -4943,6 +4943,12 @@
"symbol": "LUM",
"name": "Lum Network"
},
"881": {
"index": "881",
"hex": "0x80000371",
"symbol": "AEGS",
"name": "Aegisum"
},
"883": {
"index": "883",
"hex": "0x80000373",
Expand Down
6 changes: 3 additions & 3 deletions src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const slip44Content = fs.readFileSync(rawSlip44Path, 'utf8');

const entries = {};
for (const line of slip44Content.split('\n')) {
const segments = line.split('|').slice(1, -1);
const segments = line.split('|').slice(1);
if (
segments.length === 4 &&
/^\|\s*\d+\s*\|\s*0x[a-z0-9]+\s*\|/iu.test(line)
segments.length >= 4 &&
/^\|\s*\d+\s*\|\s*0x[a-z0-9]+\s*\|\s.+\|\s.+\|?$/iu.test(line)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Regex Update Breaks Existing Data Parsing

The new regex pattern for parsing slip44.md uses \s.+ for symbol and name fields, requiring at least one whitespace and one character. This makes validation stricter, preventing parsing of valid entries with empty or whitespace-only symbols/names, which contradicts the goal of loosening validation and breaks existing data. Additionally, the regex, combined with slice(1) and segments.length >= 4, could incorrectly parse lines containing extra | characters within content fields.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The goal with adjusting the regex was to ensure that the lines still have content. This is intended even though it seems more strict.

) {
// eslint-disable-next-line id-denylist
const [index, hex, symbol, name] = segments.map((seg) => seg.trim());
Expand Down
Loading