-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modularize several data structures in core #4
Conversation
This is a big PR. It contains no change in functionality, just moved around code, nor does it change any interfaces (except for changing their paths). Let me try to justify it a bit:
These issues are things I identified while modularizing the code, and would have been hard to identify otherwise. Ultimately the way to modularize the code is up to the project lead, and is a bit of a style issue, but I think this scheme will lead to less technical debt. Note that Rust's only encapsulation/privacy boundary is the module, if things share a module then they can access each others' insides. The most controversial thing I did was moving all of Thoughts or comments (or rejection) would be welcome. |
Thanks a lot for the PR, all very good cleanup. I had it in my list to go back to the core module and clean it up, so I'm really glad you tackled it! I agree with most of your changes, separating out block.rs and transaction.rs particulary. Including the serialization code close to the implementation seems fair as well. I was also mulling around with the idea of a separate crypto module for all the Merkle/Hash/Commitment stuff. My only change request is very minor: I'd prefer the MAX_IN_OUT_LEN constant in transaction.rs, I think it'd make more sense there. The ser.rs module is going to be reused for p2p message serialization and that constant makes little sense in there. |
afc5b9d
to
4b51610
Compare
Thanks :). Moved the constant. |
No description provided.