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

Tools for working with Filecoin types in go-ipld-prime #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hannahhoward
Copy link
Contributor

Goals

Recently, go-ipld-prime has received a number of enhancements that make it much easier to work directly with go types as IPLD nodes in the form of the bindnode package. bindnode wraps go types as IPLD nodes using reflect and IPLD schemas. bindnode also provides hooks that allow you to use custom data types in go structs you wrap as IPLD nodes. The PR provides default hooks for a few data types we've already encountered as we worked to convert go-data-transfer v2 to using pure go-ipld-prime and use it with go-fil-markets and boost. While we currently have these hooks embedded in the fil-markets and boost code (duplicated), they are useful to consumers beyond fil-markets -- namely anyone who wants to work with Filecoin types using go-ipld-prime -- either as an alternative to cbor-gen for serialization or to run selectors on Filecoin state (as possible useful example).

Implementation

  • bindnode hooks for:

    • big.Int
    • abi.TokenAmount
    • crypto.Signature
    • address.Address (maybe this should live in go-address, but it starts to feel a tad disjointed)
  • test to prove out roundtrip serialization with a sample type

provide tools for working with filecoin types as ipld nodes
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

@arajasek
Copy link
Collaborator

arajasek commented Sep 2, 2022

@hannahhoward Rebase this please? Looks landable to me.

@rvagg
Copy link
Member

rvagg commented Jan 27, 2023

rebased in #156, I don't have access to push over this

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.

None yet

3 participants