config: Add Debug Clone for common configs#1542
Merged
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
jsdw
approved these changes
Apr 19, 2024
Collaborator
jsdw
left a comment
There was a problem hiding this comment.
While I do believe they should never be necessary, I'm happy adding these on the concrete types just to make life easier :)
(We used to have such bounds on the trait itself iirc and that I'd object to)
niklasad1
reviewed
Apr 19, 2024
core/src/config/polkadot.rs
Outdated
| pub use primitive_types::{H256, U256}; | ||
|
|
||
| /// Default set of commonly used types by Polkadot nodes. | ||
| #[derive(Debug, Clone)] |
Contributor
There was a problem hiding this comment.
you could probably add Copy as well?
Collaborator
There was a problem hiding this comment.
Maybe we hsould just add all of the "standard" traits? eg perhaps:
Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default
and maybe also a quick dev note that the traits exist just to make life easier but shouldn't strictly be necessary since you can't instantiate this type
niklasad1
approved these changes
Apr 19, 2024
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This tiny PR implements
Debug, CloneforSubstrateConfigandPolkadotConfig.This might be useful for developers that have wrappers over these types, or that store these types in other structs.
cc @AndreiEres let me know if this solves the issue with debugging types from polkadot-interceptor 🙏