input-output-hk / rust-byron-cardano

rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)
MIT License
264 stars 75 forks source link

Ledger serialization/deserialization #735

Closed edolstra closed 5 years ago

edolstra commented 5 years ago

This adds serialization/deserialization of Ledger using serde, which can be used by jormungandr to save/restore the chain state periodically.

It also adds PartialEq and Eq to Ledger and its component types. This is only used by the tests to determine if Ledger is restored correctly.

vincenthz commented 5 years ago

@edolstra we purposely stayed away from Serde and its automatic (and opaque) derivations, and I think this is important to stay away from a code that make automatic/opaque choice for us, since it does usually have a higher cost down the line

Also imhamt has an iterator, which I think should be enough to dump everything. probably a good idea to provide a from_iterator somewhere also.