zebra
zebra copied to clipboard
Fix documentation of `Commitments` fields
https://github.com/ZcashFoundation/zebra/blob/6032c32124eba4dc2d0b2506a43834dd0c04412f/zebra-rpc/src/methods/trees.rs#L189-L200
These fields are documented as "hex-encoded", which is misleading. When Commitments is serialized as a whole using serde_json, the resulting fields are hex-encoded, but the actual Rust fields store raw bytes and are not hex-encoded. This leads to downstream confusion and misuse of the fields, such as https://github.com/zingolabs/zaino/issues/495.
- The documentation for
Commitmentsand its fields should be overhauled to correctly inform users of its data representation (including onCommitments::new). - Other structs should also be examined for similar bugs.
- Maintaining a comprehensive changelog for each crate (#9626) would help downstream users to figure out how to correctly migrate across these API changes.