Why
The conversion between Certificate and CertificateRecord is fallible: conversions operations can fail (e.g. to_json_hex()).
Currently, these conversions are implemented using From with unwrap(). Switching to TryFrom makes failures explicit and allows for proper error propagation.
What
Update the conversions in mithril-aggregator/src/database/record/certificate.rs:
- Change
impl From<Certificate> for CertificateRecord to TryFrom
- Change
impl From<CertificateRecord> for Certificate to TryFrom
How