This PR proposes to fragment the serialization (Codec) implementation for different primitives from codec.rs into separate modules, i.e.: amount, recoverable_signature, etc., rename some of the interfaces, and document the code more thoroughly.
⚠️ The code added so far seeks to illustrate the proposed structure. I will implement it fully if this makes sense.
Background
While implementing the Codec trait's unit tests, I noted that the code could benefit from a bit more modularity in favor of readability and making unit tests more focused.
Summary of changes
This PR proposes to fragment the serialization (
Codec
) implementation for different primitives from codec.rs into separate modules, i.e.:amount
,recoverable_signature
, etc., rename some of the interfaces, and document the code more thoroughly.Background
While implementing the
Codec
trait's unit tests, I noted that the code could benefit from a bit more modularity in favor of readability and making unit tests more focused.Proposed structure
Related PRs
413
Testing
Run tests normally via
cargo make test
.Risks
None.
How were these changes tested?
The tests included produce the same results as the ones in the existing
Codec
trait implementations, ensuring they work the same.What future testing should occur?
Checklist: