Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check value not bigger than 0x8000'0000 #5

Merged
merged 1 commit into from
Jan 1, 2021
Merged

Conversation

rllola
Copy link
Contributor

@rllola rllola commented Mar 9, 2020

No description provided.

@rllola rllola requested a review from jleni March 9, 2020 16:04
@rllola rllola self-assigned this Mar 9, 2020
@jleni
Copy link
Member

jleni commented Mar 9, 2020

Bigger or equal should fail..
The requirement is 0 <= value < 0x8000'0000

Comment on lines 179 to 183
m.write_u32::<LittleEndian>(harden | path.purpose).unwrap();
m.write_u32::<LittleEndian>(harden | path.coin).unwrap();
m.write_u32::<LittleEndian>(path.account).unwrap();
m.write_u32::<LittleEndian>(path.change).unwrap();
m.write_u32::<LittleEndian>(path.index).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

This will lead to confusion.. better not to harden anything here..
We should better unify API here with other libs.. let's not "auto-harden" and then leave this without checks..
we can another function that goes from path: str to BIP44Path where we do the checks

Copy link
Member

Choose a reason for hiding this comment

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

we can bring the code from filecoin-rs here too for API consistency

@rllola
Copy link
Contributor Author

rllola commented Dec 21, 2020

Should we close this PR and open an issue to allow string path. It would be a bit more dev friendly.

@jleni jleni merged commit a97ffbe into master Jan 1, 2021
@ghost ghost deleted the check_path_value branch March 24, 2022 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants