Page MenuHomePhabricator

[Chronik] Refactor serialization, add `db_serialize` and `db_deserialize`.
ClosedPublic

Authored by tobias_ruck on Jul 24 2022, 18:28.

Details

Summary

We will use de-/serialization a lot, so having a module with nice error handling is very helpful.

The db_ prefix indicates that this serialization is only meant for data going in and out of the database.

This also makes it much simpler to move to another serialization format if ever needed.

Test Plan

ninja check-crates

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested changes to this revision.Jul 25 2022, 08:14
Fabien added inline comments.
chronik/chronik-db/src/ser.rs
61 ↗(On Diff #34501)

You should also add a test for the happy path with a ser/deser round trip.

This revision now requires changes to proceed.Jul 25 2022, 08:14

Add tests for db_serialize/db_deserialize happy/unhappy paths

This revision is now accepted and ready to land.Jul 25 2022, 09:12