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

fix: convert v0 -> v1 before base32 conversion #527

Merged
merged 3 commits into from
Nov 19, 2022
Merged

Conversation

b5
Copy link
Member

@b5 b5 commented Nov 19, 2022

fixes n0-computer/beetle#77

turns out you can't go straight from v0 -> base32 v1, which makes sense, but is irritating. Better than the alternative of silently converting into cidv1 I guess.

Anyway, fixes the gateway

@b5 b5 added fix Fixes a bug c-resolver labels Nov 19, 2022
@b5 b5 self-assigned this Nov 19, 2022
@b5 b5 marked this pull request as ready for review November 19, 2022 03:15
.into_v1()
.unwrap()
.to_string_of_base(Base::Base32Lower)
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure this can never error?

let cid_str = cid.to_string_of_base(Base::Base32Lower).unwrap();
let cid_str = cid
.into_v1()
.unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure this can never error?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope...

Copy link
Contributor

Choose a reason for hiding this comment

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

then though shall handle the error :)

@b5 b5 merged commit ab3969c into main Nov 19, 2022
@b5 b5 deleted the b5/fix_cid_v0_base_urls branch November 19, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic when loading from the gateway on main branch
2 participants