Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[common] Add Canonical Serialization Spec #622
Same as title. This defines the spec and gives concrete examples for
Inform those that write clients how to implement the specification for their own domain.
Contains examples and those examples are embedded within new unit tests.
Please see how the markdown looks here: https://github.com/davidiw/libra/tree/serialization/common/canonical_serialization
kphfb left a comment
Looks good overall. Just a couple minor comments. I'd like another set of eyes on it since it's such a large diff though. Would also like Rain/Brandon to look at the macro usage. But overall, I accept
Same as title. This defines the spec and gives concrete examples (also implemented in Rust) for RawTransaction and its contents.
Given the importance of canonical serialization within the code base, we are restructuring it to make it to simplify access and understanding. This diff moves each major component into its own separate module (file) and re-exports so as to not break any dependencies. In addition, major types are now fully exposed and implemented, namely signed integers.
Macros reduce the duplicate code. Some challenges arise though: - macros cannot exist within a trait or an impl therefore the macro has to wrap around it so we avoid macros for traits - macros do not support concatenation of inputs, so the entire function name must be specified - macros involving indexes of tuples are just plain complicated and probably less readable for our purposes - tuple of size 1 is colliding with all types -- needs more investigation