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

Encode cid directly in label field rather than try to use structured data #398

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

hannahhoward
Copy link
Collaborator

Goals

Because of issues with encoding the CID in a CBOR struct inside a string field for label, but also not wanting to pad things out with JSON, we're switching to encoding the CID directly as Multibase string.

Implementation

  • Write label field as a multibase string
    • Use base58 for Cid V0 (only one supported)
    • Use base64 for Cid V1 (base32 is default but we're trying to keep things more compact)

encode CIDs directly in the label field in either Base58 (V0) or Base64 (V1)
@codecov-commenter
Copy link

Codecov Report

Merging #398 into master will decrease coverage by 0.05%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #398      +/-   ##
==========================================
- Coverage   61.97%   61.93%   -0.04%     
==========================================
  Files          43       43              
  Lines        3008     3002       -6     
==========================================
- Hits         1864     1859       -5     
  Misses        987      987              
+ Partials      157      156       -1     
Impacted Files Coverage Δ
storagemarket/impl/client.go 2.89% <0.00%> (ø)
storagemarket/impl/clientutils/clientutils.go 78.27% <75.00%> (-1.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d155db9...defc684. Read the comment docs.

Copy link
Contributor

@ingar ingar left a comment

Choose a reason for hiding this comment

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

Looks good

@hannahhoward hannahhoward merged commit 5eee772 into master Sep 9, 2020
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.

3 participants