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

Test CACAO DagCbor round-trip #13

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Apr 1, 2022

Updates #12 to add additional testing, using libipld's assert_roundtrip.

Debug + PartialEq needed to be implemented on the CACAO types in order to use assert_roundtrip.

This is in a separate draft PR because it depends on spruceid/siwe-rs#20 (making siwe::TimeStamp implement Debug), which is not yet published.

Note that even though this is a round-trip test, I found that the serialization used internally (in assert_roundtrip, e.g. cacao.encode(DagCborCodec, &mut bytes)) does not does exactly match the byte array being used as input taken from Ceramic. Segments for some properties appear in a different order; i.e. it appears that either the Rust or Ceramic DagCbor serialization is not deterministic, or they otherwise have a discrepancy in the field ordering; opened #14 about that.

@chunningham chunningham changed the base branch from feat/ipld-fix to feat/ipld April 4, 2022 09:04
Base automatically changed from feat/ipld to main April 4, 2022 13:04
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.

1 participant