core: add helper macros for deserialization
A helper function would seem more natural, but there are two reasons why a macro is needed: - many bool fields are bitfields, so we can't take a pointer, and using a macro allows us to avoid taking a pointer. - we have a few diffent types (bool, uint64_t, FreezerState), and we can have type safety without specifying the type by using the macro. This also makes the error messages more informative: they print the exact field identifier that failed, which is more useful for debugging than a description.
Loading
Please register or sign in to comment