-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix: use cacao timestamp strings and parse #504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ty for the quick fix!! LGTM 🥳
#[serde(rename = "exp", skip_serializing_if = "Option::is_none")] | ||
pub expiration: Option<CapabilityTime>, | ||
pub expiration: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a raw String and getting no type safety, would it make sense to introduce a new type, that uses string as the underlying storage but provides a method to convert to a DateTime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it might be nice to use a tuple struct with serde transparent. Or at least make these fields private. I can add something like that in the cacao branch I have open.. wanted to fix it before it got released Monday to avoid any weird issues with event serialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the change here: 1d602df
In order to ensure that CACAOs round trip without changing the CID, we use a string when deserializing rather than a chrono::DateTime which can change the second precision that was originally included. It's a bit clunky, open to better ideas.