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

Added standard (un)marshalBinary methods #2

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

ZenGround0
Copy link
Contributor

tl;dr: without these hooks go-filecoin can't serialize any object that contains an embedded address so this PR is needed for gfc interop.

Long version: While gfc makes an effort to play nice with cbg encodings it can only fallback to cbg encode/decode on the top level type being enc/decoded. We would need to use cbg on all datastructures, or write our own complete cbor library that is aware of the cbg marshaling interface signatures in order for embedded datatypes implementing the cbg interfaces to be handled automatically without making this change. Another alternative I proposed here would be to make the cbg interface standardized so that external code could handle cbg interfaces automatically.

The functions introduced satisfy a relevant standard go interface so adding this code is good practice independent of the gfc motivation.

@ZenGround0 ZenGround0 merged commit 9eb4700 into master Feb 7, 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.

2 participants