Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

update go-ipld-format to remove globals, and use go-ipld-cbor explicitly #1605

Conversation

aschmahmann
Copy link

Coming along the same set of changes as filecoin-project/lotus#10921.

The change to go-ipld-format hasn't been merged + released yet but should soon so please let me know if there's a problem

@aschmahmann aschmahmann requested a review from a team as a code owner June 5, 2023 16:59
@@ -18,7 +18,7 @@ require (
github.com/ipfs/go-block-format v0.0.3
github.com/ipfs/go-cid v0.0.7
github.com/ipfs/go-ipld-cbor v0.0.5
github.com/ipfs/go-ipld-format v0.0.2
github.com/ipfs/go-ipld-format v0.4.1-0.20230530195241-c3da01c74a06
Copy link
Author

Choose a reason for hiding this comment

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

TODO: use released version

@@ -334,7 +335,7 @@ func (a *adtNodeGetter) Get(ctx context.Context, c cid.Cid) (format.Node, error)
if err != nil {
return nil, err
}
return format.Decode(b)
return format.Decode(b, ipldcbor.DecodeBlock)
Copy link
Author

Choose a reason for hiding this comment

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

  1. It seems like you were only using dag-cbor here, is that true?
  2. Would you find it more helpful to either
    a) just do ipldcbor.DecodeBlock(b) instead of using the helper in go-ipld-format for checking if the Block is already a Node?
    b) have a registry object you can create and use (either as a global in this file or passed into the constructor) so that you get myRegistry.Decode(b)

@ZenGround0
Copy link
Contributor

Closing down because we are archiving

@ZenGround0 ZenGround0 closed this Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants